Channel Managers · API docs

Get Inventory Examples

Example requests are editable. Click to start editing.

Return Data for All Rooms for Hotel 484034

Request
<OTA_HotelInvCountRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.002" >
    <HotelInvCountRequests>
        <HotelInvCountRequest>
            <DateRange Start="${year}-06-10" End="${year}-12-12" />
            <HotelRef HotelCode="484034" />
        </HotelInvCountRequest>
    </HotelInvCountRequests>
</OTA_HotelInvCountRQ>
Response
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelInvCountRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="despegar">
    <Success/>
    <Inventories HotelCode="484034">
        <Inventory>
            <InvCounts>
                <InvCount ActionType="Allocation" CountType="2" Count="0"/>
                <InvCount ActionType="Allocation" CountType="21" Count="0"/>
                <InvCount ActionType="Used" CountType="4" Count="0"/>
            </InvCounts>
            <StatusApplicationControl InvCode="844228" Start="2019-09-18" End="2019-09-25"/>
        </Inventory>
        <Inventory>
            <InvCounts>
                <InvCount ActionType="Allocation" CountType="2" Count="1000"/>
                <InvCount ActionType="Allocation" CountType="21" Count="0"/>
                <InvCount ActionType="Used" CountType="4" Count="0"/>
            </InvCounts>
            <StatusApplicationControl InvCode="844228" Start="2019-09-25" End="2019-12-12"/>
        </Inventory>
    </Inventories>
</OTA_HotelInvCountRS>

Top

Filter by Room for Hotel 484034

Request
<OTA_HotelInvCountRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.002" >
    <HotelInvCountRequests>
        <HotelInvCountRequest>
            <DateRange Start="${year}-06-10" End="${year}-12-12" />
            <RoomTypeCandidates>
                <RoomTypeCandidate RoomTypeCode="844228" />
            </RoomTypeCandidates>
            <HotelRef HotelCode="484034" />
        </HotelInvCountRequest>
    </HotelInvCountRequests>
</OTA_HotelInvCountRQ>
Response
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelInvCountRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="despegar">
    <Success/>
    <Inventories HotelCode="484034">
        <Inventory>
            <InvCounts>
                <InvCount ActionType="Allocation" CountType="2" Count="0"/>
                <InvCount ActionType="Allocation" CountType="21" Count="0"/>
                <InvCount ActionType="Used" CountType="4" Count="0"/>
            </InvCounts>
            <StatusApplicationControl InvCode="844228" Start="2019-09-18" End="2019-09-25"/>
        </Inventory>
        <Inventory>
            <InvCounts>
                <InvCount ActionType="Allocation" CountType="2" Count="1000"/>
                <InvCount ActionType="Allocation" CountType="21" Count="0"/>
                <InvCount ActionType="Used" CountType="4" Count="0"/>
            </InvCounts>
            <StatusApplicationControl InvCode="844228" Start="2019-09-25" End="2019-12-12"/>
        </Inventory>
    </Inventories>
</OTA_HotelInvCountRS>

Top

No Reservations for Hotel 484034

Request
<OTA_HotelInvCountRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.002" >
    <HotelInvCountRequests>
        <HotelInvCountRequest>
            <DateRange Start="${year}-07-10" End="${year}-12-12" />
            <RoomTypeCandidates>
                <RoomTypeCandidate RoomTypeCode="844228" />
            </RoomTypeCandidates>
            <HotelRef HotelCode="484034" />
        </HotelInvCountRequest>
    </HotelInvCountRequests>
</OTA_HotelInvCountRQ>
Response
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelInvCountRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="despegar">
    <Success/>
    <Inventories HotelCode="484034">
        <Inventory>
            <InvCounts>
                <InvCount ActionType="Allocation" CountType="2" Count="0"/>
                <InvCount ActionType="Allocation" CountType="21" Count="0"/>
                <InvCount ActionType="Used" CountType="4" Count="0"/>
            </InvCounts>
            <StatusApplicationControl InvCode="844228" Start="2023-07-10" End="2023-12-12"/>
        </Inventory>
    </Inventories>
