Product Retrieval
Contents
1. GetProduct 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).
GetProduct - Multiple endpoint
Sandbox: https://sandbox-distribution-xml.agoda.com/api/products/search?apiKey=xxx
Live: https://supply.agoda.com/api/products/search?apiKey=xxx
GetProduct - Single Endpoint (Please note: 'type=5' attribute is mandatory when using Single endpoint)
Sandbox: https://sandbox-distribution-xml.agoda.com/api?apiKey=xxx
(replace xxx with your API Key)
2. GetProduct RQ
<?xml version="1.0" encoding="UTF-8"?>
<request timestamp="1436931804" type="4">
<criteria language="EN" >
<property id="12123">
<rooms>
<room room_id="72027" />
<room room_id="3094762" />
<room room_id="4909303" />
</rooms>
<rateplans>
<rateplan rateplan_id="24200"/>
<rateplan rateplan_id="24202"/>
</rateplans>
</property>
</criteria>
</request>
<!--
Allow only 1 propery_id in request and it is the required attribute.
No limitation for number of room_id and rateplan_id.
If not specify room_id, all room_id of request property id will be returned.
If not specify rateplan_id, all rateplan_id of request property id will be returned.
language is optional.
-->
3. GetProduct Response
<result timestamp="1452216926802">
<errors>
<error code="3102" description="Room: 4909301 does not exist for Property id: 12123"/>
</errors>
<property id="12123" name="Sunshine Garden Resort" currency="THB" language="EN" live_status="1" occupancy_model="Full Rate">
<rooms>
<room room_id="72027" room_name="Deluxe" num_rooms="20" num_persons="2" num_children="2" total_persons="3" num_extrabed="1" num_baby_cots="1" min_rate="100.0" max_rate="500.0" rack_rate="200.0"/>
<room room_id="3094762" room_name="1 Bed King Suite with Sofa Bed" num_rooms="30" num_persons="3" num_children="2" total_persons="4" num_extrabed="1" num_baby_cots="0" min_rate="100.0" max_rate="5000.0" rack_rate="200.0"/>
</rooms>
<rateplans>
<rateplan rateplan_id="24200" rateplan_name="Hello - Child" master_rate="24197" sell_start="2016-01-06T00:00:00" sell_end="2099-12-31T23:59:00" stay_start="2016-01-06" stay_end="2099-12-31" tax_included="1" rate_type="NET" min_adv_days="0" min_los="1" cxl_code="1D1N_1N" offertype_id="9" offertype_name="Full Board">
<benefits>
<benefit benefit_id="6" benefit_name="Parking"/>
<benefit benefit_id="7" benefit_name="Massage"/>
</benefits>
</rateplan>
<rateplan rateplan_id="24202" rateplan_name="Room only" master_rate="0" sell_start="2016-01-06T00:00:00" sell_end="2099-12-31T23:59:00" stay_start="2016-01-06" stay_end="2099-12-31" tax_included="1" rate_type="NET" min_adv_days="0" min_los="1" cxl_code="1D1N_1N" offertype_id="9" offertype_name="Full Board">
<benefits>
</benefits>
</rateplan>
</rateplans>
<products>
<product room_id="72027" rateplan_id="24200"/>
<product room_id="72027" rateplan_id="24202"/>
<product room_id="3094762" rateplan_id="24200"/>
<product room_id="3094762" rateplan_id="24202"/>
</products>
<channels>
<channel channel_id="1" channel_name="Retail"/>
<channel channel_id="2" channel_name="Agoda Private Sale"/>
</channels>
</property>
</result>
<!--
In rooms section, we return only requested room.
In rateplans section, we return only requested rateplan.
In products section, we return all combination of room and rateplan. Status will be ‘1’ if room and rateplan are active and status will be ‘0’ if one of room or rateplan status is inactive.
-->
4. GetProduct Schema
<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="5"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="request">
<xs:complexType>
<xs:sequence>
<xs:element name="criteria">
<xs:complexType>
<xs:sequence>
<xs:element name="property" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="rooms" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="room" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="idType" name="room_id" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="rateplans" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="rateplan" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="idType" name="rateplan_id" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="idType" name="id" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="languageType" name="language"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:long" name="timestamp"/>
<xs:attribute type="endpointtype" name="type"/>
</xs:complexType>
</xs:element>
<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>
4.1 GetProduct Schema Response
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="result">
<xs:complexType>
<xs:sequence>
<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:element name="property" maxOccurs="1" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="rooms">
<xs:complexType>
<xs:sequence>
<xs:element name="room" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:unsignedLong" name="room_id"/>
<xs:attribute type="xs:string" name="room_name"/>
<xs:attribute type="xs:int" name="num_rooms"/>
<xs:attribute type="xs:int" name="num_persons"/>
<xs:attribute type="xs:int" name="num_children"/>
<xs:attribute type="xs:int" name="total_persons"/>
<xs:attribute type="xs:int" name="num_extrabed"/>
<xs:attribute type="xs:int" name="num_baby_cots"/>
<xs:attribute type="xs:decimal" name="min_rate"/>
<xs:attribute type="xs:decimal" name="max_rate"/>
<xs:attribute type="xs:decimal" name="rack_rate"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="rateplans">
<xs:complexType>
<xs:sequence>
<xs:element name="rateplan" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="benefits">
<xs:complexType>
<xs:sequence>
<xs:element name="benefit" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:int" name="benefit_id"/>
<xs:attribute type="xs:string" name="benefit_name"/>
<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:unsignedLong" name="rateplan_id"/>
<xs:attribute type="xs:string" name="rateplan_name"/>
<xs:attribute type="xs:unsignedLong" name="master_rate"/>
<xs:attribute type="xs:dateTime" name="sell_start"/>
<xs:attribute type="xs:dateTime" name="sell_end"/>
<xs:attribute type="xs:date" name="stay_start"/>
<xs:attribute type="xs:date" name="stay_end"/>
<xs:attribute type="xs:byte" name="tax_included"/>
<xs:attribute type="xs:string" name="rate_type"/>
<xs:attribute type="xs:int" name="min_adv_days"/>
<xs:attribute type="xs:int" name="max_adv_days"/>
<xs:attribute type="xs:int" name="min_los"/>
<xs:attribute type="xs:int" name="max_los"/>
<xs:attribute type="xs:string" name="cxl_code"/>
<xs:attribute type="xs:int" name="offertype_id"/>
<xs:attribute type="xs:string" name="offertype_name"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="products">
<xs:complexType>
<xs:sequence>
<xs:element name="product" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:unsignedLong" name="room_id"/>
<xs:attribute type="xs:unsignedLong" name="rateplan_id"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="channels">
<xs:complexType>
<xs:sequence>
<xs:element name="channel" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:unsignedLong" name="channel_id"/>
<xs:attribute type="xs:string" name="channel_name"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:unsignedLong" name="id"/>
<xs:attribute type="xs:string" name="name"/>
<xs:attribute type="xs:string" name="currency"/>
<xs:attribute type="xs:string" name="language"/>
<xs:attribute type="xs:byte" name="live_status"/>
<xs:attribute type="xs:string" name="occupancy_model"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:long" name="timestamp"/>
</xs:complexType>
</xs:element>
</xs:schema>