The Hotel Availability Check (HAC) API allows partners that offer online hotel booking to show their availability and prices on Tripadvisor. Three distinct types of requests are sent by Tripadvisor, each of which requires a different response.
The HTTP or HTTPS URL to a Hotel Availability Check (HAC) API implementation is called a 'partner endpoint' or just 'endpoint'. In this documentation, the url:
will be used as the example endpoint to a fictitious HAC API implementation.
Technical Requirements
All HAC API requests from Tripadvisor are sent as a HTTP GET (configuration and inventory) or HTTP POST (availability) request. All parameters will be application/x-www-form-urlencoded.
All responses must conform to the JSON specification and be sent with the HTTP Content-Type header set to application/json.
All responses must use UTF-8 encoding.
All responses must return status code 200 (success). Any other status code is not acceptable. This includes status in the 300s (which indicates redirection), 400s (which indicates client error), and 500s (which indicates server error).
Redirects
Responses must not redirect to another URL. All the URLs in the API below do not use a trailing slash and you cannot redirect to a URL that contains one.
Optional Fields
Fields that are marked as '[Optional]' do not need to be included in your responses. When you do not have a value for an optional field, it should be omitted entirely. Do not include the field with an empty string.
JSON Data Types
There are a few datatypes used throughout this API.
String - Most values are strings. Strings must have quote marks around them. As stated above, empty strings are unacceptable for optional fields. Do not use control characters like \r, \n, or \t in Strings.
Number - A number can be used to represent anything from a Tripadvisor ID to a price. Numbers should not have quotes around them. Numbers can also have decimal points if needed
Boolean - Can only be the word true or false. Booleans are not written in quotes.
Performance
Your API needs to perform at a certain speed in order to handle Tripadvisor traffic. Responses to HAC API requests can take no longer than 10 seconds on average. The Hotel Inventory Response should take no more than 10 minutes to respond.
Additional Parameters in Tripadvisor Requests
Tripadvisor may add new parameters to its API requests at future dates. Those may not be documented at the time of your implementation so you should not validate against new parameters. These newly released parameters should not cause your API to return errors.