Length of Stay (LoS) Pricing

Travel Partner Prices API

The Travel Partner Prices API provides you with a RESTful interface for sending property prices to Google.

Service: travelpartnerprices.googleapis.com

To call this service, we recommend that you use the Google-provided client libraries. If your application needs to use your own libraries to call this service, contact your Technical Account Manager (TAM) to get the Discovery Document for this service.

Service endpoint

A service endpoint is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs listed are relative to this service endpoint:

https://travelpartnerprices.googleapis.com
Methods
ingestLosPropertyPrices POST /v1/accounts/account_id/properties/property_id:ingestLosPropertyPrices

Upload the provided Length of Stay Prices for a specified property.

Requires a JSON encoded LoS prices message (see below) as the HTTP message body.

account_id: This string value is the "Account ID" value listed on the Account settings page in Hotel Center.

property_id: The value of this element must be a string that matches the listing ID in your Hotel List Feed.

API Authentication

The Travel Partner Prices API uses OAuth 2.0 to authenticate your application so that you can access the APIs.

Follow the OAUTH 2.0 setup instructions to get authorization for your Travel Partner Prices API.

When you create a new project for the Travel Partners Prices API, you need to enable access to your new Google Cloud console project which is similar to the instructions provided in the Travel Partner API.

Refer to steps provided in Travel Partner API and substitute all instances of "Travel Partner API" with "Travel Partner Prices API" to enable your project.

The scope of the Travel Partner Prices API is: "https://travelpartnerprices.googleapis.com"

The upload path for Travel Partner Prices API is: "/travel/lodging/uploads/accounts/<account_id>/property_data"

Requests

Syntax

The LoS Prices message uses the following syntax:

{
  "requestTime": YYYY-MM-DDTHH:mm:ss.SSSZ,
  "propertyPrices": {
    "arrivalDatePrices": [{
      "startDate": {
        "year": int
        "month": int
        "day": int
      }
      "endDate": {
        "year": int
        "month": int
        "day": int
      }
      "productPrices": [{
        "roomTypeId": "string"
        "ratePlanId": "string"
        "occupancyPrices": [{
          "adults": int
          "prices": [{
            "rateRuleId": "string"
            "currencyCode": "string"
            "rates": [night_1,night_2,...]
            "taxes": [night_1,night_2,...]
            "fees": [night_1,night_2,...]
          }]
        }]
      }]
    }]
  }
}

Elements & Attributes

The Length of Stay prices message has the following elements and attributes:

Element Occurrences Type Description
requestTime 1 string

The moment in time that the LoS Price message was sent, expressed as an RFC 3339-formatted string.

Any message sent with a requestTime within the prior 24 hours is processed, and those that haven't are discarded.

Messages are processed in order of requestTime, regardless of the order in which they are received. For example, a price update with a requestTime of 2019-05-03T14:09:00Z that is received after a message for the same itineraries with a requestTime of 2019-05-03T14:10:00Z are discarded in favor of the later timestamped message.

RFC 3339 requires fully specified datetimes as YYYY-MM-DDThh:mm:ss.SSZ. Timezone is required, specified as a positive or negative hh:mm offset from UTC, or Z as shorthand for UTC.

Fractional seconds are optional, and may be expressed up to nanosecond precision. As an example, 2017-01-15T01:30:15.01-08:00 encodes 15.01 seconds past 01:30 PST on January 15, 2017.

propertyPrices 1 Object Prices for a property. All prices within this propertyPrices apply to the same property.

This element is not repeated. To send prices for multiple properties, you need to make multiple HTTP requests (at least one per property).

arrivalDayPrices[] 1..n Object Prices for an arrival date. All prices within this arrivalDayPrices apply to a specific property, but different arrival dates.
startDate 1 Object The productPrices is applied to all arrival dates between the startDate and the endDate, inclusive.

If only trying to specify one arrival date (and not a range), input the arrival date into both startDate and endDate.

startDate.year 1 integer Year of the startDate. Must be from 1 to 9999.
startDate.month 1 integer Month of a year. Must be from 1 to 12.
startDate.day 1 integer Day of a month. Must be from 1 to 31 and valid for the year and month.
endDate 0..1 Object The productPrices is applied to all arrival dates between the startDate and the endDate, inclusive.

