Availability requests are sent by adding /availability to your endpoint and sending the parameters explained below in a POST request.
Hotel Availability
In the below example three hotels are requested and the response_type for each is different. The first one has availability ("available"), the second has no availability ("unavailable") and the third has an error ("error").
Request
{ "api_version": 8, "start_date": "2017-05-01", "end_date": "2017-05-03", "party": [ { "adults": 3 }, { "adults": 2, "children": [ 9, 5 ] } ], "language": "en_US", "query_key": "6167a22d1f87d2028bf60a8e5e27afa7_191_1360299600000_2_2", "currency": "USD", "user_country": "US", "device_type": "Desktop", "availability_id": "a2fd740a-ad02-476d-b314-925a125509be", "requested_payload": { "categories": { "room_type_details": false, "rate_plan_details": false, "room_rate_details": false, "hotel_details": false }, "category_modifiers": { "partner_booking_data": false, "real_time_pricing": false, "multiple_room_rates": false, "photos": false, "text": false } }, "hotels": [ { "ta_hotel_id": 258705, "partner_hotel_code": "A123" }, { "ta_hotel_id": 730099, "partner_hotel_code": "B456" }, { "ta_hotel_id": 555555, "partner_hotel_code": "555" }, ] } |
Parameters
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
api_version | integer | The version of the API of this request. | ||||||||||||||||||||
start_date | string | The check-in date of the traveler using the hotel's time zone. The date is required to be in ISO8601 full-date format (YYYY-MM-DD). | ||||||||||||||||||||
end_date | string | The check-out date of the traveler using the hotel's time zone. The date is required to be in ISO8601 full-date format (YYYY-MM-DD). | ||||||||||||||||||||
party | array | Array of JSON objects representing number of adults and children traveling.
|
||||||||||||||||||||
language | string | Language code (see Supported Languages). Language codes are a combination of the ISO 639-1 language codes and the ISO 3166-1 country codes. When used in an AvailabilityRequest, this is the language that Tripadvisor would prefer that the partner return with. When used in an AvailabilityResponse, this is the language that the partner is responding with.
If the partner does not have the language of the request, they can return a less specific language. e.g. If the request is asking for de_AT, then the response can be de. |
||||||||||||||||||||
query_key | string | String useful for debugging. It is recommended for this value to be logged. | ||||||||||||||||||||
currency | string | ISO 4217 currency code. | ||||||||||||||||||||
user_country | string | ISO 3166-1 alpha-2 country code. | ||||||||||||||||||||
device_type | string | Identifies the user’s device type. Takes values “Desktop”, “Mobile” or “Tablet”. This value is required if pricing differs by device type. | ||||||||||||||||||||
query_key | string | String useful for debugging. It is recommended for this value to be logged. | ||||||||||||||||||||
availability_id | string | Identifier primarily used for internal purposes. Partners implementing the API may ignore this parameter. | ||||||||||||||||||||
requested_payload | array |
Each of these flags correspond to particular sets of information in the response. Currently Tripadvisor will always set the requested flag as False in Hotel Availability search. You are free to return whichever content you would like however at this time only Free Cancellation, Pay at Stay and Breakfast Included information is used in Hotel Availability. Additional content beyond that is displayed only for Instant Booking. At this time Tripadvisor requests that partners only return a False flag, irrespective of the content you return, as a result you can ignore the below information.
Example: in a single hotel request with all flags set to false - i.e TA is requesting at least one room-rate to be returned (assuming there is availability for that hotel). Potential response options:
Example: the request has flags for "room_type_details" and "photos" set to "true. Acceptable responses where Partner sets "room_type_details" and "photos" flag to "true"
Responses should include as much extra information as they can without incurring significant costs in time the call takes or rate of calls supported. If any of these fields are missing they will be interpreted as false. New flags may be added in the future in which case they should either not be returned or returned as false. |
||||||||||||||||||||
categories | array |
These flags specify areas of the response that closely matches the object structure of the API.
|
||||||||||||||||||||
category_modifiers | object |
These flags specify pieces of content which Tripadvisor understands may cause a performance impact.
|
||||||||||||||||||||
hotel | object |
JSON serializable hash representing requested hotel.
Note: All your availability lookups must use your partner_hotel_code. The Tripadvisor ID can change as the site changes. |
Response
The below represents the minimum amount of information you can provide in order to be displayed in Tripadvisor's Hotel Availability search.
Currently Tripadvisor will always set the requested flag as False in Hotel Availability search. You are free to return whichever content you would like however at this time only Free Cancellation, Pay at Stay and Breakfast Included information is used in Hotel Availability. Additional content beyond that is displayed only for Instant Booking.
{ "api_version": 8, "language": "en_US", "availability_request": { "api_version": 8, "start_date": "2017-05-01", "end_date": "2017-05-03", "party": [ { "adults": 3 }, { "adults": 2, "children": [ 9, 5 ] } ], "language": "en_US", "query_key": "6167a22d1f87d2028bf60a8e5e27afa7_191_1360299600000_2_2", "currency": "USD", "user_country": "US", "device_type": "Desktop", "availability_id": "a2fd740a-ad02-476d-b314-925a125509be", "requested_payload": { "categories": { "room_type_details": false, "rate_plan_details": false, "room_rate_details": false, "hotel_details": false }, "category_modifiers": { "partner_booking_data": false, "real_time_pricing": false, "multiple_room_rates": false, "photos": false, "text": false } }, "hotels": [ { "ta_hotel_id": 258705, "partner_hotel_code": "A123" }, { "ta_hotel_id": 730099, "partner_hotel_code": "B456" }, { "ta_hotel_id": 555555, "partner_hotel_code": "555" }, ] }, "response_payload": { "categories": { "room_type_details": false, "rate_plan_details": false, "room_rate_details": false, "hotel_details": false }, "category_modifiers": { "partner_booking_data": false, "real_time_pricing": false, "multiple_room_rates": false, "photos": false, "text": false } }, "hotels": { "A123": { "response_type": "available", "available": { "room_types": { "1": { "persistent_room_type_code": "king1" "name": "Deluxe King Room", }, "2": { "persistent_room_type_code": "king2" "name": "Deluxe King Room - Non Smoking", } }, "rate_plans": { "1": { "persistent_rate_plan_code": "BR21" "name": "Best Available Rate", }, "2": { "persistent_rate_plan_code": "OL44" "name": "Online Discount", } }, "room_rates": { "1": { "persistent_room_rate_code": "21dr-wi4g-aaa9-kg2np", "room_type_key": "1", "rate_plan_key": "1", "rate_qualification": "public", "url": "http: //www.partner-site.com/hotel_commonwealth/fenway_room?start_date=2017-05-01&end_date=2017-05-03&num_adults=3&num_child=2", "line_items": [ { "price": { "requested_currency_price": { "amount": 220, "currency": "USD" } }, "type": "rate", "paid_at_checkout": false, }, { "price": { "requested_currency_price": { "amount": 20, "currency": "USD" } }, "type": "tax", "sub_type": "tax_city", "paid_at_checkout": false, } ] }, "2": { "persistent_room_rate_code": "581d-la3n-pg9a-vnr3", "room_type_key": "1", "rate_plan_key": "2", "rate_qualification": "mobile", "url": "http: //www.partner-site.com/hotel_commonwealth/fenway_room2?start_date=2017-05-01&end_date=2017-05-03&num_adults=3&num_child=2", "line_items": [ { "price": { "requested_currency_price": { "amount": 200, "currency": "USD" } }, "type": "rate", "paid_at_checkout": false, }, { "price": { "requested_currency_price": { "amount": 20, "currency": "USD" } }, "type": "tax", "sub_type": "tax_vat", "paid_at_checkout": false, } ] }, "3": { "persistent_room_rate_code": "nv3i-lgex-kxx2-ajge", "room_type_key": "2", "rate_plan_key": "1", "rate_qualification": "member", "url": "http: //www.partner-site.com/hotel_commonwealth/fenway_room3?start_date=2017-05-01&end_date=2017-05-03&num_adults=3&num_child=2", "line_items": [ { "price": { "requested_currency_price": { "amount": 180, "currency": "USD" } }, "type": "rate", "paid_at_checkout": false, }, { "price": { "requested_currency_price": { "amount": 20, "currency": "USD" } }, "type": "fee", "sub_type": "fee_resort", "paid_at_checkout": false, } ] } } } }, "B456": { "response_type": "unavailable" }, "555": { "response_type": "error", "error": { error_code: 3 message: "Unknown hotel id was requested." } } } } |
The below represents the maximum amount of information you can provide in Tripadvisor's Hotel Availability search.
Currently Tripadvisor will always set the requested flag as False in Hotel Availability search. You are free to return whichever content you would like however at this time only Free Cancellation, Pay at Stay and Breakfast Included information is used in Hotel Availability. Additional content beyond that is displayed only for Instant Booking.
Response
{ "api_version": 8, "language": "en_US", "availability_request": { "api_version": 8, "start_date": "2017-05-01", "end_date": "2017-05-03", "party": [ { "adults": 3 }, { "adults": 2, "children": [ 9, 5 ] } ], "language": "en_US", "query_key": "6167a22d1f87d2028bf60a8e5e27afa7_191_1360299600000_2_2", "currency": "USD", "user_country": "US", "device_type": "Desktop", "availability_id": "a2fd740a-ad02-476d-b314-925a125509be", "requested_payload": { "categories": { "room_type_details": false, "rate_plan_details": false, "room_rate_details": false, "hotel_details": false }, "category_modifiers": { "partner_booking_data": false, "real_time_pricing": false, "multiple_room_rates": false, "photos": false, "text": false } }, "hotels": [ { "ta_hotel_id": 258705, "partner_hotel_code": "A123" } ] }, "response_payload": { "categories": { "room_type_details": false, "rate_plan_details": false, "room_rate_details": false, "hotel_details": false }, "category_modifiers": { "partner_booking_data": false, "real_time_pricing": false, "multiple_room_rates": false, "photos": false, "text": false } }, "hotels": { "A123": { "response_type": "available", "available": { "room_types": { "1": { "persistent_room_type_code": "king1", "name": "Deluxe King Room", "photos": [ { "url": "https://www.example.com/FenwayRoomBed.jpg", "width": 480, "height": 270, "caption": "Image of King Bed" } ], "room_amenities": { "standard": [ 20, 900118 ], "custom": [ "My custom chair", "Wolf appliances" ] }, "room_size": { "value": 500, "unit": "square_feet" }, "bed_configurations": [ { "standard": [ { "code": 3, "count": 1 } ], "custom": [ { "name": "Loft", "count": 1 } ] } ], "extra_bed_configurations": [ { "standard": [ { "count": 1, "code": 900302 } ] }, { "custom": [ { "count": 2, "name": "Rollaway with wheel locks and adjustable height" } ] } ], "room_view_types": { "standard": [ 10 ], "custom": [ "Northern Lights" ] }, "accessibility_features": { "standard": [ 900501, 900505 ] }, "max_occupancy": { "number_of_adults": 2, "number_of_children": 0 }, "room_smoking_policy": "smoking" }, "2": { "persistent_room_type_code": "king2", "name": "Deluxe King Room - Non Smoking", "photos": [ { "url": "https://www.example.com/FenwayRoomBed.jpg", "width": 480, "height": 270, "caption": "Image of King Bed" } ], "room_amenities": { "standard": [ 20, 101, 900118 ], "custom": [ "My custom chair", "Wolf appliances" ] }, "room_size": { "value": 400, "unit": "square_feet" }, "bed_configurations": [ { "standard": [ { "code": 3, "count": 1 } ] }, { "standard": [ { "code": 5, "count": 2 } ] } ], "extra_bed_configurations": [ { "standard": [ { "count": 1, "code": 4 } ] }, { "custom": [ { "count": 1, "name": "Rollaway with wheel locks and adjustable height" } ] } ], "room_view_types": { "standard": [ 10 ], "custom": [ "Northern Lights" ] }, "accessibility_features": { "standard": [ 900504 ] }, "max_occupancy": { "number_of_adults": 2, "number_of_children": 0 }, "room_smoking_policy": "non_smoking" } }, "rate_plans": { "1": { "persistent_rate_plan_code": "BR21", "name": "Best Available Rate", "photos": [ { "url": "https://www.example.com/jetski01.jpg", "width": 480, "height": 270, "caption": "Image of complimentary jet skis that are provided." }, { "url": "https://www.example.com/kayak01.jpg", "width": 480, "height": 270, "caption": "Image of kayak that are available to rent." } ], "rate_amenities": { "standard": [ 75 ], "custom": [ "Complimentary jet skis", "Kayak rentals" ] }, "cancellation_policy": { "cancellation_summary": { "refundable": "full", "cancellation_deadline": "2017-06-15T00:00:00Z", "unstructured_cancellation_text": "Free cancellation until 2017-06-15 GMT. From 2017-06-15 GMT to 2017-06-20 GMT, there is a cancellation fee of 50.00 USD. From 2017-06-20 GMT until date and time of check-in, there is a fee of 25.00% of stay and a fee of one night's stay." "cancellation_rules": [ { "start_datetime": "2017-06-15T00:00:00Z", "end_datetime": "2017-06-20T00:00:00Z", "fixed_fee": { "fee": { "amount": 50, "currency": "USD" }, "taxes_included": true } }, { "start_datetime": "2017-06-20T00:00:00Z", "percent_fee": { "amount": 0.25 }, "night_fee": { "num_nights": 1 } } ] }, "meal_plan": { "standard": [ 22 ], "custom": [ "Brunch on weekend mornings" ] } }, "2": { "persistent_rate_plan_code": "OL44", "name": "Online Discount", "photos": [ { "url": "https://www.example.com/nfl_cable.jpg", "width": 480, "height": 270, "caption": "Image of cable TV selection." } ], "rate_amenities": { "standard": [ 207 ], "custom": [ "NFL Network" ] }, "cancellation_policy": { "cancellation_summary": { "refundable": "none", "unstructured_cancellation_text": "Non-refundable rate. No cancellations permitted, all taxes and fees will need to be paid." }, "cancellation_rules": [ { "percent_fee": { "amount": 1 } } ] }, "meal_plan": { "standard": [ 22 ], "custom": [ "Brunch on weekend mornings" ] } } }, "room_rates": { "1": { "persistent_room_rate_code": "21dr-wi4g-aaa9-kg2np", "room_type_key": "1", "rate_plan_key": "1", "rate_qualification": "public", "rooms_remaining": 2, "url": "http: //www.partner-site.com/hotel_commonwealth/fenway_room?start_date=2017-05-01&end_date=2017-05-03&num_adults=3&num_child=2", "line_items": [ { "price": { "requested_currency_price": { "amount": 220, "currency": "USD" } }, "type": "rate", "paid_at_checkout": false, }, { "price": { "requested_currency_price": { "amount": 20, "currency": "USD" } }, "type": "fee", "sub_type": "fee_transfer", "paid_at_checkout": false, } ] }, "2": { "persistent_room_rate_code": "581d-la3n-pg9a-vnr3", "room_type_key": "1", "rate_plan_key": "2", "rate_qualification": "mobile", "rooms_remaining": 1, "url": "http: //www.partner-site.com/hotel_commonwealth/fenway_room2?start_date=2017-05-01&end_date=2017-05-03&num_adults=3&num_child=2", "line_items": [ { "price": { "requested_currency_price": { "amount": 200, "currency": "USD" } }, "type": "rate", "paid_at_checkout": false, }, { "price": { "requested_currency_price": { "amount": 20, "currency": "USD" } }, "type": "tax", "sub_type": "tax_city", "paid_at_checkout": false, } ] }, "3": { "persistent_room_rate_code": "nv3i-lgex-kxx2-ajge", "room_type_key": "2", "rate_plan_key": "1", "rate_qualification": "member", "rooms_remaining": 5, "url": "http: //www.partner-site.com/hotel_commonwealth/fenway_room3?start_date=2017-05-01&end_date=2017-05-03&num_adults=3&num_child=2", "line_items": [ { "price": { "requested_currency_price": { "amount": 180, "currency": "USD" } }, "type": "rate", "paid_at_checkout": false, }, { "price": { "requested_currency_price": { "amount": 20, "currency": "USD" } }, "type": "tax", "sub_type": "tax_environmental", "paid_at_checkout": false, } ] } } } } } |
Properties
Field | Type | Description |
---|---|---|
api_version | integer |
The version of the API of this response.
|
language | string | Language code (see Supported Languages). Language codes are a combination of the ISO 639-1 language codes and the ISO 3166-1 country codes. When used in an AvailabilityRequest, this is the language that Tripadvisor would prefer that the partner return with. When used in an AvailabilityResponse, this is the language that the partner is responding with.
If the partner does not have the language of the request, they can return a less specific language. e.g. If the request is asking for de_AT, then the response can be de. |
availability_request | array | The request parameters. |
response_payload | array | The response parameters. |
hotels | hotels map |
Map of partner_hotel_code to SingleHotelResponse entries. See below. |
Hotels
Map of partner_hotel_code to SingleHotelResponse entries. Each key must match a corresponding partner_hotel_code in the request's hotel array. Note that each hotel may have a different response_type. This Map must be the same size as the list of the hotels in the request to be considered a valid response.
Field |
Type | Description |
---|---|---|
response_type | string |
The type of response returned for a hotel. Must be one of "available", "unavailable" or "error"
|
available | SingleHotel map |
Representation of an individual hotel. Only if response_type is "available".
|
error | Error object |
Only if response_type is "error". See Error.
|
RoomTypes
Field |
Type | Description |
---|---|---|
room_types | RoomType map |
Affected when all flags below are true:
A map from room type keys to room types. At minimum, there must exist a room type entry for every unique room_type_key used in room_rates RoomRate objects. |
Field | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
persistent_room_type_code |
string |
This code identifies unique room types. We expect that this code persists across future availability calls. The combination of persistent_room_type_code and partner_hotel_code must be unique.
|
||||||||||||||||||||||||||||||||||||||||||||||||||
name | string |
The name of this room type. Room names must summarize 1-2 significant selling points for the room, ideally in less than 50 characters. For example, you can include the bed type configuration information and the room view in the name (e.g. “One Bedroom Suite, One King Bed”, “Courtyard King”, “Garden View Room, King”, “King Studio”); or simply match the room name to brand.com
If a room name consists of only numbers and symbols, or is shorter than 4 characters, it will be blocked from Instant Booking.
|
||||||||||||||||||||||||||||||||||||||||||||||||||
description | string |
Provide when all flags below are true:
Longer room description. This will be displayed to end users, and should be in the language indicated by the lang parameter. Ideal room descriptions are 250-400 characters in length. They are written in third person voice and highlight selling point for the room. For example, "This one-bedroom suite has a king bed. This corner suite also features a separate living room with a sofa bed, a well-equipped kitchen with complimentary grocery delivery services, and Paul Mitchell bath products."
Language specific requirements will be applied. For example, if a room description in English consists of only numbers and symbols, or is shorter than 4 characters, it may be blocked. See supported HTML tags. |
||||||||||||||||||||||||||||||||||||||||||||||||||
photos | Photo array |
Provide when all flags below are true:
List of photos of the room. |
||||||||||||||||||||||||||||||||||||||||||||||||||
room_amenities | object |
Provide when all flags below are true:
Array of number codes. Each code corresponds to an amenity for the OpenTravel Hotel Amenity Code List. A map of the standard room amenities is listed under the Supported Amenities section. Hotel and room amenities are provided in separate parts of the response, and should not overlap. For example, amenities that have no bearing on the room (e.g. “free parking”) should not be included as a room amenity, but rather as a hotel amenity. We recommend rooms offer a minimum of 10 amenities. The standard amenities will be returned as an integer array. If an amenity does not exist in the Supported Amenities list, then the Connectivity Partner may provide their own values. Return "custom":[ ] if no custom list exists. Example: |
||||||||||||||||||||||||||||||||||||||||||||||||||
max_occupancy | map of string:int |
Provide when all flags below are true:
Maximum number of guests permitted in the room. {"number_of_adults": <num_adult>, "number_of_children": <num_child>}. Example: {"number_of_adults": 3, "number_of_children": 2 }. |
||||||||||||||||||||||||||||||||||||||||||||||||||
room_size | map of string:int |
Provide when all flags below are true:
Area of room in given units. If given, both value and unit are required. Example: {"value":500, "unit": "square_feet" } |
||||||||||||||||||||||||||||||||||||||||||||||||||
bed_configurations | object |
Provide when all flags below are true:
A list of one or more possible configurations.
The following snippet illustrates how to represent one bed configuration, with a crib AND a custom bunk bed:
Specify the bed types for a room, and if needed multiple bed configurations available. The type of bed provided is based on OpenTravel BED code table:
|
||||||||||||||||||||||||||||||||||||||||||||||||||
extra_bed_configurations | object |
Provide when all flags below are true:
A list of one or more possible extra bed configurations. For examples, see bed_configurations. |
||||||||||||||||||||||||||||||||||||||||||||||||||
room_view_types | object |
Provide when all flags below are true:
Choose from available OpenTravel codes for Room View Type when available:
The standard room_view_types will be returned as an integer array. If a room_view_types does not exist in the table above, then the Connectivity Partner may provide their own values in the "custom" field as a string array. Return "custom":[ ] if no custom list exists. Example: { "standard": [1,2,25], "custom": ["my own view of the dunes"] } Example: {"standard": [2, 25], "custom": [ ]} |
||||||||||||||||||||||||||||||||||||||||||||||||||
accessibility_features | object |
Provide when all flags below are true:
Choose from available codes for accessibility features below:
The standard accessibility features will be returned as an integer array. If an accessibility feature does not exist in the table above, then the Connectivity Partner may provide their own values in the "custom" field as a string array. Return "custom":[ ] if no custom list exists. We encourage you to avoid custom accesibility features, as this may hinder international rollout, and not allow display of standard accessibility icons for travelers. Example: {"standard": [900504, 900505], "custom": [ ]} |
||||||||||||||||||||||||||||||||||||||||||||||||||
room_smoking_policy | string |
Provide when all flags below are true:
Options:
We also capture hotel_smoking_policy in HotelDetails. The options specified here should not invalidate information at the Hotel level. In the case of a mismatch, Tripadvisor will not display this information. |
RatePlans
Field |
Type | Description |
---|---|---|
rate_plans | RatePlan map |
Affected when all flags below are true:
A map from rate plan keys to rate plans. At minimum, there must exist a rate plan entry for every unique rate_plan_key used in room_rates RoomRate objects. |
Field | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
persistent_rate_plan_code | string | This code identifies unique rate plans. We expect that this code persists across future availability calls. The combination of persistent_rate_plan_code and partner_hotel_code must be unique. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name | string |
The name of this rate plan. For example, "Best Available Rate".
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description | string | Provide when all flags below are true:
Longer rate description. This will be displayed to end users, and should be in the language indicated by the language parameter. Language specific requirements will be applied. For example, if a room description in English consists of only numbers and symbols, or is shorter than 4 characters, it may be blocked. See supported HTML tags.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
photos | Photo array |
Provide when all flags below are true:
List of photos representing the rate plan. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rate_amenities | object | Provide when all flags below are true:
Array of number codes where each code corresponds to a rate amenity. Each code corresponds to an amenity for the OpenTravel Hotel Amenity Code List. A map of the standard room amenities is listed under the Supported Amenities section. Use this list to specify amenities that are specific to the rate plan, such as "Executive Club Lounge Access", "English Breakfast Included," etc. The standard amenities will be returned as an integer array. If an amenity does not exist in the Supported Amenities list, then the Connectivity Partner may provide their own values. Example: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cancellation_policy | object |
Provide when all flags below are true:
The cancellation policy:
is represented in the API as:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
meal_plan | object |
Provide when all flags below are true:
Choose from available OpenTravel codes for meal plans (MPT):
The standard meal_plan will be returned as an integer array. If a meal_plan does not exist in the table above, then the Connectivity Partner may provide their own values in the "custom" field as a string array. Return "custom":[ ] if no custom list exists. Example: { "standard": [1,2], "custom": ["All you can eat", "Special breakfast"] } Example: {"standard": [2, 4], "custom": [ ]} |
RoomRates
Field |
Type | Description |
---|---|---|
room_rates | RoomRates map |
Affected when all flags below are true:
A map from room rate keys to room rates. |
Field | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
persistent_room_rate_code | string |
This code identifies unique room rates. We expect that this code persists across future availability calls. The combination of persistent_room_rate_code and partner_hotel_code must be unique.
|
||||||||
room_type_key | string |
Key referencing the applicable RoomType. This key must exist in the response's room_types map in order for this to be considered a valid response.
|
||||||||
rate_plan_key | Price object |
Key referencing the applicable RatePlan. This key must exist in the response's rate_plan map in order for this to be considered a valid response.
|
||||||||
rate_qualification | string |
Default: "public"
Valid values:
The type of qualification required for the room rate. A room rate should only be tagged with a mobile rate qualification if the price is exclusive to mobile devices. When member rates are available, partners should return at least one public rate and one member rate in the API response, the public and member rate should have the same "room_type_key". You cannot return member rates without public rates. You should also return persistent room and rate plan codes. This feature will only display for qualified partners and has specific UI rules, please check with your Tripadvisor account manager for more information.
|
||||||||
line_items | LineItem array |
Affected when all flags below are true:
An object containing the detailed breakdown of charges. See below.
|
||||||||
payment_policy | string |
Provide when all flags below are true:
How will the partner use the credit or debit card information, e.g. charged immediately or hold. Large text field.
|
||||||||
rooms_remaining | integer |
Provide when all flags below are true:
The number of rooms remaining / available at a given hotel for a given roomtype at a given price. This number should be >0. |
||||||||
other_policy | string |
Provide when all flags below are true:
|
||||||||
url | string |
The URL of the hotel on the partner site. This URL should go to a page that will show the price quoted and allow a user to book the room. Make this URL as specific as possible. This URL must be accessible with a GET request. If possible, the URL should go to a webpage in the language specified by the language parameter in the availability request.
|
||||||||
partner_data | number, string or object |
This data will not be interpreted by Tripadvisor, but will be sent back to the partner as-is when we attempt a booking. For example, this field might be used to store a partner 'rate key,’ ‘room key,’ and/or ‘product key.’ It can consist of arbitrary nested JSON, or a single string or number. |
LineItems
An array of LineItem objects will contain a separate LineItem for rate, tax, and fee types with each corresponding sub_type.
Field | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
price | Price object |
When partner_booking_data is set to false (hotel or expanded availability), at least one of requested_currency_price or currency_of_charge_price should be populated. When partner_booking_data is set to true (booking availability) and in /booking_submit, currency_of_charge_price should also be populated. requested_currency_price should also be returned if this was included in previous calls.
|
||||||||||||||||||||||||
type | string |
Describes the charge. Must be one of these values:
|
||||||||||||||||||||||||
sub_type | string |
Describes the sub type of charge. Must be one of these values:
|
||||||||||||||||||||||||
paid_at_checkout | boolean | True if the charge will be paid at the time of stay, false if it will be paid at time of booking. |
Error
If the error object is present, please include as many complete attributes in the response as available.
Field | Type | Description | |||||||||||||||||||
error | Error object |
|
Example Response:
{ "api_version": 8, "language": "en_US", "availability_request": { "api_version": 8, "start_date": "2017-11-07", "end_date": "2017-11-08", "party": [ { "adults": 2, "children": [] } ], "language": "en_US", "currency": "USD", "user_country": "US", "device_type": "Desktop", "query_key": "6167a22d1f87d2028bf60a8e5e27afa7_191_1360299600000_2_2", "availability_id": "a2fd740a-ad02-476d-b314-925a125509be", "requested_payload": { "categories": { "room_type_details": false, "rate_plan_details": false, "room_rate_details": false, "hotel_details": false }, "category_modifiers": { "partner_booking_data": false, "real_time_pricing": false, "multiple_room_rates": false, "photos": false, "text": false } }, "hotels": [ { "ta_hotel_id": 1, "partner_hotel_code": "HotelTest" } ] }, "response_payload": { "categories": { "room_type_details": false, "rate_plan_details": false, "room_rate_details": false, "hotel_details": false }, "category_modifiers": { "partner_booking_data": false, "real_time_pricing": false, "multiple_room_rates": false, "photos": false, "text": false } }, "hotels": { "HotelTest": { "response_type": "error", "error": { "error_code": "3", "message": "Invalid hotel ID", } } } }
Multiple Rooms
The availability response is exactly the same whether a single room (single object in the ' party' array) or multiple rooms (multiple objects in the ' party' array) are in the availability request.
There are, however, some considerations as follows.
Using this as an example party array in the request: [{"adults": 3},{"adults": 2}], you can follow these guidelines when constructing the response:
- When we request multiple rooms you should send all rooms that can accommodate the largest party.
- In this case, you should respond with all available rooms that can accommodate 3 adults or more.
- You should not send rooms that can accommodate only 2 adults or less.
- You should also send only the room types that have available a number of rooms equal or greater than the number of parties. In this case there are two parties.
- The prices should be the total for the number of days and party. We will then divide it and come up with the price per night and per guest.
Another example party array might look as follows: [{"adults": 1},{"adults": 2},{"adults": 4}]
You should return all the room types that can accommodate the maximum number of adults (in this case 4) and have available at least the same number as the number of rooms requested (in this case 3).
Suppose that a hotel has a room type called “Double suite” that can accommodate 4 adults and a room type called “Large Double suite” that can accommodate 6. Both these room types could be returned in the response if the hotel has at least 3 rooms available of each.
All room types that can accommodate 1 or 2 adults maximum have to be excluded, and all room types that have less than 3 rooms available also have to be excluded.
No availability
So for no availability, Tripadvisor would expect to see:
... "response_type": "unavailable" ...
Merchandising
The below describes the implementation of 'Free Cancellation', 'Pay At Stay' and 'Breakfast Included' merchandising shown on Tripadvisor Hotel Availability search. Please note that the information below is only applicable for Hotel Availability response. Merchandising will only be shown if your cheapest rate is free to cancel and/or pay at stay and/or breakfast included. There is currently no merchandising for non-refundable or partially-refundable rates. Information must be correct on the partner's landing page. Partners should only support this feature if it has minimal to no impact on their response time. You should continue to return "requested_payload" flags as false as well as sending "persistent_room_type_code" and "persistent_rate_plan_code". For merchandising to be eligible it is required that "persistent_room_type_code" and "persistent_rate_plan_code" be populated and not be returned empty.
Free Cancellation
To be eligible for 'Free Cancellation' merchandising your Hotel Availability response should return cancellation_policy in RatePlans. Not all objects in cancellation_policy are required, to reduce complexity it is recommended that you only send the following:
cancellation_policy | object |
|
Pay at Stay
To be eligible for 'Pay At Stay' merchandising your Hotel Availability response should return "paid_at_checkout" : true for all LineItems:
"line_items": [ { "price": { "requested_currency_price": { "amount": 220, "currency": "USD" } }, "type": "rate", "paid_at_checkout": true, }, { "price": { "requested_currency_price": { "amount": 20, "currency": "USD" } }, "type": "tax", "sub_type": "tax_city", "paid_at_checkout": true, } ] },
Breakfast Included
Partners can indicate which meals are included in the quoted price via the "meal_plan" object in the associated rate plan. For partner offers to be eligible for “Breakfast included” offer-level merchandising, you will need to return a standard meal_plan code that represents a breakfast inclusion:
Code | Meaning |
3 | Bed & breakfast |
4 | Buffet breakfast |
5 | Caribbean breakfast |
6 | Continental breakfast |
7 | English breakfast |
11 | Full breakfast |
19 | Breakfast |
}, "meal_plan" : { "standard" : [ 3 ] } },