</OTA_HotelInvCountRS>

Top

Request Two Date Ranges for Hotel 484034

Request
<OTA_HotelInvCountRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.002" >
    <HotelInvCountRequests>
        <HotelInvCountRequest>
            <DateRange Start="${year}-06-10" End="${year}-06-20" />
            <HotelRef HotelCode="484034" />
        </HotelInvCountRequest>
        <HotelInvCountRequest>
            <DateRange Start="${year}-07-10" End="${year}-07-20" />
            <HotelRef HotelCode="484034" />
        </HotelInvCountRequest>
    </HotelInvCountRequests>
</OTA_HotelInvCountRQ>
Response
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelInvCountRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="despegar">
    <Success/>
    <Inventories HotelCode="484034">
        <Inventory>
            <InvCounts>
                <InvCount ActionType="Allocation" CountType="2" Count="0"/>
                <InvCount ActionType="Allocation" CountType="21" Count="0"/>
                <InvCount ActionType="Used" CountType="4" Count="0"/>
            </InvCounts>
            <StatusApplicationControl InvCode="844228" Start="2019-06-10" End="2019-06-20"/>
        </Inventory>
        <Inventory>
            <InvCounts>
                <InvCount ActionType="Allocation" CountType="2" Count="0"/>
                <InvCount ActionType="Allocation" CountType="21" Count="0"/>
                <InvCount ActionType="Used" CountType="4" Count="0"/>
            </InvCounts>
            <StatusApplicationControl InvCode="844228" Start="2020-07-10" End="2020-07-20"/>
        </Inventory>
    </Inventories>
</OTA_HotelInvCountRS>

Top

Request Two Consecutive Date Ranges for Hotel 484034

Request
<OTA_HotelInvCountRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.002" >
    <HotelInvCountRequests>
        <HotelInvCountRequest>
            <DateRange Start="${year}-06-10" End="${year}-06-20" />
            <HotelRef HotelCode="484034" />
        </HotelInvCountRequest>
        <HotelInvCountRequest>
            <DateRange Start="${year}-06-20" End="${year}-07-20" />
            <HotelRef HotelCode="484034" />
        </HotelInvCountRequest>
    </HotelInvCountRequests>
</OTA_HotelInvCountRQ>
Response
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelInvCountRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="despegar">
    <Success/>
    <Inventories HotelCode="484034">
        <Inventory>
            <InvCounts>
                <InvCount ActionType="Allocation" CountType="2" Count="0"/>
                <InvCount ActionType="Allocation" CountType="21" Count="0"/>
                <InvCount ActionType="Used" CountType="4" Count="0"/>
            </InvCounts>
            <StatusApplicationControl InvCode="844228" Start="2019-09-18" End="2019-09-25"/>
        </Inventory>
        <Inventory>
            <InvCounts>
                <InvCount ActionType="Allocation" CountType="2" Count="1000"/>
                <InvCount ActionType="Allocation" CountType="21" Count="0"/>
                <InvCount ActionType="Used" CountType="4" Count="0"/>
            </InvCounts>
            <StatusApplicationControl InvCode="844228" Start="2019-09-25" End="2019-10-20"/>
        </Inventory>
    </Inventories>
</OTA_HotelInvCountRS>

Top

Empty Hotel Code

Request
<OTA_HotelInvCountRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.002" >
    <HotelInvCountRequests>
        <HotelInvCountRequest>
            <DateRange Start="${year}-06-10" End="${year}-12-12" />
            <HotelRef HotelCode="" />
        </HotelInvCountRequest>
    </HotelInvCountRequests>
</OTA_HotelInvCountRQ>
Response
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelInvCountRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="despegar">
    <Errors>
        <Error Type="6" Code="E41002" NodeList="">Empty hotel code. Please see https://channel.despegar.com/portal/documentation/faq#bad-credentials</Error>
    </Errors>
