HTS APIs
Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.
/api/lodging/v1/bookBookBook a lodging
Finalizes and confirms the reservation for a lodging using the provided quote token and primary guest information. This endpoint processes the booking transaction and returns a confirmation with reservation details.
Idempotency and Retry Behavior
This endpoint is idempotent for retries of the same booking attempt:
- Safe to retry with the same
request_id,book_token,partner_reference_id, and guest details if the connection is lost - Returns the same
order_idand booking confirmation for identical retry requests
Important: Do NOT reuse a book_token for different bookings:
- Each unique booking (different guests, different reservations) requires a new
/quotecall to obtain a freshbook_token - Reusing a
book_tokenfrom a completed booking with different guest details will result in an error - Even for identical hotel/dates/room combinations with different guests, you must call
/quoteagain to get a newbook_token
Payment declined:
- A
422 payment_declinedis final for thatbook_token: no reservation was created and no charge was made, and thebook_tokencannot be reused - To try again, call
/quotefor a freshbook_tokenand book with corrected payment details or a different payment method
One application per funnel:
- Call
/shop,/quoteand/bookwith the API key of that same application - A
book_tokenobtained by another application is rejected with403 token_application_mismatch
Request body application/json · required
Quote token and primary guest details to finalize the booking.
book_tokenOpaque token from the /quote response used to finalize this booking.
Important: Use the book_token only for the booking it was generated for. Each unique booking (different guests or reservations) requires calling /quote to obtain a new token. Reusing a token from a completed booking will result in an error.
The token is also bound to the application that quoted it. Call /book with the API key of that same application, otherwise the request is rejected with 403 token_application_mismatch.
stringrequest_idUnique value used to identify this request. If provided to us during operational questions, it will help us provide better support.
123e4567-e89b-12d3-a456-426614174000partner_reference_idA client-determined unique identifier for this booking, used for reconciliation and tracking.
Important: This identifier must be unique across all your bookings. Reusing the same partner_reference_id for different bookings will result in an error. Use a different value for each unique reservation, even when booking the same hotel/dates/room with different guests.
123e4567-e89b-12d3-a456-426614174000primary_guestDetails of the primary guest who will check in for the reservation.
Show fields
first_nameFirst name of the primary guest. Validation allows ANY character in any language (Latin, CJK, Arabic, etc), numbers, and punctuation. Strictly blocks Emojis and other 4-byte Unicode characters.
^[\u0000-\uD7FF\uE000-\uFFFF]+$ · Example Fredlast_nameLast name of the primary guest. Validation allows ANY character in any language, numbers, and punctuation. Strictly blocks Emojis and other 4-byte Unicode characters.
^[\u0000-\uD7FF\uE000-\uFFFF]+$ · Example LalondeemailEmail address of the primary guest.
fred@example.comphonePhone number of the primary guest.
^\+?[0-9]{7,15}$ · Example +18339334671hotel_loyaltyOptional. The guest's hotel loyalty memberships. Send whichever the guest holds; we forward the one matching the program on the rate being booked.
Always accepted, whatever the quote said. loyalty.loyalty_transmission on the quote advises whether collecting a membership is worth it — where it is not eligible we may have no way to transmit one, so the guest should verify at check-in — but it never gates this field.
Show fields
program_codeThe 3-character code identifying a hotel loyalty program.
Codes are added as more programs are supported, so treat an unrecognised code as a program you do not yet know about rather than as invalid.
Eligibility is determined by the provider from the rate plan; it is never derived from the traveller, and no loyalty membership is required to shop or book a loyalty-eligible rate.
^[A-Z0-9]{3}$loyalty_numberThe guest's membership number for this loyalty program.
123456789payment_methodPayment method for direct credit card payment. Required for tenants configured for direct payment processing; ignored for others. Use the provider-specific variant to supply the vault token. Contact Hopper to enable this feature for your tenant.
Show fields
Payment method for direct credit card payment. Required for tenants configured for direct payment processing; ignored for others. Use the provider-specific variant to supply the vault token. Contact Hopper to enable this feature for your tenant.
provider:spreedly (spreedly_payment_method) spreedly_payment_method
providerIdentifies this as a Spreedly payment method.
spreedly · Example spreedlytokenPayment method token issued by the Spreedly vault.
LbDpERKx17Y8PGeR4EvnMVdB1bNfraud_preventionFraud prevention data collected by the partner. Required for tenants using partner-managed fraud prevention; ignored for others. Use the type-specific variant to supply session data. Contact Hopper to enable this feature for your tenant.
Show fields
Fraud prevention data collected by the partner. Required for tenants using partner-managed fraud prevention; ignored for others. Use the type-specific variant to supply session data. Contact Hopper to enable this feature for your tenant.
type:riskified (riskified_fraud_prevention) riskified_fraud_prevention
typeIdentifies this as a Riskified fraud prevention payload.
riskified · Example riskifiedcustomer_ip_addressThe IP address of the customer making the booking.
203.0.113.42session_tokenSession token from the fraud prevention provider (e.g. the Riskified Beacon session ID).
00000000-0000-0000-0000-000000000000user_agentThe User-Agent string of the customer's browser or device.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)Responses
200Booking confirmation details with reservation information.
response_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000order_idUnique Hopper-generated order id corresponding to the booking order
L2J982VT3J28booking_warningsNon-fatal issues encountered while creating this booking. The reservation is confirmed regardless; an empty or absent list means no issues. Warnings describe what happened at booking time and are not repeated on the order.
Show fields
typeWhich warning this is, and therefore which sub-field below is populated.
loyalty_not_applied: a loyalty membership supplied on the book request was rejected.
loyalty_not_applied · Example loyalty_not_appliedloyalty_not_appliedA loyalty membership supplied on the book request was rejected. The reservation is confirmed; the stay will not be credited to that membership.
This warning is only emitted where the outcome is known. Pass-through is best effort: most supply sources never confirm either way, and silence produces no warning — so the absence of one means we sent what we could and have nothing to report, not that the stay was credited.
Show fields
reasonWhy the membership was rejected. This is a non-exhaustive list of enum values, which will be extended in the future.
not_supported_for_rate: the booking path for this rate cannot transmit a loyalty membership. Known in advance whenloyalty.loyalty_transmissionon the quote wasineligible; where it wasunknownthis may be the first confirmation.id_not_found: the membership number was not recognised.invalid_format: the membership number was malformed for this program.unspecified: rejected for a reason that does not map to the values above.
not_supported_for_rateid_not_foundinvalid_formatunspecified · Example id_not_found400Invalid Request. There will be an error code in the response detailing the issue.
error_codeError codes for the book operation. This is a non-exhaustive list of enum values, which will be extended in the future.
token_application_mismatch- thebook_tokencould not be shown to belong to the calling application. A funnel must be completed by the application that started it: shop, quote and book must all be called with the API key of that same application. Returned when the token belongs to a different application, when it carries no application binding, and when the calling application cannot be determined; thedescriptionsays which.loyalty_number_failure- the booking was rejected by the provider over the guest's hotel loyalty membership. Covers three underlying causes — the provider required a loyalty number and none was supplied, the number was not recognised, or the number was malformed for that provider; thedescriptionsays which. Expected to be rare: where the provider allows the booking to be retried without the membership it is, and the reservation is confirmed instead, so this error is only returned where it cannot be.payment_declined- the payment for the booking was declined. No reservation was created and no charge was made. Thebook_tokencannot be reused; call/quoteagain and book with corrected payment details or a different payment method.
invalid_inputinvalid_book_tokenrate_unavailableduplicate_partner_reference_idpayment_gateway_errorbook_token_already_usedunauthorizedtoken_application_mismatchloyalty_number_failurepayment_declineddescriptionA human-readable description of the error.
response_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000Example
{
"error_code": "invalid_input",
"description": "string",
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}403Forbidden. Returned when the `book_token` cannot be shown to belong to the calling application — it was issued to a different application, it carries no application binding, or the calling application could not be determined. The response will contain the error code `token_application_mismatch`, with the specific reason in `description`.
error_codeError codes for the book operation. This is a non-exhaustive list of enum values, which will be extended in the future.
token_application_mismatch- thebook_tokencould not be shown to belong to the calling application. A funnel must be completed by the application that started it: shop, quote and book must all be called with the API key of that same application. Returned when the token belongs to a different application, when it carries no application binding, and when the calling application cannot be determined; thedescriptionsays which.loyalty_number_failure- the booking was rejected by the provider over the guest's hotel loyalty membership. Covers three underlying causes — the provider required a loyalty number and none was supplied, the number was not recognised, or the number was malformed for that provider; thedescriptionsays which. Expected to be rare: where the provider allows the booking to be retried without the membership it is, and the reservation is confirmed instead, so this error is only returned where it cannot be.payment_declined- the payment for the booking was declined. No reservation was created and no charge was made. Thebook_tokencannot be reused; call/quoteagain and book with corrected payment details or a different payment method.
invalid_inputinvalid_book_tokenrate_unavailableduplicate_partner_reference_idpayment_gateway_errorbook_token_already_usedunauthorizedtoken_application_mismatchloyalty_number_failurepayment_declineddescriptionA human-readable description of the error.
response_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000Example
{
"error_code": "invalid_input",
"description": "string",
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}409Invalid Request. There will be an error code in the response detailing the issue.
error_codeError codes for the book operation. This is a non-exhaustive list of enum values, which will be extended in the future.
token_application_mismatch- thebook_tokencould not be shown to belong to the calling application. A funnel must be completed by the application that started it: shop, quote and book must all be called with the API key of that same application. Returned when the token belongs to a different application, when it carries no application binding, and when the calling application cannot be determined; thedescriptionsays which.loyalty_number_failure- the booking was rejected by the provider over the guest's hotel loyalty membership. Covers three underlying causes — the provider required a loyalty number and none was supplied, the number was not recognised, or the number was malformed for that provider; thedescriptionsays which. Expected to be rare: where the provider allows the booking to be retried without the membership it is, and the reservation is confirmed instead, so this error is only returned where it cannot be.payment_declined- the payment for the booking was declined. No reservation was created and no charge was made. Thebook_tokencannot be reused; call/quoteagain and book with corrected payment details or a different payment method.
invalid_inputinvalid_book_tokenrate_unavailableduplicate_partner_reference_idpayment_gateway_errorbook_token_already_usedunauthorizedtoken_application_mismatchloyalty_number_failurepayment_declineddescriptionA human-readable description of the error.
response_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000Example
{
"error_code": "invalid_input",
"description": "string",
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}422Unprocessable. The payment for the booking was declined. No reservation was created and no charge was made. The response will contain the error code `payment_declined`.
error_codeError codes for the book operation. This is a non-exhaustive list of enum values, which will be extended in the future.
token_application_mismatch- thebook_tokencould not be shown to belong to the calling application. A funnel must be completed by the application that started it: shop, quote and book must all be called with the API key of that same application. Returned when the token belongs to a different application, when it carries no application binding, and when the calling application cannot be determined; thedescriptionsays which.loyalty_number_failure- the booking was rejected by the provider over the guest's hotel loyalty membership. Covers three underlying causes — the provider required a loyalty number and none was supplied, the number was not recognised, or the number was malformed for that provider; thedescriptionsays which. Expected to be rare: where the provider allows the booking to be retried without the membership it is, and the reservation is confirmed instead, so this error is only returned where it cannot be.payment_declined- the payment for the booking was declined. No reservation was created and no charge was made. Thebook_tokencannot be reused; call/quoteagain and book with corrected payment details or a different payment method.
invalid_inputinvalid_book_tokenrate_unavailableduplicate_partner_reference_idpayment_gateway_errorbook_token_already_usedunauthorizedtoken_application_mismatchloyalty_number_failurepayment_declineddescriptionA human-readable description of the error.
response_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000Example
{
"error_code": "invalid_input",
"description": "string",
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}499Client closed the connection before the response could be sent (HTTP 499). This occurs when clients timeout or cancel requests while the server is still processing. The client will not receive this response. This means a quote, a booking or any other long running process may have been processed.
error_codeError returned when a client closes the connection before the response could be sent.
client_closed_requestdescriptionA human-readable description of what happened. For booking requests, this may include the partner reference ID for tracking.
response_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000additional_contextAdditional context about the error. For booking requests, includes partner_reference_id for tracking in BigQuery.
Example
{
"error_code": "client_closed_request",
"description": "string",
"response_id": "123e4567-e89b-12d3-a456-426614174000",
"additional_context": {}
}500Internal server error
error_codeError returned when an internal server error occurs.
internal_server_errordescriptionA human-readable description of the error.
response_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000Example
{
"error_code": "internal_server_error",
"description": "string",
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}curl -X POST "https://travel-distribution.staging.htsapis.com/api/lodging/v1/book" \
-H "HTS-API-KEY: $HTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"book_token": "string",
"request_id": "123e4567-e89b-12d3-a456-426614174000",
"partner_reference_id": "123e4567-e89b-12d3-a456-426614174000",
"primary_guest": {
"first_name": "Fred",
"last_name": "Lalonde",
"email": "fred@example.com",
"phone": "+18339334671",
"hotel_loyalty": [
{
"program_code": "string",
"loyalty_number": "123456789"
}
]
},
"payment_method": {
"provider": "spreedly",
"token": "LbDpERKx17Y8PGeR4EvnMVdB1bN"
},
"fraud_prevention": {
"type": "riskified",
"session_token": "00000000-0000-0000-0000-000000000000",
"customer_ip_address": "203.0.113.42",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
}
}'{
"response_id": "123e4567-e89b-12d3-a456-426614174000",
"order_id": "L2J982VT3J28",
"booking_warnings": [
{
"type": "loyalty_not_applied",
"loyalty_not_applied": {
"reason": "id_not_found"
}
}
]
}Examples are generated from the schema where the spec publishes none; field values are illustrative.
