### PriceLabs API Signed Headers Example Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs Example values for the signed headers that PriceLabs expects in requests. These are generated using a hashing algorithm and an integration token. ```text headers["X-PL-SIGNED-HEADERS"] = "v1.567425e5a91b576652d591cabea78e9e1fe017d1c67e2d812ae2859c355965ff" headers["X-PL-SIGNED-BODY"] = "5011b348ff6691bb9cbe93f85ffb836ef0e3fec45a4ce924f5940cb1aa4071b8" ``` -------------------------------- ### Delta Push Logic Example (Conceptual) Source: https://help.pricelabs.co/portal/en/kb/articles/guide-for-using-both-airbnb-booking-com-and-vrbo-with-pricelabs Illustrates PriceLabs' Delta Push logic where prices are only updated if the difference from the last pushed price is $5 or more. This optimizes API calls and maintains price alignment. ```text Date| Calculated Price| Difference| Update Pushed? ---|---|---|--- Jan 1| $100| –| Yes Jan 2| $104| $4| No Jan 3| $108| $8| Yes ``` -------------------------------- ### PriceLabs API Request Signing Pseudo Code Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs Example pseudo code demonstrating how to generate signatures for API requests to PriceLabs. This involves combining version, headers, and the JSON body, then signing them using an API token. ```pseudocode api_token = "26eea40c-f297-4b68-aeb8-bb626fe4b5e5" header_components = "v1:request_source:request_timestamp:request_id" signed_headers = "v1." + sha256_sign( header_components, api_token ) body_components = signed_headers + "{\"test\":\"body\"}" signed_body = sha256_sign( body_components, api_token ) ``` -------------------------------- ### Authentication and Credentials Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs Details on how to obtain and use authentication credentials for accessing the PriceLabs IAPI. ```APIDOC ## Authentication and Credentials ### Description To access the PriceLabs IAPI, you need to generate and use specific credentials. These credentials are used for authenticating your requests. ### Method N/A (Credentials are obtained via support) ### Endpoint N/A (Credentials are obtained via support) ### Parameters #### Request Headers - **X-INTEGRATION-NAME** (string) - Required - Provided by PriceLabs and is constant. - **X-INTEGRATION-TOKEN** (string) - Required - Initially provided by PriceLabs and can be regenerated via an endpoint by the PMS. ### Request Example N/A ### Response #### Success Response (Credentials Issued) - The credentials (X-INTEGRATION-NAME and X-INTEGRATION-TOKEN) will be provided by the PriceLabs support team. #### Response Example N/A ``` -------------------------------- ### Get Prices API Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs This API can be called after the sync URL is triggered by PriceLabs to fetch the latest dynamic prices for listings. It's recommended but not mandatory. ```APIDOC ## GET /get_prices ### Description Fetches the latest dynamic prices for listings after PriceLabs has triggered the sync URL. This call should be made only after the sync URL trigger, not via a CRON job. ### Method GET ### Endpoint /get_prices ### Parameters #### Path Parameters None #### Query Parameters - **listing_ids** (array of strings) - Optional - A list of listing IDs to fetch prices for. If omitted, prices for all relevant listings will be returned. - **start_date** (string) - Optional - The start date for which to fetch prices (YYYY-MM-DD). - **end_date** (string) - Optional - The end date for which to fetch prices (YYYY-MM-DD). ### Request Example ``` GET /get_prices?listing_ids[]=L2001&listing_ids[]=L2002&start_date=2023-10-26&end_date=2023-11-01 ``` ### Response #### Success Response (200) - **prices** (object) - An object containing pricing information per listing. - **listing_id** (string) - The ID of the listing. - **rates** (array) - An array of daily price objects. - **date** (string) - The date (YYYY-MM-DD). - **price** (number) - The dynamic price recommended by PriceLabs. #### Response Example ```json { "prices": [ { "listing_id": "L2001", "rates": [ { "date": "2023-10-26", "price": 155.50 }, { "date": "2023-10-27", "price": 165.00 } ] }, { "listing_id": "L2002", "rates": [ { "date": "2023-10-26", "price": 180.00 } ] } ] } ``` ``` -------------------------------- ### Pricing Features Supported Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs Overview of the pricing features that can be supported and controlled via the PriceLabs API. ```APIDOC ## Pricing Features Supported ### Description PriceLabs' API supports various dynamic pricing features. It is recommended to implement the mandatory features for a basic integration, while optional features enhance the integration's capabilities. ### Method N/A (This describes the capabilities of the API) ### Endpoint N/A (Applies to the overall API functionality) ### Features #### Mandatory Features: - **Prices** (*): Allows dynamic adjustment of listing prices. - **Min-Stay** (*): Enables setting minimum length of stay rules. #### Optional Features: - **Check in and Check Out restrictions**: Define specific rules for arrival and departure dates. - **Length of Stay (LOS) pricing**: Apply different pricing based on the duration of the stay. ### Request Example N/A ### Response N/A ``` -------------------------------- ### Booking.com Delta Push Example Source: https://help.pricelabs.co/portal/en/kb/articles/guide-for-using-both-airbnb-and-booking-with-pricelabs Illustrates the Booking.com Delta Push mechanism where rates are only updated if the new calculated rate differs by $5 or more from the last pushed rate. This minimizes API calls while maintaining pricing accuracy. ```text Example: * Jan 1: Price for Jan 5 is $100. * Jan 2: New calculated price for Jan 5 is $104 â â€“ No update (difference is less than $5). * Jan 3: New calculated price for Jan 5 is $108 â â€“ Update pushed (difference is $8). ``` -------------------------------- ### PMS URL Configuration Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs Information on configuring the necessary URLs within your Property Management System (PMS) to receive data from PriceLabs. ```APIDOC ## PMS URL Configuration ### Description Your PMS needs to be configured with specific URLs to receive pricing information and updates from PriceLabs. These URLs are provided to PriceLabs via the `/integration` endpoint. ### Method POST ### Endpoint `/integration` ### Parameters #### Request Body - **sync_url** (string) - Mandatory - The endpoint PriceLabs will call to push listings, prices, and settings. - **calendar_trigger_url** (string) - Mandatory - The endpoint PriceLabs will call to notify the PMS about listings needing a full refresh. - **hook_url** (string) - Optional - An endpoint for PriceLabs to send notifications about specific listings, errors, or missing data. ### Request Example ```json { "sync_url": "https://your-pms.com/api/pricelabs/sync", "calendar_trigger_url": "https://your-pms.com/api/pricelabs/calendar_trigger", "hook_url": "https://your-pms.com/api/pricelabs/hook" } ``` ### Response #### Success Response (200) - Confirmation that the URLs have been registered. #### Response Example ```json { "message": "Integration URLs updated successfully." } ``` ``` -------------------------------- ### GET /status Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs This endpoint is used to pull information from PriceLabs on the current state of associated data. Information can be pulled for reservations, listings, and listing calendars. ```APIDOC ## GET /status ### Description This endpoint is used to pull information from PriceLabs on the current state of associated data. Information can be pulled for reservations, listings, and listing calendars. ### Method GET ### Endpoint /status ### Parameters #### Query Parameters - **data_type** (string) - Optional - The type of data to retrieve. Options: "reservations", "listings", "calendars". Defaults to all if not specified. - **listing_ids** (array) - Optional - A comma-separated list of listing IDs to filter the status. ### Response #### Success Response (200) - **status_data** (object) - An object containing the status information for the requested data types. #### Response Example ```json { "status_data": { "listings": [ { "listing_id": 12345, "status": "active" } ], "reservations": [ { "reservation_id": 67890, "listing_id": 12345, "status": "confirmed" } ] } } ``` ``` -------------------------------- ### POST /listings Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs This endpoint is used to add or update listing information. It is a prerequisite for the /calendar endpoint. ```APIDOC ## POST /listings ### Description This endpoint is used to add or update listing information. It is a prerequisite for the /calendar endpoint. ### Method POST ### Endpoint /listings ### Parameters #### Request Body - **listing_id** (integer) - Required - The ID of the listing. - **name** (string) - Required - The name of the listing. - **address** (string) - Required - The address of the listing. - **country** (string) - Required - The country of the listing. - **city** (string) - Required - The city of the listing. - **state** (string) - Optional - The state of the listing. - **zip_code** (string) - Optional - The zip code of the listing. - **bedrooms** (integer) - Optional - The number of bedrooms. - **bathrooms** (number) - Optional - The number of bathrooms. - **max_guests** (integer) - Optional - The maximum number of guests. ### Request Example ```json { "listing_id": 12345, "name": "Cozy Beach House", "address": "123 Ocean Ave", "country": "USA", "city": "Miami", "state": "FL", "zip_code": "33101", "bedrooms": 3, "bathrooms": 2.5, "max_guests": 6 } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating the listing was updated. #### Response Example ```json { "message": "Listing updated successfully." } ``` ``` -------------------------------- ### Security: PriceLabs requests to PMS Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs Details on how PriceLabs signs requests sent to your PMS, including header and body signing procedures. ```APIDOC ## Security: PriceLabs requests to PMS ### Description PriceLabs signs requests sent to your PMS using a combination of headers, a version string, and the JSON body. You will need to verify these signatures to ensure the integrity of the data. ### Method N/A (This describes the format of incoming requests from PriceLabs) ### Endpoint N/A (Applies to all endpoints where PriceLabs sends data to the PMS) ### Parameters #### Request Headers (Provided by PriceLabs) - **X-PL-SIGNED-HEADERS** (string) - The signature for the combined header components. - **X-PL-SIGNED-BODY** (string) - The signature for the combined body components. #### Request Body (Sent by PriceLabs) - JSON payload containing pricing information, availability, etc. ### Request Example (Illustrative Pseudo-code) ``` // Example values version = "v1" headers["X-SOURCE"] = "request_source" headers["X-PL-TIMESTAMP"] = "request_timestamp" headers["X-PL-REQUESTID"] = "request_id" body = "{\"test\":\"body\"}" api_token = "YOUR_INTEGRATION_TOKEN" // Signing headers header_components = version + ":" + headers["X-SOURCE"] + ":" + headers["X-PL-TIMESTAMP"] + ":" + headers["X-PL-REQUESTID"] signed_headers = version + "." + sha256_sign( header_components, api_token ) // Signing body body_components = signed_headers + body signed_body = sha256_sign( body_components, api_token ) // Headers provided by PriceLabs: // headers["X-PL-SIGNED-HEADERS"] = signed_headers // headers["X-PL-SIGNED-BODY"] = signed_body ``` ### Response #### Success Response (Verification) - The PMS should compare the received signatures with self-calculated signatures to verify the request. #### Response Example ```json { "message": "Request signature verified successfully." } ``` ``` -------------------------------- ### POST /calendar Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs This endpoint is used to update rates and availability for a listing. It should be called after /listings or when rates/availability change. ```APIDOC ## POST /calendar ### Description This endpoint is used to update rates and availability for a listing. It should be called after /listings or when rates/availability change. ### Method POST ### Endpoint /calendar ### Parameters #### Request Body - **listing_id** (integer) - Required - The ID of the listing. - **rates** (array) - Required - An array of rate objects for specific dates. - **date** (string) - Required - The date for the rate (YYYY-MM-DD). - **price** (number) - Required - The price for the date. - **availability** (array) - Required - An array of availability objects for specific dates. - **date** (string) - Required - The date for the availability (YYYY-MM-DD). - **available** (boolean) - Required - Indicates if the listing is available on that date. ### Request Example ```json { "listing_id": 12345, "rates": [ { "date": "2023-11-01", "price": 160.00 }, { "date": "2023-11-02", "price": 170.00 } ], "availability": [ { "date": "2023-11-01", "available": true }, { "date": "2023-11-02", "available": false } ] } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating the calendar was updated. #### Response Example ```json { "message": "Calendar updated successfully." } ``` ``` -------------------------------- ### Listings API Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs This API call is mandatory for new listings or to push updates to existing listings in PriceLabs. It's crucial for enabling PriceLabs to provide pricing recommendations. ```APIDOC ## POST /listings ### Description Creates or updates listing information in PriceLabs. This is essential for PriceLabs to generate pricing recommendations. The `user_token` parameter must include the client's registered email ID with PriceLabs. ### Method POST ### Endpoint /listings ### Parameters #### Path Parameters None #### Query Parameters - **user_token** (string) - Required - The client's registered email ID with PriceLabs. #### Request Body - **listing_id** (string) - Required - A unique identifier for the listing within the PMS. This ID must be unique across all users in the PMS. - **name** (string) - Required - The name of the listing. - **address** (string) - Required - The address of the listing. - **city** (string) - Required - The city where the listing is located. - **state** (string) - Required - The state/province where the listing is located. - **zip_code** (string) - Required - The postal code of the listing. - **country** (string) - Required - The country where the listing is located. - **bedrooms** (integer) - Optional - Number of bedrooms. - **bathrooms** (number) - Optional - Number of bathrooms. - **capacity** (integer) - Optional - Maximum number of guests. - **attributes** (object) - Optional - Additional listing attributes. - **multi_unit** (boolean) - True if the property has multiple units. ### Request Example ```json { "listing_id": "L2001", "name": "Cozy Apartment in Downtown", "address": "123 Main St", "city": "Anytown", "state": "CA", "zip_code": "90210", "country": "USA", "bedrooms": 1, "bathrooms": 1.5, "capacity": 4, "attributes": { "multi_unit": false } } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message of successful listing creation/update. - **listing_id** (string) - The ID of the created or updated listing. #### Response Example ```json { "message": "Listing L2001 updated successfully.", "listing_id": "L2001" } ``` ``` -------------------------------- ### Calendar API Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs This endpoint is used to update the calendar of a listing with daily price and availability, which is mandatory for PriceLabs to derive dynamic pricing. ```APIDOC ## POST /calendar ### Description Updates the daily price and availability for a specific listing. This is mandatory for PriceLabs to calculate dynamic pricing. Initial calls for new listings require at least 730 days of data. ### Method POST ### Endpoint /calendar ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **listing_id** (string) - Required - The unique identifier of the listing. - **start_date** (string) - Required - The start date for the calendar update (YYYY-MM-DD). - **end_date** (string) - Required - The end date for the calendar update (YYYY-MM-DD). - **rates** (array) - Required - An array of daily rate objects. - **date** (string) - Required - The date for the rate (YYYY-MM-DD). - **price** (number) - Required - The nightly price. - **available** (boolean) - Required - Availability status for the date. - **min_stay** (integer) - Optional - Minimum stay requirement for this date. - **max_stay** (integer) - Optional - Maximum stay requirement for this date. - **closed** (boolean) - Optional - If true, the listing is closed on this date. ### Request Example ```json { "listing_id": "L2001", "start_date": "2023-10-26", "end_date": "2023-10-28", "rates": [ { "date": "2023-10-26", "price": 150.00, "available": true, "min_stay": 2 }, { "date": "2023-10-27", "price": 160.00, "available": true }, { "date": "2023-10-28", "price": 170.00, "available": false } ] } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message of successful calendar update. #### Response Example ```json { "message": "Calendar updated successfully for listing L2001." } ``` ``` -------------------------------- ### PriceLabs API Authentication Headers Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs Required security headers for authenticating with the PriceLabs API. X-INTEGRATION-TOKEN is provided by PriceLabs and can be regenerated, while X-INTEGRATION-NAME is constant. ```text X-INTEGRATION-NAME X-INTEGRATION-TOKEN ``` -------------------------------- ### POST /rate_plans Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs If the listing has multiple rate plans, this endpoint can be called to add or update rate plans for the listing. It is important to note that there should be exactly only one default rate plan for each listing. ```APIDOC ## POST /rate_plans ### Description If the listing has multiple rate plans, this endpoint can be called to add or update rate plans for the listing. It is important to note that there should be exactly only one default rate plan for each listing. ### Method POST ### Endpoint /rate_plans ### Parameters #### Request Body - **listing_id** (integer) - Required - The ID of the listing. - **rate_plans** (array) - Required - An array of rate plan objects. - **plan_id** (integer) - Optional - The ID of the rate plan (if updating). - **name** (string) - Required - The name of the rate plan. - **is_default** (boolean) - Required - Indicates if this is the default rate plan. - **pricing_model** (object) - Required - The pricing model for the rate plan. - **type** (string) - Required - The type of pricing model (e.g., "base", "seasonal"). - **base_price** (number) - Required - The base price for the model. ### Request Example ```json { "listing_id": 12345, "rate_plans": [ { "name": "Standard Rate", "is_default": true, "pricing_model": { "type": "base", "base_price": 150.00 } }, { "name": "Weekend Rate", "is_default": false, "pricing_model": { "type": "seasonal", "days_of_week": [5, 6], "multiplier": 1.2 } } ] } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating the rate plans were updated. #### Response Example ```json { "message": "Rate plans updated successfully." } ``` ``` -------------------------------- ### POST /reservations Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs This endpoint is used to add a new reservation or update an existing reservation for a listing. It is recommended to call this endpoint whenever there are new reservations or updates or cancellations to existing reservations. ```APIDOC ## POST /reservations ### Description This endpoint is used to add a new reservation or update an existing reservation for a listing. It is recommended to call this endpoint whenever there are new reservations or updates or cancellations to existing reservations. ### Method POST ### Endpoint /reservations ### Parameters #### Request Body - **listing_id** (integer) - Required - The ID of the listing. - **start_date** (string) - Required - The start date of the reservation (YYYY-MM-DD). - **end_date** (string) - Required - The end date of the reservation (YYYY-MM-DD). - **status** (string) - Required - The status of the reservation (e.g., "RESERVED", "BLOCKED"). - **total_cost** (number) - Required - The total cost of the reservation, including fees and taxes. - **currency** (string) - Required - The currency of the total cost (e.g., "USD"). - **owner_notes** (string) - Optional - Notes for the owner. - **guest_notes** (string) - Optional - Notes for the guest. - **external_id** (string) - Optional - An external ID for the reservation. ### Request Example ```json { "listing_id": 12345, "start_date": "2023-10-26", "end_date": "2023-10-29", "status": "RESERVED", "total_cost": 500.00, "currency": "USD", "owner_notes": "Special event reservation." } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating the reservation was updated. #### Response Example ```json { "message": "Reservation updated successfully." } ``` ``` -------------------------------- ### POST /integration Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs This endpoint is used to update PMS URLs and fetch the Integration Token. The Integration Token must be stored by the PMS to make subsequent API calls to PriceLabs. ```APIDOC ## POST /integration ### Description This endpoint is used to update PMS URLs and fetch the Integration Token. The Integration Token must be stored by the PMS to make subsequent API calls to PriceLabs. ### Method POST ### Endpoint /integration ### Parameters #### Request Body - **sync_url** (string) - Required - The URL for PriceLabs to send sync updates. - **calendar_trigger_url** (string) - Required - The URL for PriceLabs to trigger calendar updates. - **reservations_url** (string) - Required - The URL for PriceLabs to send reservation information. ### Request Example ```json { "sync_url": "https://fancyrentals.com/api/sync", "calendar_trigger_url": "https://fancyrentals.com/api/calendar_trigger", "reservations_url": "https://fancyrentals.com/api/reservations" } ``` ### Response #### Success Response (200) - **integration_token** (string) - The unique integration token for the PMS. #### Response Example ```json { "integration_token": "YOUR_INTEGRATION_TOKEN_HERE" } ``` ``` -------------------------------- ### Integration API Source: https://help.pricelabs.co/portal/en/kb/articles/building-an-integration-with-pricelabs This endpoint is used to update and maintain the PMS integration with PriceLabs, including updating sync URLs, calendar trigger URLs, hook URLs, refreshing API tokens, and controlling pricing features. ```APIDOC ## POST /integration ### Description Updates and maintains the PMS integration. Primarily used to update sync_url, calendar_trigger_url, and hook_url, refresh API token, and control pricing features exposed to users (e.g., minimum stay, restrictions, discounts, extra person fees). ### Method POST ### Endpoint /integration ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **sync_url** (string) - Required - The URL to sync calendar data. - **calendar_trigger_url** (string) - Required - The URL to trigger calendar updates. - **hook_url** (string) - Optional - A webhook URL for real-time notifications. - **api_token** (string) - Required - The API token for authentication. - **pricing_features** (object) - Optional - Controls which pricing features are enabled. - **minimum_stay** (boolean) - Enable/disable minimum stay feature. - **weekly_discount** (boolean) - Enable/disable weekly discounts. - **monthly_discount** (boolean) - Enable/disable monthly discounts. - **extra_person_fee** (boolean) - Enable/disable extra person fees. ### Request Example ```json { "sync_url": "https://your-pms.com/sync", "calendar_trigger_url": "https://your-pms.com/calendar_trigger", "api_token": "your_api_token", "pricing_features": { "minimum_stay": true, "weekly_discount": true, "monthly_discount": true, "extra_person_fee": true } } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message of successful integration update. #### Response Example ```json { "message": "Integration updated successfully." } ``` ``` -------------------------------- ### Customer API Overview and Usage - PriceLabs Source: https://help.pricelabs.co/portal/en/kb/pricelabs/dynamic-pricing/integration/general The Customer API allows PriceLabs customers to receive pricing data and edit settings for listings actively syncing with other channels or PMS. It enables external systems to integrate with PriceLabs functionalities. A prerequisite is ensuring the listing is active in PriceLabs, potentially connected via a PMS or channel like Airbnb/VRBO. ```text Why use Customer API? Our API allows customers to receive prices from PriceLabs & edit settings in PriceLabs for the listings that are actively syncing to other channels/PMS. Some ... Building an API integration with PriceLabs Who can integrate External systems like a PMS, an OTA or a channel manager can integrate with PriceLabs using our Dynamic Pricing API functionalities Steps to integrate Detailed li ... How to use PriceLabs Customer API to send the prices to Wordpress/ Wix website? Prerequisite: Please ensure that the listing is active in PriceLabs. It might be connected through any PMS/channel (Airbnb/VRBO). Step 1: Next enable your API key from PriceLabs. W ... ``` -------------------------------- ### Add Revenue Estimator Widget Script - JavaScript Source: https://help.pricelabs.co/portal/en/kb/articles/add-revenue-estimator-widget-to-your-website This JavaScript code snippet is essential for loading and initializing the PriceLabs Revenue Estimator widget on your webpage. It should be placed after the opening tag, and its default dimensions can be customized using a style attribute. ```javascript ``` -------------------------------- ### Insert Revenue Estimator Widget Container - HTML Source: https://help.pricelabs.co/portal/en/kb/articles/add-revenue-estimator-widget-to-your-website This HTML code snippet creates a placeholder div element where the PriceLabs Revenue Estimator widget will be dynamically inserted. Ensure this div is placed on your webpage where you want the widget to appear. ```html
``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.