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/bookBook

Book an offer.

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

Create a car rental order for a chosen offer, using the offer_id and any necessary driver details. It finalizes the booking process with the provider and, if applicable, initiates the sending of an itinerary or confirmation email to the customer.

Request body application/json · required

Request body for finalizing a car rental order.

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
book_token
string
required

Opaque token generated at quote time to initiate a book request.

Example book_12345
partner_reference_id
string
required

An client determined id for the given booking for potential reconciliation.

Example 123e4567-e89b-12d3-a456-426614174000
driver
object
required

Details of the primary driver for the booking.

Show fields
email
string · email
required

The email address of the primary driver.

Example john.doe@example.com
first_name
string
required

The first name of the primary driver.

Example John
last_name
string
required

The last name of the primary driver.

Example Doe
date_of_birth
string · date
required

The date of birth of the primary driver in ISO 8601 format. The driver age must match the age provided in the shop request.

Example 1990-05-20
phone
string

Phone number of the driver.

Pattern ^\+?[0-9]{7,15}$ · Example +18339334671

Responses

200Book a order successfully.
order_id
string
required

The unique identifier of the confirmed order.

Example ORD-987654321
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_book_tokenrate_unavailabledriver_age_changedage_restriction_not_metprice_changedbooking_conflictadvance_lead_time_not_met
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/book" \
  -H "HTS-API-KEY: $HTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "request_id": "123e4567-e89b-12d3-a456-426614174000",
  "book_token": "book_12345",
  "partner_reference_id": "123e4567-e89b-12d3-a456-426614174000",
  "driver": {
    "email": "john.doe@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "date_of_birth": "1990-05-20",
    "phone": "+18339334671"
  }
}'
Response 200
{
  "order_id": "ORD-987654321",
  "response_id": "123e4567-e89b-12d3-a456-426614174000"
}

Examples are generated from the schema where the spec publishes none; field values are illustrative.