</OTA_HotelInvCountRS>

Top

Wrong Dates

Request
<OTA_HotelInvCountRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.002" >
    <HotelInvCountRequests>
        <HotelInvCountRequest>
            <DateRange Start="${year}/06/10" End="${year}-12-12" />
            <HotelRef HotelCode="123" />
        </HotelInvCountRequest>
    </HotelInvCountRequests>
</OTA_HotelInvCountRQ>
Response
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelInvCountRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="despegar">
    <Errors>
        <Error Type="7" Code="E40004" NodeList="">cvc-datatype-valid.1.2.1: '2019/06/10' is not a valid value for 'date'.. Please consult documentation regarding the correct message format at https://channel.despegar.com</Error>
    </Errors>
</OTA_HotelInvCountRS>

Top

Unknown Hotel

Request
<OTA_HotelInvCountRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.002" >
    <HotelInvCountRequests>
        <HotelInvCountRequest>
            <DateRange Start="${year}-06-10" End="${year}-12-12" />
            <HotelRef HotelCode="123" />
        </HotelInvCountRequest>
    </HotelInvCountRequests>
</OTA_HotelInvCountRQ>
Response
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelInvCountRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="despegar">
    <Errors>
        <Error Type="6" Code="E41002" NodeList="">No credentials have been provided to access hotel 123. Please see https://channel.despegar.com/portal/documentation/faq#bad-credentials</Error>
    </Errors>
</OTA_HotelInvCountRS>

Top

Unknown Hotel Rooms

Request
<OTA_HotelInvCountRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.002" >
    <HotelInvCountRequests>
        <HotelInvCountRequest>
            <DateRange Start="${year}-06-10" End="${year}-12-12" />
            <RoomTypeCandidates>
                <RoomTypeCandidate RoomTypeCode="123" />
                <RoomTypeCandidate RoomTypeCode="456" />
            </RoomTypeCandidates>
            <HotelRef HotelCode="484034" />
        </HotelInvCountRequest>
    </HotelInvCountRequests>
</OTA_HotelInvCountRQ>
Response
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelInvCountRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="despegar">
    <Errors>
        <Error Type="3" Code="E40206" NodeList="/OTA_HotelInvCountRQ/HotelInvCountRequests/HotelInvCountRequest[0]/RoomTypeCandidates/RoomTypeCandidate[0]/@RoomTypeCode /OTA_HotelInvCountRQ/HotelInvCountRequests/HotelInvCountRequest[0]/RoomTypeCandidates/RoomTypeCandidate[1]/@RoomTypeCode">Room codes 123,456 invalid for hotel 484034</Error>
    </Errors>
</OTA_HotelInvCountRS>

Top

Invalid Query for Two Different Hotels in the Same Message

Request
<OTA_HotelInvCountRQ xmlns="http://www.despegar.com/hotels/ota/v1/" Version="1.002" >
    <HotelInvCountRequests>
        <HotelInvCountRequest>
            <DateRange Start="${year}-06-10" End="${year}-12-12" />
            <HotelRef HotelCode="484034" />
        </HotelInvCountRequest>
        <HotelInvCountRequest>
            <DateRange Start="${year}-06-10" End="${year}-12-12" />
            <HotelRef HotelCode="282445" />
        </HotelInvCountRequest>
    </HotelInvCountRequests>
</OTA_HotelInvCountRQ>
Response
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelInvCountRS xmlns="http://www.despegar.com/hotels/ota/v1/" Version="v1" CorrelationID="despegar">
    <Errors>
        <Error Type="6" Code="E41002" NodeList="">No credentials have been provided to access hotel 282445. Please see https://channel.despegar.com/portal/documentation/faq#bad-credentials</Error>
    </Errors>
</OTA_HotelInvCountRS>

Top