If only trying to specify one arrival date (and not a range), endDate may be omitted.

endDate.year 1 integer Year of the endDate. Must be from 1 to 9999.
endDate.month 1 integer Month of a year. Must be from 1 to 12.
endDate.day 1 integer Day of a month. Must be from 1 to 31 and valid for the year and month.
productPrices[] 1..n Object Prices for a product. All prices within this productPrices apply to a specific property, arrival date combination, but different products.
roomTypeId 0..1 string The unique ID for the room that this price is referring to. Use this ID to match the Room Bundle data with what you sent in roomdata. For more information, refer to Room Bundle metadata.
ratePlanId 0..1 string The unique ID for the package data that this price is referring to. Use this ID to match the Room Bundle data with what you sent in packagedata. For more information, refer to Room Bundle metadata.
occupancyPrices[] 1..n Object Prices for an occupancy. All prices within this occupancyPrices apply to a specific property, arrival date, product combination, but to different occupancies.
adults 1 integer The maximum number of guests that can be booked per room, including adults and children. This value is set for all rates within the corresponding occupancyPrices field and must be a positive integer between 1 and 99.

Note: Contact your support team to send occupancy for greater than four adults.

prices[] 1..n Object Length of stay prices. All prices within prices apply to a specific property, arrival date, product, and occupancy combination.
rateRuleId 0..1 string For conditional rates, this ID matches a rate to a definition in your Rate Rule Definition file. The character limit for this field is 40 characters.
currencyCode 1 string The three-letter currency code which rates and taxes are provided in. For example, "USD" for US dollars.
rates[] 30 float The base rate component of the length of stay prices.

If a corresponding taxes value is provided, this rate is non-inclusive of the tax. The total price is the sum of the relevant rate and tax.

The value at index n corresponds to an n+1 length of stay.

You must send the full LoS set of 30 prices at a time. If you send fewer than 30, then all of the provided LoS prices are processed as normal, and the remaining rates are unavailable up to LoS 30. If you send more than 30,then any prices you send beyond the 30th rate are dropped .

Unavailable lengths of stays should be represented with a 0.

taxes[] 30 float The tax component of length of stay prices.

The value at index n corresponds to an n+1 length of stay.

fees[] 30 float The fee component of length of stay prices.

The value at index n corresponds to an n+1 length of stay.

Example

Rates & taxes based on LOS

The following example shows setting the minimum length of stay of 2 for one check-in date and setting no availability for another check-in date. If you set the startDate from 9/1/2023 with no endDate, it means that you are specifying the rates for only one date and you can omit the endDate.

The occupancyPrices array that is set to 2 lets you set different rates for different occupancies. Therefore, no vacancy on 09/04/23 limits available rates.

The taxes array shown is calculated as 10% of rate.

The fees array shown applies a $50 cleaning fee per stay.

If the entire check-in date is unavailable ‐9/3/2023, you must explicitly send the date, and omit rates, taxes and productPrices to signify that there is no availability for the requested date.

{
  "requestTime": "2023-08-10T12:15:222",
  "propertyPrices": {
    "arrivalDatePrices": [
      {
        "startDate": {
          "year": 2023,
          "month": 9,
          "day": 1
        },
        "productPrices": [
          {
            "occupancyPrices": [
              {
                "adults": 2,
                "prices": [
                  {
                    "currencyCode": "USD",
                    "rates": [
                      0, 200, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ],
                    "taxes": [
                      0, 20, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ],
                    "fees": [
                      0, 50, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ]
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "startDate": {
          "year": 2023,
          "month": 9,
          "day": 3
        },
        "productPrices": [
          {
            "occupancyPrices": [
              {
                "adults": 2,
                "prices": [
                  {
                    "currencyCode": "USD",
                    "rates": [
                      0, 200, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ],
                    "taxes": [
                      0, 20, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ],
                    "fees": [
                      0, 50, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}

Response Body

If successful, the response body contains data with the following structure:

JSON representation
        {
          "name": "string"
        }
        
Fields
name The resource name of the PropertyPrices that was modified. Has the form:
accounts/{account}/properties/{property}.