HTS APIs
Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.
/api/cars/v1/preCancelPre-cancelGet a cancellation quote for an order
Quote the cancellation for given order id. We determine whether a product in the order is within the cancellation policy, and if it is what the appropriate sell refund value are for the product. Calling precancel does not change the state of the booking order. It is only at the time of cancel that the booking order is actually cancelled.
Request body application/json · required
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-426614174000order_idThe unique identifier of the confirmed order.
RES-987654321Responses
200Pre-cancel a booking order by order id successfully.
cancellation_penaltyDefines the terms and conditions for canceling a vehicle rental.
Show fields
penalty_rangesShow fields
start_timeStart time of the penalty range (Inclusive), in ISO 8601 format.
end_timeEnd time of the penalty range (Exclusive), in ISO 8601 format.
penaltyPenalty amount withheld form the client upon cancellation.
Show fields
currencyCurrency code, in ISO 4217 format.
^[A-Z]{3}$ · Example USDamountMonetary amount value Serialized BigDecimal value
123.45refund_amountThe amount that will be refunded to the client.
Show fields
amountMonetary amount value Serialized BigDecimal value
123.45currencyCurrency code, in ISO 4217 format.
^[A-Z]{3}$ · Example USDcancellation_tokenToken to use to complete the cancellation, using the cancel operation.
stringvalid_untilISO 8601 timestamp until which the cancellation quote remains valid.
2025-01-13T13:45:15.523Zresponse_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_inputorder_already_cancelledorder_not_foundorder_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 PUT "https://travel-distribution.staging.htsapis.com/api/cars/v1/preCancel" \
-H "HTS-API-KEY: $HTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_id": "123e4567-e89b-12d3-a456-426614174000",
"order_id": "RES-987654321"
}'{
"cancellation_penalty": {
"penalty_ranges": [
{
"start_time": "2025-01-21T00:00:00Z",
"end_time": "2025-01-26T00:00:00Z",
"penalty": {
"currency": "USD",
"amount": "0.00"
}
},
{
"start_time": "2025-01-26T00:00:00Z",
"end_time": "2025-01-27T00:00:00Z",
"penalty": {
"currency": "USD",
"amount": "75.00"
}
},
{
"start_time": "2025-01-27T00:00:00Z",
"end_time": "2025-01-28T00:00:00Z",
"penalty": {
"currency": "USD",
"amount": "135.00"
}
}
]
},
"refund_amount": {
"amount": "123.45",
"currency": "USD"
},
"cancellation_token": "string",
"valid_until": "2025-01-13T13:45:15.523Z",
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}Examples are generated from the schema where the spec publishes none; field values are illustrative.
