Set Rates & Availability

(Full Rate)

Contents

1. SetAri V1 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).

SetAri - Multiple endpoint

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

(replace xxx with your API Key)

2. SetAri V1 Request

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

<request timestamp="1463370555" type="1">

<criteria property_id="10730279">

<inventory>

<update room_id="129340033">

<date_range from="2020-04-20" to="2020-04-21">

<dow>1</dow>

<dow>2</dow>

<dow>3</dow>

<dow>4</dow>

<dow>5</dow>

<dow>6</dow>

<dow>7</dow>

</date_range>

<allotment>1</allotment>

<restrictions>

<closed>false</closed>

<ctd>false</ctd>

<cta>true</cta>

</restrictions>

</update>

</inventory>

<rate>

<update room_id="129340033" rateplan_id="3392615">

<date_values>

<value>2020-04-21</value>

</date_values>

<prices currency="USD">

<occupancy default="500.0">

<single>380.0</single>

<double>480.0</double>

<full>80.0</full>

</occupancy>

<!-- If each occupancy rate does not set, default rate is required -->

<!--

<occupancy default="500.0">

</occupancy>

-->

<extra_bed>200.0</extra_bed>

</prices>

<restrictions>

<closed>false</closed>

<ctd>false</ctd>

<cta>true</cta>

<los>

<min>1</min>

<max>30</max>

</los>

</restrictions>

</update>

</rate>

</criteria>

</request>

3. Set Ari V1 Response

3.1 SetAriV1 Success Response

<result TUID="89f66310-6718-11e5-b298-0758c951ac41" timestamp="1443579079617"/>

3.2 SetAriV1 Invalid Hotel ID Response

<result TUID="f896e610-934a-11e5-b542-0758c951ac41" timestamp="1448438591217">

<errors>

<property id="1212121">

<error code="1301" description="Invalid Property id: 1212121"/>

</property>

</errors>

</result>

3.3 SetAriV1 Invalid Room Response

<result TUID="f8a516e0-934a-11e5-b542-0758c951ac41" timestamp="1448438591310">

<errors>

<property id="12123">

<error code="2205" description="Room: 71111 does not exist for Property id: 12123"/>

</property>

</errors>

</result>

3.4 SetAriV1 Invalid Setting Response

<result TUID="f855e570-934a-11e5-b542-0758c951ac41" timestamp="1448438590791">

<errors>

<property id="12123">

<error code="2201" description="Double rate: 600 should be between 100 and 500"/>

</property>

</errors>

</result>

4. SetAriV1 Schema

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

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

elementFormDefault="qualified">

<xs:simpleType name="dow">

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

<xs:minInclusive value="1"/>

<xs:maxInclusive value="7"/>

</xs:restriction>

</xs:simpleType>

<xs:simpleType name="allotment">

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

<xs:minInclusive value="0"/>

</xs:restriction>

</xs:simpleType>

<xs:simpleType name="currency">

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

<xs:minLength value="3"/>

<xs:maxLength value="3"/>

</xs:restriction>

</xs:simpleType>

<xs:simpleType name="endpointtype">

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

<xs:enumeration value="1"/>

</xs:restriction>

</xs:simpleType>

<xs:simpleType name="minstaythrough">

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

<xs:minInclusive value="0" />

<xs:maxInclusive value="30" />

</xs:restriction>

</xs:simpleType>

<xs:simpleType name="positive-decimal">

<xs:annotation>

<xs:documentation>The positive-decimal type specifies a positive decimal value with precision 2.

</xs:documentation>

</xs:annotation>

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

<xs:minExclusive value="0"/>

<xs:fractionDigits value="2"/>

</xs:restriction>

</xs:simpleType>

<xs:simpleType name="positive-decimal-with-zero">

<xs:annotation>

<xs:documentation>The positive-decimal type specifies a positive decimal value with precision 2.

</xs:documentation>

</xs:annotation>

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

<xs:minInclusive value="0"/>

<xs:fractionDigits value="2"/>

</xs:restriction>

</xs:simpleType>

<xs:simpleType name="idType">

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

<xs:maxInclusive value="2147483647"/>

</xs:restriction>

</xs:simpleType>

<xs:complexType name="inventory_restriction">

<xs:all>

<xs:element type="xs:boolean" name="closed" minOccurs="0" maxOccurs="1"/>

<xs:element type="xs:boolean" name="ctd" minOccurs="0" maxOccurs="1"/>

<xs:element type="xs:boolean" name="cta" minOccurs="0" maxOccurs="1"/>

</xs:all>

</xs:complexType>

<xs:complexType name="rate_restriction">

<xs:all>

