HTS APIs
Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.
/api/lodging/v1/cancelCancelCancel a booking order
Completes the cancellation of an order, which was previously pre-canceled. You must first use the precancel operation to obtain a cancellation token, which is then used to complete the cancellation.
Note that this endpoint is idempotent, and the client can safely retry the request with the same cancellation token if the connection is lost.
The cancellation token is bound to the application that pre-cancelled: call /cancel with
the API key of that same application, otherwise the request is rejected with
403 token_application_mismatch.
Request body application/json · required
Order ID and cancellation token from the precancel operation.
request_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-426614174000cancellation_tokenOpaque token generated at cancellation quote time.
Important: the token is bound to the application that pre-cancelled. Call /cancel with the API key of that same application, otherwise the request is rejected with 403 token_application_mismatch.
stringResponses
200Cancel a booking order by order id successfully
order_statusDescribes the status of a order.
confirmed- order was booked successfullycancelled- order was cancelled successfully
This is a non-exhaustive list of enum values, which may be extended in the future."
Show fields
Describes the status of a order.
confirmed- order was booked successfullycancelled- order was cancelled successfully
This is a non-exhaustive list of enum values, which may be extended in the future."
type:cancelled (order_status_cancelled) order_status_cancelled
typeDiscriminator value for cancelled order status
cancelled · Example cancelledcancellation_infoInformation on a cancelled order
Show fields
Information on a cancelled order
type:hotel (cancellation_info_hotel) cancellation_info_hotel
typeDiscriminator value identifying this cancellation info type.
hotelvacation_rental (cancellation_info_vacation_rental) cancellation_info_vacation_rental
typeDiscriminator value identifying this cancellation info type.
vacation_rentalinstigatorIndicates who initiated the cancellation.
guesthost · Example guestguest_refund_amountThe amount refunded to the guest for the cancelled vacation rental
Show fields
currencyCurrency code, in ISO 4217 format.
^[A-Z]{3}$ · Example USDamountMonetary amount value Serialized BigDecimal value
123.45confirmed (order_status_confirmed) order_status_confirmed
typeDiscriminator value for confirmed order status
confirmed · Example confirmedresponse_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-426614174000400Invalid Request. There will be an error code in the response detailing the issue.
error_codeError codes for the cancel operation. This is a non-exhaustive list of enum values, which will be extended in the future.
invalid_input- the request was malformed.invalid_cancel_token- the cancellation token is invalid or expired.order_already_cancelled- the order has already been cancelled.unauthorized- the caller is not authorized to cancel this order.cannot_be_cancelled- the reservation cannot be cancelled (e.g. the provider rejected the cancellation, the cancellation deadline has passed, or it is non-refundable). This is a terminal outcome; thedescriptionfield carries the specific reason.token_application_mismatch- thecancellation_tokencould not be shown to belong to the calling application. Precancel and cancel must be called with the API key of the 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.
invalid_inputinvalid_cancel_tokenorder_already_cancelledunauthorizedcannot_be_cancelledtoken_application_mismatchdescriptionA human-readable description of the error. For cannot_be_cancelled, this conveys the specific reason (e.g. requires_agent_cancellation, past_cancellation_deadline, cancellation_not_allowed).
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 `cancellation_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 cancel operation. This is a non-exhaustive list of enum values, which will be extended in the future.
invalid_input- the request was malformed.invalid_cancel_token- the cancellation token is invalid or expired.order_already_cancelled- the order has already been cancelled.unauthorized- the caller is not authorized to cancel this order.cannot_be_cancelled- the reservation cannot be cancelled (e.g. the provider rejected the cancellation, the cancellation deadline has passed, or it is non-refundable). This is a terminal outcome; thedescriptionfield carries the specific reason.token_application_mismatch- thecancellation_tokencould not be shown to belong to the calling application. Precancel and cancel must be called with the API key of the 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.
invalid_inputinvalid_cancel_tokenorder_already_cancelledunauthorizedcannot_be_cancelledtoken_application_mismatchdescriptionA human-readable description of the error. For cannot_be_cancelled, this conveys the specific reason (e.g. requires_agent_cancellation, past_cancellation_deadline, cancellation_not_allowed).
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 cancel operation. This is a non-exhaustive list of enum values, which will be extended in the future.
invalid_input- the request was malformed.invalid_cancel_token- the cancellation token is invalid or expired.order_already_cancelled- the order has already been cancelled.unauthorized- the caller is not authorized to cancel this order.cannot_be_cancelled- the reservation cannot be cancelled (e.g. the provider rejected the cancellation, the cancellation deadline has passed, or it is non-refundable). This is a terminal outcome; thedescriptionfield carries the specific reason.token_application_mismatch- thecancellation_tokencould not be shown to belong to the calling application. Precancel and cancel must be called with the API key of the 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.
invalid_inputinvalid_cancel_tokenorder_already_cancelledunauthorizedcannot_be_cancelledtoken_application_mismatchdescriptionA human-readable description of the error. For cannot_be_cancelled, this conveys the specific reason (e.g. requires_agent_cancellation, past_cancellation_deadline, cancellation_not_allowed).
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/cancel" \
-H "HTS-API-KEY: $HTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_id": "123e4567-e89b-12d3-a456-426614174000",
"cancellation_token": "string"
}'{
"order_status": {
"type": "cancelled",
"cancellation_info": {
"type": "hotel",
"cancellation_datetime": "2025-02-17T18:31:15.523Z"
}
},
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}Examples are generated from the schema where the spec publishes none; field values are illustrative.
