BookingHint 

(Push Notifications)

Contents

1. YCS5 API Push Booking Hint 

The YCS5 API Push Booking Hint allows partners to receive new, modified or cancelled reservation notifications in near real time, as Agoda customers make these bookings. This version of the Agoda API aims to improve the performance of the connectivity product Agoda offers. As this is a notification-based API, where Agoda initiates the notifications, partners interested in implementing this API need to contact Agoda to get started. In order to get started with this, please contact BD-Connectivity@agoda.com. 

2. BookingHint Delivery Process 

Agoda sends booking hint notification with booking status to channel manager endpoint when booking is created or its status is changed and channel manager have to return success or failure response to Agoda upon delivery of a notification. 

Booking hint will be pushed to channel manager every 1-2 minutes (based on Agoda server performance at the time). Channel manager will only get the latest booking status if original booking created and amended or cancelled within the 1-2 minutes schedule. There is retry process of 3 intervals 15 secs apart, to resend hint notification should channel manager endpoint experiencing technical issue. If the retry exceeded the setting, Agoda will send list of failed booking hint to channel manager designated email address and in case of failures, we recommend channel manger to trigger a getbookinglist request to retrieve reservation information.

 After bookinghint notification received by channel manager, Agoda expects partner to send getbookingdetail request to retrieve full reservation information 

3. Information included in a booking hint notification 

A bookinghint notification will contain:

4 . Elements and Attributes

5. BookingHint Request

<request timestamp="1491189437">

 <property id="226110">

 <bookings>

 <booking booking_id="6593078" booking_date="2017-03-03T14:50:31+07:00" last_action="2017-03-

  03T14:50:31+07:00" arrival="2017-03-15" departure="2017-03-16" status="ConfirmBooking" />

<booking booking_id="50147621" booking_date="2017-02-15T14:54:00+07:00" last_action="2017-03-

  03T14:50:32+07:00" arrival="2017-03-12" departure="2017-03-13" status="CancelBooking" />

 <booking booking_id="6594803" booking_date="2017-03-01T19:13:00+07:00" last_action="2017-03-

  03T14:50:33+07:00" arrival="2017-03-15" departure="2017-03-16" status="AmendBooking" />

 </bookings>

 </property>

 <property id="254865">

 <bookings>

 <booking booking_id="5263254" booking_date="2017-03-03T14:50:31+07:00" last_action="2017-03-

  03T14:50:31+07:00" arrival="2017-03-15" departure="2017-03-16" status="ConfirmBooking" />

 <booking booking_id="9856324" booking_date="2017-03-01T16:54:00+07:00" last_action="2017-03-

  03T14:50:34+07:00" arrival="2017-03-12" departure="2017-03-13" status="CancelBooking" />

 <booking booking_id="9854712" booking_date="2017-03-01T19:13:00+07:00" last_action="2017-03-

  03T14:50:33+07:00" arrival="2017-03-15" departure="2017-03-16" status="AmendBooking" />

 </bookings>

 </property>

 <property id="256341">

 <bookings>

 <booking booking_id="6587455" booking_date="2017-03-03T14:50:34+07:00" last_action="2017-03-

  03T14:50:34+07:00" arrival="2017-03-15" departure="2017-03-16" status="ConfirmBooking" />

 </bookings>

 </property>

</request>


6. BookingHint Request

6.1 Success Response

<result timestamp="1491189937">

 <success/>

</result> 

6.2 Fail Response

<result timestamp="1491189937">

 <errors>

 <error code="9001" description="Internal system error"/>

 </errors>

</result> 

7. Error Code Specification

8. BookingHint Schema

8.1 Request Schema

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"

xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:simpleType name="idType">

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

<xs:maxInclusive value="2147483647"/>

</xs:restriction>

</xs:simpleType>

<xs:element name="request">

<xs:complexType>

<xs:sequence>

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

<xs:complexType>

<xs:sequence>

<xs:element name="bookings">

<xs:complexType>

<xs:sequence>

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

<xs:complexType>

<xs:simpleContent>

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

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

<xs:attribute type="xs:dateTime" name="booking_date"/>

<xs:attribute type="xs:dateTime" name="last_action"/>

<xs:attribute type="xs:date" name="arrival"/>

<xs:attribute type="xs:date" name="departure"/>

<xs:attribute type="xs:string" name="status"/>

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:sequence>

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

</xs:complexType>

</xs:element>

</xs:sequence>

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

</xs:complexType>

</xs:element>

</xs:schema> 

8.2 Response Schema

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"

xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="result">

<xs:complexType>

<xs:sequence>

<xs:element type="xs:string" name="success" minOccurs="0" maxOccurs="1"/>

<xs:element name="errors" minOccurs="0" maxOccurs="1">

<xs:complexType>

<xs:sequence>

<xs:element name="error" minOccurs="1" maxOccurs="unbounded">

<xs:complexType>

<xs:simpleContent>

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

<xs:attribute type="xs:short" name="code"/>

<xs:attribute type="xs:string" name="description"/>

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:sequence>

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

</xs:complexType>

</xs:element>

</xs:schema>