<xs:element type="xs:boolean" name="closed" minOccurs="0" maxOccurs="1"/>

<xs:element type="xs:boolean" name="ctd" minOccurs="0" maxOccurs="1"/>

<xs:element type="xs:boolean" name="cta" minOccurs="0" maxOccurs="1"/>

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

<xs:complexType>

<xs:all>

<xs:element name="min" type="xs:positiveInteger" minOccurs="0" maxOccurs="1"/>

<xs:element name="max" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1"/>

</xs:all>

</xs:complexType>

</xs:element>

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

<xs:complexType>

<xs:all>

<xs:element name="min" type="minstaythrough" minOccurs="1" maxOccurs="1"/>

</xs:all>

</xs:complexType>

</xs:element>

</xs:all>

</xs:complexType>

<xs:complexType name="inventory">

<xs:sequence>

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

<xs:complexType>

<xs:sequence>

<xs:choice maxOccurs="1" minOccurs="1">

<xs:element ref="date_range" maxOccurs="1" minOccurs="1"/>

<xs:element ref="date_values" maxOccurs="30" minOccurs="1"/>

</xs:choice>

<xs:choice>

<xs:sequence>

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

<xs:element name="restrictions" type="inventory_restriction" minOccurs="0"

maxOccurs="1"/>

</xs:sequence>

<xs:sequence>

<xs:element name="restrictions" type="inventory_restriction" minOccurs="1"

maxOccurs="1"/>

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

</xs:sequence>

</xs:choice>

</xs:sequence>

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

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

<xs:complexType name="rate">

<xs:sequence>

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

<xs:complexType>

<xs:sequence>

<xs:choice maxOccurs="1" minOccurs="1">

<xs:element ref="date_range" maxOccurs="1" minOccurs="1"/>

<xs:element ref="date_values" maxOccurs="30" minOccurs="1"/>

</xs:choice>

<xs:choice>

<xs:sequence>

<xs:element ref="prices" minOccurs="1" maxOccurs="1"/>

<xs:element name="restrictions" type="rate_restriction" minOccurs="0" maxOccurs="1"/>

</xs:sequence>

<xs:sequence>

<xs:element name="restrictions" type="rate_restriction" minOccurs="1" maxOccurs="1"/>

<xs:element ref="prices" minOccurs="0" maxOccurs="1"/>

</xs:sequence>

</xs:choice>

</xs:sequence>

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

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

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

<xs:element name="prices">

<xs:complexType>

<xs:choice>

<xs:sequence>

<xs:element ref="occupancy" minOccurs="1" maxOccurs="1"/>

<xs:element type="positive-decimal-with-zero" name="extra_bed" maxOccurs="1" minOccurs="0"/>

</xs:sequence>

<xs:sequence>

<xs:element type="positive-decimal-with-zero" name="extra_bed" maxOccurs="1" minOccurs="1"/>

<xs:element ref="occupancy" minOccurs="0" maxOccurs="1"/>

</xs:sequence>

</xs:choice>

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

</xs:complexType>

</xs:element>

<xs:element name="occupancy">

<xs:complexType>

<xs:all>

<xs:element type="positive-decimal" name="single" minOccurs="0" maxOccurs="1"/>

<xs:element type="positive-decimal" name="double" minOccurs="0" maxOccurs="1"/>

<xs:element type="positive-decimal" name="full" minOccurs="0" maxOccurs="1"/>

</xs:all>

<xs:attribute type="positive-decimal" name="default"/>

</xs:complexType>

</xs:element>

<xs:element name="date_values">

<xs:complexType>

<xs:sequence>

<xs:element type="xs:date" name="value" maxOccurs="unbounded" minOccurs="1"/>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="date_range">

<xs:complexType>

<xs:sequence>

<xs:element type="dow" name="dow" maxOccurs="7" minOccurs="0"/>

</xs:sequence>

<xs:attribute type="xs:date" name="from" use="required"/>

<xs:attribute type="xs:date" name="to" use="required"/>

</xs:complexType>

</xs:element>

<xs:element name="request">

<xs:complexType>

<xs:sequence>

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

<xs:complexType>

<xs:choice>

<xs:sequence>

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

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

</xs:sequence>

<xs:sequence>

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

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

</xs:sequence>

</xs:choice>

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

</xs:complexType>

</xs:element>

</xs:sequence>

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

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

</xs:complexType>

</xs:element>

</xs:schema>




4.1 SetAriV1 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="property" minOccurs="1" maxOccurs="unbounded">

<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:int" name="code"/>

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

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

</xs:sequence>

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

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:sequence>

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

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

</xs:complexType>

</xs:element>

</xs:schema>