Booking Retrieval

Contents

1. GetBookingDetails EndPoint

agoda offers two types of endpoints:

  • Single endpoint : One Endpoint for all agoda calls,

  • Multiple endpoint : One Endpoint Per Call (each endpoint is configured unique to that call type).

NOTE: please note that if you wish to use the single endpoint for your request, the Type attribute will be mandatory in all the requests you will send to Agoda (this is to allow us to identify the call type).

GetBookingDetails - Multiple endpoint

  • Sandbox: https://sandbox-distribution-xml.agoda.com/api/booking/detail/search?apiKey=xxx

  • Live: https://supply.agoda.com/api/booking/detail/search?apiKey=xxx

GetBookingDetails - Single endpoint (Please note: 'type=4' attribute is mandatory when using Single endpoint)

  • Sandbox: https://sandbox-distribution-xml.agoda.com/api?apiKey=xxx

  • Live: https://supply.agoda.com/api?apiKey=xxx

2. GetBookingDetails RQ

<?xml version="1.0" encoding="UTF-8"?>

<request timestamp="1436931804" type="3">

<criteria language="JA">

<property id="99">

<booking id="10061388"/>

<booking id="10009302"/>

<booking id="10008589"/>

<booking id="10008389"/>

</property>

</criteria>

</request>


<!--

Max property id is restricted to 1 (configurable)

Max booking ids restricted to 50 (configurable)

-->

3. GetBookingDetails Response

<result timestamp="1501649887310">

<bookings count="3" iataid="96637800">

<booking property_id="99" property_name="Test Hotel" booking_id="202577467" booking_date="2017-07-07T18:38:00+07:00" last_action="2017-07-07T18:38:20+07:00" arrival="2017-07-16" departure="2017-07-17" status="ConfirmBooking" acknowledge="0" room_id="2981145" room_type="Standard" channel_id="1" channel_name="Retail" rateplan_id="932685" rateplan_name="Non Refundable-Run of the house" room_count="1" adults="2" children="0" extrabeds="0" cxl_code="365D100P_100P">

<customer first_name="Agoda" last_name="Test" nationality="Mauritius"/>

<requests>

<request request_name="LargeBed"/>

<request request_name="AdditionalNotes:&quot;Check in will be at 9:00pm and need a late check out.Need a good room and city view&quot;"/>

</requests>

<payment card_type="MasterCard" card_number="533511234567894" card_name="Agoda Company Pte Ltd." card_exp="12/2017" card_cvv="966"/>

<prices currency="HKD" net_inclusive_amt="498.0" refsell_amt="600.0">

<price date="2017-07-16" net_inclusive_amt="498.0" refsell_amt="600.0" type="Room"/>

</prices>

</booking>

<booking property_id="99" property_name="Test Hotel" booking_id="217393581" booking_date="2017-07-09T14:50:00+07:00" last_action="2017-07-09T23:21:19+07:00" arrival="2017-07-28" departure="2017-07-31" status="CancelBooking" acknowledge="0" room_id="2981145" room_type="Standard" channel_id="1" channel_name="Retail" rateplan_id="366833" rateplan_name="Room Only" room_count="2" adults="4" children="0" extrabeds="0" cxl_code="3D1N_1N">

<customer first_name="Test" last_name="Agoda" nationality="Thailand"/>

<requests>

<request request_name="NonSmoke"/>

<request request_name="TwinBeds"/>

<request request_name="AdditionalNotes:&quot;No need 4th floor"/>

<request request_name="Thank you&quot;"/>

</requests>

<payment card_type="MasterCard" card_number="5335102456789304" card_name="Agoda Company Pte Ltd." card_exp="01/2018" card_cvv="250"/>

<prices currency="HKD" net_inclusive_amt="0.0">

<price date="" net_inclusive_amt="0.0" refsell_amt="0.0" type="Cancellation"/>

</prices>

</booking>

