Channel Managers · API docs

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.

<OTA_HotelAvailGetRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="123">
    <Success/>
    <AvailStatusMessages HotelCode="282445">
        <!-- Allotment stated here -->
        <AvailStatusMessage BookingLimit="0" BookingLimitMessageType="SetLimit">
            <StatusApplicationControl InvCode="74959" Start="2020-01-01" End="2020-01-02"/>
        </AvailStatusMessage>
        <!-- Restrictions stated here -->
        <AvailStatusMessage>
            <StatusApplicationControl InvCode="74959" RatePlanCode="27" Start="2020-01-01" End="2020-01-02"/>
            <LengthsOfStay>
                <LengthOfStay MinMaxMessageType="MinLOS" Time="2" TimeUnit="Day"/>
            </LengthsOfStay>
            <RestrictionStatus MaxAdvancedBookingOffset="P10D" Restriction="Departure"/>
        </AvailStatusMessage>
    </AvailStatusMessages>
</OTA_HotelAvailGetRS>

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 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.

Examples Responses

All the examples set LOS to show how other restrictions work together.

  • CTA is set.
<OTA_HotelAvailGetRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="123">
    <Success/>
    <AvailStatusMessages HotelCode="282445">
        <AvailStatusMessage>
            <StatusApplicationControl InvCode="74959" RatePlanCode="27" Start="2020-01-01" End="2020-01-02"/>
            <LengthsOfStay>
                <LengthOfStay MinMaxMessageType="MinLOS" Time="2" TimeUnit="Day"/>
            </LengthsOfStay>
            <RestrictionStatus Restriction="Arrival" Status="Open"/>
        </AvailStatusMessage>
    </AvailStatusMessages>
</OTA_HotelAvailGetRS>
  • CTA and CTD are set.
<OTA_HotelAvailGetRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="123">
    <Success/>
    <AvailStatusMessages HotelCode="282445">
        <AvailStatusMessage>
            <StatusApplicationControl InvCode="74959" RatePlanCode="27" Start="2020-01-01" End="2020-01-02"/>
            <LengthsOfStay>
                <LengthOfStay MinMaxMessageType="MinLOS" Time="2" TimeUnit="Day"/>
            </LengthsOfStay>
            <RestrictionStatus Restriction="Arrival" Status="Open"/>
        </AvailStatusMessage>
        <AvailStatusMessage>
            <StatusApplicationControl InvCode="74959" RatePlanCode="27" Start="2020-01-01" End="2020-01-02"/>
            <RestrictionStatus Restriction="Departure" Status="Open"/>
        </AvailStatusMessage>
    </AvailStatusMessages>
</OTA_HotelAvailGetRS>
  • CTA, CTD, and stop-sell are set.
<OTA_HotelAvailGetRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="123">
    <Success/>
    <AvailStatusMessages HotelCode="282445">
        <AvailStatusMessage>
            <StatusApplicationControl InvCode="74959" RatePlanCode="27" Start="2020-01-01" End="2020-01-02"/>
            <LengthsOfStay>
                <LengthOfStay MinMaxMessageType="MinLOS" Time="2" TimeUnit="Day"/>
            </LengthsOfStay>
            <RestrictionStatus Restriction="Arrival" Status="Close"/>
        </AvailStatusMessage>
        <AvailStatusMessage>
            <StatusApplicationControl InvCode="74959" RatePlanCode="27" Start="2020-01-01" End="2020-01-02"/>
            <RestrictionStatus Restriction="Departure" Status="Close"/>
        </AvailStatusMessage>
    </AvailStatusMessages>
</OTA_HotelAvailGetRS>

Filtering by Room or Rate Plan

The output can be restricted to selected rooms or rate plans.

<OTA_HotelAvailGetRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.000">
    <HotelAvailRequests>
        <HotelAvailRequest>
        	<RoomTypeCandidates>
        		<RoomTypeCandidate RoomTypeCode="74961"/>
        	</RoomTypeCandidates>
        	<RatePlanCandidates>
        		<RatePlanCandidate RatePlanCode="27"/>
        	</RatePlanCandidates>
            <HotelRef HotelCode="282445" />
        </HotelAvailRequest>
    </HotelAvailRequests>
</OTA_HotelAvailGetRQ>

Message Detail

Input: OTA_HotelAvailGetRQ

ElementNumberDescription
OTA_HotelAvailGetRQ1Root element
OTA_ HotelAvailGetRQ / HotelAvailRequests1
HotelAvailRequests / HotelAvailRequest1..n
HotelAvailRequest / RoomTypeCandidates0..1
HotelAvailRequest / RoomTypeCandidates / RoomTypeCandidate1..n
@RoomTypeCode1Filter results by this room.
HotelAvailRequest / RatePlanCandidates0..1
HotelAvailRequest / RatePlanCandidates / RatePlanCandidate1..n
@RatePlanCode1Filter results by this rate plan.
HotelAvailRequest / HotelRef0..1
@HotelCode1The code of the hotel to query the room/rate.
HotelAvailRequest / DataRange0..1A date or date range for the search criteria.
@Start1Data request start date (inclusive).
@End1Data request end date (exclusive).

Output: OTA_HotelAvailGetRS

ElementNumberDescription
OTA_HotelAvailGetRS1Root element
@Version1Service version
OTA_HotelAvailGetRS / Success0..1It is present if the request has been processed successfully. The error node is not present if this node appears.
OTA_HotelAvailGetRS / Errors0..1Contains an error list in case the request was not processed correctly.
Errors / Error1..nIf there is an error node then there has to exist at least one error node. The element will contain the error text.
@Type1Error type
@Code0..1Error code
OTA_HotelAvailGetRS / AvailStatusMessages1Contains the room/rate messages.
@HotelCode1The code of the hotel to be queried.
AvailStatusMessages / AvailStatusMessage1..nEach contains the room/rate.
@BookingLimit0..1Number of inventory units that are available for sale. Flexible quota.
AvailStatusMessage / StatusApplicationControl1
@RatePlanCode1Identifier code of the rate plan.
@InvCode1Room identifier code.
@Start1Data request start date (inclusive).
@End1Data request end date (exclusive).
LengthsOfStay / LengthOfStay0..1Used to inform the length of stay.
@MinMaxMessageType1Used to indicate the minimum and maximum LOS that applies. Possible values: SetMinLOS: Define the minimum length of stay. Define the maximum length of stay.
@TimeUnit1Time unit used to apply this status message to other inventory. Values: year, month, week, day, hour, minute, second. We only use day.
AvailStatusMessages / RestrictionStatus0..1Indicates restrictions like stop-sell, CTA, CTD, and min/max cut-off dates.
@MinAdvancedBookingOffset0..1Also known as the minimum cut-off date. This value is read-only.
@MaxAdvancedBookingOffset0..1Also known as the maximum cut-off date. This value is read-only.
@Status1Possible 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).
@Restriction0..1Possible 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.