Channel Managers · API docs

Update Availability and Restrictions

URL: /v1/hotels/availability/update

Goals

To update in the extranet and in the website the availability and restrictions for the room/rate plan requested of a specific property in a set period of time.

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.

<OTA_HotelAvailNotifRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.0">
    <AvailStatusMessages HotelCode="282445">
        <AvailStatusMessage BookingLimit="10" BookingLimitMessageType="SetLimit">
            <StatusApplicationControl Start="2020-01-01" End="2020-01-02" InvCode="74959" />
        </AvailStatusMessage>
    </AvailStatusMessages>
</OTA_HotelAvailNotifRQ>

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_HotelAvailNotifRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.0">
    <AvailStatusMessages HotelCode="282445">
        <AvailStatusMessage>
            <StatusApplicationControl Start="2020-01-01" End="2020-01-02" RatePlanCode="27" InvCode="74959" />
            <LengthsOfStay>
                <LengthOfStay Time="3" TimeUnit="Day" MinMaxMessageType="MinLOS" />
                <LengthOfStay Time="60" TimeUnit="Day" MinMaxMessageType="MaxLOS" />
            </LengthsOfStay>
            <RestrictionStatus Restriction="Arrival" Status="Close" />
        </AvailStatusMessage>
    </AvailStatusMessages>
</OTA_HotelAvailNotifRQ>

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 details on how to compute 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 setting restrictions, the RestrictionStatus element can define only one of CTA, CTD, or stop-sell, and there can only be one RestrictionStatus element within a AvailStatusMessage element. If the channel needs to define several restrictions, it will have to repeat the AvailStatusMessage element. The extra elements must not repeat all the values, but just include StatusApplicationControl and RestrictionStatus.

Mind that the @Restriction and @Status attributes work together for CTA and CTD. The semantic when reading restrictions is different.

Examples

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

  • Set CTA.
<OTA_HotelAvailNotifRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.0">
    <AvailStatusMessages HotelCode="282445">
        <AvailStatusMessage>
            <StatusApplicationControl Start="2020-01-01" End="2020-01-02" RatePlanCode="27" InvCode="74959" />
            <LengthsOfStay>
                <LengthOfStay Time="3" TimeUnit="Day" MinMaxMessageType="MinLOS" />
                <LengthOfStay Time="60" TimeUnit="Day" MinMaxMessageType="MaxLOS" />
            </LengthsOfStay>
            <RestrictionStatus Restriction="Arrival" Status="Close" />
        </AvailStatusMessage>
    </AvailStatusMessages>
</OTA_HotelAvailNotifRQ>
  • Set CTA, CTD, and stop-sell.
<OTA_HotelAvailNotifRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.0">
    <AvailStatusMessages HotelCode="282445">
        <AvailStatusMessage>
            <StatusApplicationControl Start="2020-01-01" End="2020-01-02" RatePlanCode="27" InvCode="74959" />
            <LengthsOfStay>
                <LengthOfStay Time="3" TimeUnit="Day" MinMaxMessageType="MinLOS" />
                <LengthOfStay Time="60" TimeUnit="Day" MinMaxMessageType="MaxLOS" />
            </LengthsOfStay>
            <RestrictionStatus Restriction="Arrival" Status="Close" />
        </AvailStatusMessage>
        <AvailStatusMessage>
            <StatusApplicationControl Start="2020-01-02" End="2020-01-03" RatePlanCode="27" InvCode="74959" />
            <RestrictionStatus Restriction="Departure" Status="Close" />
        </AvailStatusMessage>
        <AvailStatusMessage>
            <StatusApplicationControl Start="2020-01-02" End="2020-01-03" RatePlanCode="27" InvCode="74959" />
            <RestrictionStatus Status="Close" />
        </AvailStatusMessage>
    </AvailStatusMessages>
</OTA_HotelAvailNotifRQ>
  • Remove CTA and stop-sell restrictions. Set CTD.
<OTA_HotelAvailNotifRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.0">
    <AvailStatusMessages HotelCode="282445">
        <AvailStatusMessage>
            <StatusApplicationControl Start="2020-01-01" End="2020-01-02" RatePlanCode="27" InvCode="74959" />
            <LengthsOfStay>
                <LengthOfStay Time="3" TimeUnit="Day" MinMaxMessageType="MinLOS" />
                <LengthOfStay Time="60" TimeUnit="Day" MinMaxMessageType="MaxLOS" />
            </LengthsOfStay>
            <RestrictionStatus Restriction="Arrival" Status="Open" />
        </AvailStatusMessage>
        <AvailStatusMessage>
            <StatusApplicationControl Start="2020-01-02" End="2020-01-03" RatePlanCode="27" InvCode="74959" />
            <RestrictionStatus Restriction="Departure" Status="Close" />
        </AvailStatusMessage>
        <AvailStatusMessage>
            <StatusApplicationControl Start="2020-01-02" End="2020-01-03" RatePlanCode="27" InvCode="74959" />
            <RestrictionStatus Status="Open" />
        </AvailStatusMessage>
    </AvailStatusMessages>
</OTA_HotelAvailNotifRQ>

Message Detail

Input: OTA_HotelAvailNotifRQ

ElementNumberDescription
OTA_HotelAvailNotifRQ1Root element
OTA_HotelAvailNotifRQ / AvailStatusMessages1Contains the availability and restriction messages
@HotelCode1The code for the hotel whose availability is being updated
AvailStatusMessages / AvailStatusMessage1..nEach AvailabilityStatusMessage contains the information regarding the units and type of update (status, number of units, available units) in a date range.
@BookingLimit0..1Flexible allotment. This value is the number of rooms available to sell plus the booking count. Refer to Get Inventory to find out more on how to compute this value.
@BookingLimitMessageType0..1Possible values: AdjustLimit: Adjusts flexible allotment by BookingLimit. A positive number will add, while a negative will subtract. SetLimit: Sets flexible allotment to BookingLimit.
AvailStatusMessage / StatusApplicationControl1Contains specific information regarding room availability
@RatePlanCode0..1Identifier code of the rate plan. Mandatory for restrictions. Must be clear for allotment.
@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 and CTD
@Status1Possible values: Close: Inventory not available for sale. Open: Inventory available for sale. The "Status" attribute alone, without the "Restriction" attribute defined, operates as a restriction for the room and defines if a room can be booked or not. (If its opened or closed)
@Restriction0..1Possible values: Arrival - Applies only for the day of arrival Departure - Applies only for the day of departure

Output: OTA_HotelAvailNotifRS

ElementNumberDescription
OTA_HotelAvailNotifRS1Root element
@Version1Service version
OTA_HotelAvailNotifRS / Success0..1It is present if the request has been processed successfully. The error node is not present if this node appears.
OTA_HotelAvailNotifRS / 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_HotelAvailNotifRS / Warnings0..1Contains a warning list in case the request was processed partially.
Warnings / Warning1..nIf there is a warnings node then there has to exist at least one warning node. The element will contain the warning text.
@Type1Warning type
@Code0..1Warning code