API reference

HTS APIs

Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.

POST/api/cars/v1/cancelCancel

Cancel a booking.

https://travel-distribution.staging.htsapis.com/api/cars/v1/cancel

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_id
string · uuid
required

Unique identifier of the specific request. Use this identifier when you need to refer to a specific request, when requiring technical support.

Example 123e4567-e89b-12d3-a456-426614174000
cancellation_token
string
required

Opaque token generated at cancellation quote time (pre-cancel).

Example CANCEL-TOKEN-XYZ-12345

Responses

200Cancel a booking by order id successfully
status
one of 4
required

Describes the status of a order.

  • confirmed - order was booked successfully
  • cancelled - order was cancelled successfully
  • pending - order is pending
  • failed - 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 successfully
  • cancelled - order was cancelled successfully
  • pending - order is pending
  • failed - order processing has failed

This is a non-exhaustive list of enum values, which will be extended in the future."

Exactly one of the following, selected by type:
Variant 1 object
type
string enum
required
Values cancelled · Example cancelled
cancellation_info
object
required

Information on a cancelled order

Show fields
cancellation_datetime
string · date-time
required

The ISO 8601 datetime of when this order is cancelled.

Example 2017-08-17T13:31:15.523Z
Variant 2 object
type
string enum
required
Values confirmed · Example confirmed
Variant 3 object
type
string enum
required
Values pending · Example pending
Variant 4 object
type
string enum
required
Values failed · Example failed
response_id
string · uuid
required

Unique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.

Example 123e4567-e89b-12d3-a456-426614174000
400Invalid Request. There will be an error code in the response detailing the issue.
error_code
string enum
required

A specific code identifying the type of error.

Values invalid_inputinvalid_cancel_tokenorder_already_cancelledorder_not_foundpick_up_in_the_pastrental_already_picked_uporder_not_cancellable
description
string
required

A human-readable message providing more details about the error.

response_id
string · uuid
required

Unique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.

Example 123e4567-e89b-12d3-a456-426614174000
Example
{
  "error_code": "invalid_input",
  "description": "string",
  "response_id": "123e4567-e89b-12d3-a456-426614174000"
}
500Internal server error
error_code
string enum
required

Error returned when an internal server error occurs.

Values internal_server_error · Example internal_server_error
description
string
required

A human-readable description of the error.

Example An unexpected error occurred.
response_id
string · uuid
required

Unique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.

Example 123e4567-e89b-12d3-a456-426614174000
Example
{
  "error_code": "internal_server_error",
  "description": "An unexpected error occurred.",
  "response_id": "123e4567-e89b-12d3-a456-426614174000"
}
Request
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"
}'
Response 200
{
  "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.