Home
Developer Guide
Introduction
About the API
Integrating with the API
FAQ
Get Hotel Information
Information
Examples
List RoomRates (Room + RatePlan)
Information
Examples
Get Availability and Restrictions
Information
Examples
Get Inventory
Information
Examples
Update Availability and Restrictions
Information
Examples
List Rate Plans
Information
Examples
Get Rates
Information
Examples
Update Rates
Information
Examples
Booking Handling (Pull)
Information
Examples
Booking Handling (Push)
Information
Examples
Reference Tables
Warning Validation Codes
Error Validation Codes
Booking Data Structures
## Get Availability and Restrictions **URL**: ```/v1/hotels/availability/get``` ### Goals To return the availability and restrictions for a date range, either for the given property or for all or any room/rate ### Notes #### Allotment or Restrictions Since allotment is defined at the room-level while restrictions are defined at the room-rate plan-level, an `AvailStatusMessage` element may indicate either allotment or restrictions, exclusively. For allotment, the `AvailStatusMessage` element will include `@BookingLimit` and `@BookingLimitMessageType` attributes, and contain a `StatusApplicationControl` element without `@RatePlanCode` attribute. For restrictions, the `AvailStatusMessage` element will contain a `StatusApplicationControl` element including `@Start`, `@End`, `@RatePlanCode`, and `@InvCode` attributes. The `AvailStatusMessage` element will also include `LengthsOfStay` and/or `RestrictionStatus` elements. ```xml
``` ####
Meaning of the @BookingLimit Attribute The value of the `@BookingLimit` attribute represents the total flexible allotment for a room, which is not the same as the inventory available to sell. Please refer to [Get Inventory](/portal/documentation/get-inventory) for more details on this value. ####
Interpretation of
CTA
/
CTD
/ Stop-Sell Due to the way the OTA specification is modeled, there is a particular interpretation of the values in the `RestrictionStatus` element that needs to be performed by the client. When processing a `RestrictionStatus` element, the `@Restriction` attribute indicates whether CTA or CTD is set, and the `@Status` attribute indicates whether stop-sell is set. Since there is only one `@Restriction` attribute in a `RestrictionStatus` element, and there is only one `RestrictionStatus` element in an `AvailStatusMessage` element, the API will issue two `AvailStatusMessage` elements when both CTA and CTD are set. The second element will only include `StatusApplicationControl` and `RestrictionStatus`. Both instances of `RestrictionStatus` will contain the same value for `@Status`. Mind that **the semantic when setting restrictions is [different](/portal/documentation/update-avail-restr#interpretation)**. ##### Examples Responses All the examples set
LOS
to show how other restrictions work together. * CTA is set. ```xml
``` * CTA and CTD are set. ```xml
``` * CTA, CTD, and stop-sell are set. ```xml
``` #### Filtering by Room or Rate Plan The output can be restricted to selected rooms or rate plans. ```xml
``` ### Message Detail #### Input: OTA_HotelAvailGetRQ | Element | Number | Description | |:-----------------------------------------------------------|:-------|:-----------------| | OTA_HotelAvailGetRQ | 1 | Root element | | OTA_ HotelAvailGetRQ / HotelAvailRequests | 1 | | | HotelAvailRequests / HotelAvailRequest | 1..n | | | HotelAvailRequest / RoomTypeCandidates | 0..1 | | | HotelAvailRequest / RoomTypeCandidates / RoomTypeCandidate | 1..n | | | @RoomTypeCode | 1 | Filter results by this room. | | HotelAvailRequest / RatePlanCandidates | 0..1 | | | HotelAvailRequest / RatePlanCandidates / RatePlanCandidate | 1..n | | | @RatePlanCode | 1 | Filter results by this rate plan. | | HotelAvailRequest / HotelRef | 0..1 | | | @HotelCode | 1 | The code of the hotel to query the room/rate. | | HotelAvailRequest / DataRange | 0..1 | A date or date range for the search criteria. | | @Start | 1 | Data request start date (inclusive). | | @End | 1 | Data request end date (exclusive). | #### Output: OTA_HotelAvailGetRS | Element | Number | Description | |:----------------------------------------------|:-------|:-----------------| | OTA_HotelAvailGetRS | 1 | Root element | | @Version | 1 | Service version | | OTA_HotelAvailGetRS / Success | 0..1 | It is present if the request has been processed successfully. The error node is not present if this node appears. | | OTA_HotelAvailGetRS / Errors | 0..1 | Contains an error list in case the request was not processed correctly. | | Errors / Error | 1..n | If there is an error node then there has to exist at least one error node. The element will contain the error text. | | @Type | 1 | Error type | | @Code | 0..1 | Error code | | OTA_HotelAvailGetRS / AvailStatusMessages | 1 | Contains the room/rate messages. | | @HotelCode | 1 | The code of the hotel to be queried. | | AvailStatusMessages / AvailStatusMessage | 1..n | Each contains the room/rate. | | @BookingLimit | 0..1 | Number of inventory units that are available for sale. Flexible quota. | | AvailStatusMessage / StatusApplicationControl | 1 | | | @RatePlanCode | 1 | Identifier code of the rate plan. | | @InvCode | 1 | Room identifier code. | | @Start | 1 | Data request start date (inclusive).| | @End | 1 | Data request end date (exclusive).| | LengthsOfStay / LengthOfStay | 0..1 | Used to inform the length of stay. | | @MinMaxMessageType | 1 | Used to indicate the minimum and maximum LOS that applies. Possible values:
SetMinLOS: Define the minimum length of stay.
Define the maximum length of stay.
| | @TimeUnit | 1 | Time unit used to apply this status message to other inventory. Values: year, month, week, day, hour, minute, second. We only use **day**.| | AvailStatusMessages / RestrictionStatus | 0..1 | Indicates restrictions like stop-sell, CTA, CTD, and min/max cut-off dates. | | @MinAdvancedBookingOffset | 0..1 | Also known as the minimum cut-off date. This value is **read-only**. | | @MaxAdvancedBookingOffset | 0..1 | Also known as the maximum cut-off date. This value is **read-only**. | | @Status | 1 | Possible values:
Close: Inventory not available for sale.
Open: Inventory available for sale.
This attribute works alone and is independent from `@Restriction` (If its opened or closed).| | @Restriction | 0..1 | Possible values:
Arrival - Applies only for the day of arrival
Departure - Applies only for the day of departure
If this attribute is present, it means that the restriction it states is applied, otherwise it's disabled.|