HTS APIs
Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.
/api/cars/v1/cancelCancelCancel a booking.
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.
Request body application/json · required
Cancel a confirmed booking using token generated at precancel stage.
request_idUnique identifier of the specific request. Use this identifier when you need to refer to a specific request, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000cancellation_tokenOpaque token generated at cancellation quote time (pre-cancel).
CANCEL-TOKEN-XYZ-12345Responses
200Cancel a booking by order id successfully
statusDescribes the status of a order.
confirmed- order was booked successfullycancelled- order was cancelled successfullypending- order is pendingfailed- order processing has failed
This is a non-exhaustive list of enum values, which will be extended in the future."
Show fields
Describes the status of a order.
confirmed- order was booked successfullycancelled- order was cancelled successfullypending- order is pendingfailed- order processing has failed
This is a non-exhaustive list of enum values, which will be extended in the future."
type:Variant 1 object
typecancelled · Example cancelledcancellation_infoInformation on a cancelled order
Show fields
cancellation_datetimeThe ISO 8601 datetime of when this order is cancelled.
2017-08-17T13:31:15.523ZVariant 2 object
typeconfirmed · Example confirmedVariant 3 object
typepending · Example pendingVariant 4 object
typefailed · Example failedresponse_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_codeA specific code identifying the type of error.
invalid_inputinvalid_cancel_tokenorder_already_cancelledorder_not_foundpick_up_in_the_pastrental_already_picked_uporder_not_cancellabledescriptionA human-readable message providing more details about 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"
}500Internal server error
error_codeError returned when an internal server error occurs.
internal_server_error · Example internal_server_errordescriptionA human-readable description of the error.
An unexpected error occurred.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": "An unexpected error occurred.",
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}curl -X POST "https://travel-distribution.staging.htsapis.com/api/cars/v1/cancel" \
-H "HTS-API-KEY: $HTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_id": "123e4567-e89b-12d3-a456-426614174000",
"cancellation_token": "CANCEL-TOKEN-XYZ-12345"
}'{
"status": {
"type": "cancelled",
"cancellation_info": {
"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.
