HTS APIs
Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.
/api/lodging/v1/calendars/availabilityCalendarGet availability calendar for lodgings
Returns availability information for the specified lodgings. The response includes per-day information about the lodging's availability, information about if check-in or check-out is available for the day.
Past Date Handling: If the start date is in the past, past days will automatically be included in the response marked as unavailable (available: false, checkin: "invalid", checkout: "invalid").
Request body application/json · required
Date range and lodging IDs for the availability calendar.
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-426614174000lodging_idsList of lodging IDs to get calendar for. (1 to 25)
start_dateThe start date of the calendar period. Notes:
- The date is interpreted in the lodging's timezone.
- Past dates are allowed; past days will be returned as unavailable.
- Start date can be at most 2 years in the future.
2022-01-01end_dateThe end date of the calendar period. Note:
- The date is interpreted in the lodging's timezone.
- End date needs to be after the start date.
- End date can be at most 1 year after the start date.
2022-05-01Responses
200Availability calendar for the requested lodgings
lodgingsList of lodging calendars for which availability information is available.
Show fields
lodging_idUnique identifier for the lodging
123e4567-e89b-12d3-a456-426614174000calendar_daysList of calendar days with availability information. Must contain an entry for every day in the requested date range. Days with unknown availability should use the Unknown availability day type.
Show fields
Availability information for a single day
kind:known (known_availability_calendar_day) known_availability_calendar_day
dateThe date (YYYY-MM-DD format) in the lodging's timezone
2022-01-01kindDiscriminator for calendar day type: 'known' (availability is known) or 'unknown' (availability is not known for this day)
knownunknown · Example knownavailableWhether the lodging is available or unavailable on a calendar day.
(Formerly exposed as schema key available_enum; use availability_status for consistency with other enums such as property_type, meal_plan.)
availableunavailable · Example availableunknown (unknown_availability_calendar_day) unknown_availability_calendar_day
dateThe date (YYYY-MM-DD format) in the lodging's timezone
2022-01-01kindDiscriminator for calendar day type: 'known' (availability is known) or 'unknown' (availability is not known for this day)
knownunknown · Example knownresponse_idUnique identifier for this response
123e4567-e89b-12d3-a456-426614174000400Invalid Request. There will be an error code in the response detailing the issue.
error_codeError code indicating the type of failure
invalid_inputunauthorized · Example invalid_inputdescriptionHuman-readable error description
Invalid lodging IDs providedresponse_idUnique identifier for this response
123e4567-e89b-12d3-a456-426614174000Example
{
"error_code": "invalid_input",
"description": "Invalid lodging IDs provided",
"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 PUT "https://travel-distribution.staging.htsapis.com/api/lodging/v1/calendars/availability" \
-H "HTS-API-KEY: $HTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_id": "123e4567-e89b-12d3-a456-426614174000",
"lodging_ids": [
"123e4567-e89b-12d3-a456-426614174000",
"987f6543-21ba-43dc-9876-543210987654"
],
"start_date": "2022-01-01",
"end_date": "2022-05-01"
}'{
"lodgings": [
{
"lodging_id": "123e4567-e89b-12d3-a456-426614174000",
"calendar_days": [
{
"kind": "known",
"date": "2022-01-01",
"available": "available"
},
{
"kind": "known",
"date": "2022-01-02",
"available": "available"
},
{
"kind": "known",
"date": "2022-01-03",
"available": "unavailable"
},
{
"kind": "unknown",
"date": "2022-01-04"
},
{
"kind": "known",
"date": "2022-01-05",
"available": "available"
}
]
}
],
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}Examples are generated from the schema where the spec publishes none; field values are illustrative.