<booking property_id="99" property_name="Test Hotel" booking_id="217393581" booking_date="2017-07-09T14:50:00+07:00" last_action="2017-07-09T23:21:19+07:00" arrival="2017-07-28" departure="2017-07-31" status="CancelBooking" acknowledge="0" room_id="2981145" room_type="Standard" channel_id="1" channel_name="Retail" rateplan_id="366833" rateplan_name="Room Only" room_count="2" adults="4" children="0" extrabeds="0" cxl_code="3D1N_1N">

<customer first_name="Test" last_name="Testtt" nationality="Thailand"/>

<requests>

<request request_name="NonSmoke"/>

<request request_name="TwinBeds"/>

<request request_name="AdditionalNotes:&quot;No need 4th floor"/>

<request request_name="Thank you&quot;"/>

</requests>

<payment card_type="MasterCard" card_number="5335102001234567" card_name="Agoda Company Pte Ltd." card_exp="01/2018" card_cvv="250"/>

<prices currency="HKD" net_inclusive_amt="0.0">

<price date=""type="Cancellation"/>

</prices>

</booking>

</bookings>

</result>

3.1 GetBookingDetails Response - Property Collect

<result timestamp="1501649348742">

<bookings count="1" iataid="96637800">

<booking property_id="567792" property_name="PCLN Hotel Test - Do Not Book" booking_id="220952733"

booking_date="2017-08-02T11:24:00+07:00" last_action="2017-08-02T11:48:49+07:00" arrival="2017-08-16"

departure="2017-08-17" status="CancelBooking" acknowledge="0" room_id="8179856" room_type="Standard - 2

persons" channel_id="1" channel_name="Retail" rateplan_id="937982" rateplan_name="Room Only111"

promotion_id="141776369" promotion_name="Limited time offer. Rate includes 20% discount!" room_count="1"

adults="2" children="0" extrabeds="0" cxl_code="1D1N_1N">

<customer first_name="agoda" last_name="test" nationality="Thailand"/>

<requests>

<request request_name="NonSmoke"/>

<request request_name="AdditionalNotes:&quot;**Late arrival 23:00**&quot;"/>

</requests>

<prices currency="USD" sell_inclusive_amt="0.0">

<price date="" sell_inclusive_amt="0.0" refsell_amt="0.0" type="Cancellation"/>

</prices>

<paymentmodel>2</paymentmodel>

</booking>

</bookings>

</result>

4. GetBookingDetails Schema

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:simpleType name="endpointtype">

<xs:restriction base="xs:int">

<xs:enumeration value="4"/>

</xs:restriction>

</xs:simpleType>

<xs:element name="request" type="requestType"/>

<xs:complexType name="propertyType">

<xs:sequence>

<xs:element type="bookingType" name="booking" minOccurs="1" maxOccurs="unbounded"/>

</xs:sequence>

<xs:attribute type="idType" name="id" use="required"/>

</xs:complexType>

<xs:complexType name="requestType">

<xs:sequence>

<xs:element type="criteriaType" name="criteria" minOccurs="1" maxOccurs="1"/>

</xs:sequence>

<xs:attribute type="xs:long" name="timestamp"/>

<xs:attribute type="endpointtype" name="type"/>

</xs:complexType>

<xs:complexType name="bookingType">

<xs:simpleContent>

<xs:extension base="xs:string">

<xs:attribute type="xs:long" name="id" use="required"/>

</xs:extension>

</xs:simpleContent>

</xs:complexType>

<xs:complexType name="criteriaType">

<xs:sequence>

<xs:element type="propertyType" name="property" minOccurs="1" maxOccurs="unbounded"/>

</xs:sequence>

<xs:attribute type="languageType" name="language" use="optional"/>

</xs:complexType>

<xs:simpleType name="languageType">

<xs:restriction base="xs:string">

<xs:length fixed="true" value="2"/>

<xs:pattern value="[a-zA-Z]{2}"/>

</xs:restriction>

</xs:simpleType>

<xs:simpleType name="idType">

<xs:restriction base="xs:unsignedLong">

<xs:maxInclusive value="2147483647"/>

</xs:restriction>

</xs:simpleType>

</xs:schema>