Product Management
SetProduct
GetProduct
Elements and Attributes (Data Type)
> Get Product Request
> Get Product Response
> Set Product Request
> Set Product Response
SetProduct
Request URL: https://supply.agoda.com/api?apiKey=ADDYOURAPIKEYHERE
SetProduct Intro
This call allow partners to update room setting (such as Maximum number of person per room, minimum rate threshold of the room) and rateplan restriction (such as minimum and maximum night of stay, minimum and maximum days purchase in advance).
Room Level
- any value set at Room Level affects Price parameters for SetARI call. SetProduct minrate = ‘100’, SetARI ‘prices’ default, single, double &/or full Rate must be > 100 SetProduct numpersons = ‘3’, SetARI ‘prices’ default or single, double & full Rate is Mandatory * SetProduct num_persons = ‘2’, SetARI ‘prices’ default or single & double Rate is Mandatory
Rate Plan Level
- all items in this section will apply the restriction to existing cached ARI at Rate Plan level for all dates. However, min_los & max_los can also be set via SetARI at date level and will override cached restrictions for the specified room, Rate Plan and date only.
Example Senerios
- Update # 1.
SetProduct min_los = ‘2’ this will apply minLOS ‘2’ restrictions to all dates for room, rates & dates associated with the specified rate plan.
- Update # 2.
SetARI min = ‘3’ for a specific room ID, Rate Plan ID & date. This will change minLOS to ‘3’ only for the specific room, Rateplan & date only until it is override by a subsequent minLOS update via SetARI or SetProduct.
Example Request
curl --location 'https://supply.agoda.com/api?apiKey=ADDYOURAPIKEYHERE' \
--header 'Content-Type: text/xml' \
--data '<?xml version="1.0" encoding="UTF-8"?>
<request timestamp="1436931804" type="8">
<criteria property_id="10730279" currency="THB">
<rooms>
<room room_id="129340033" num_persons="3" min_rate="100.0"/>
</rooms>
<rateplans>
<rateplan rateplan_id="3392615" min_los="1" max_los="1" min_adv_days="1" max_adv_days="1"/>
<rateplan rateplan_id="3392615" min_los="1" max_los="1"/>
<rateplan rateplan_id="3392615" min_adv_days="1" max_adv_days="1"/>
</rateplans>
</criteria>
</request>'Example Response
<result timestamp="1587536688255">
<success/>
</result>GetProduct
Request URL: https://supply.agoda.com/api?apiKey=ADDYOURAPIKEYHERE
GetProduct Intro
This function allows the Connectivity Partners to retrieve the dynamic content for a specific property.
Example Request
curl --location 'https://supply.agoda.com/api?apiKey=ADDYOURAPIKEYHERE' \
--header 'Content-Type: text/xml' \
--data '<?xml version="1.0" encoding="UTF-8"?>
<request type="5" timestamp="1462966882336">
<!-- 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. -->
<criteria language="EN">
<property id="10730279">
<rooms>
</rooms>
<rateplans>
</rateplans>
</property>
</criteria>
</request>'Example Response
<result timestamp="1587536921195">
<property id="10730279" name="BKK Connectivity Test Hotel 11 - DO NOT BOOK" currency="THB" language="EN" live_status="1" occupancy_model="Full Rate">
<rooms>
<room room_id="129340033" room_name="Standard Doubles" num_rooms="10" num_persons="3" num_children="2" total_persons="3" num_extrabed="0" num_baby_cots="1" min_rate="100.0" max_rate="100000.0"/>
</rooms>
<rateplans>
<rateplan rateplan_id="3392615" rateplan_name="My Rate" master_rate="0" sell_start="2019-11-18T00:00:00" sell_end="9999-12-31T00:00:00" stay_start="2019-11-18" stay_end="9999-12-31" tax_included="1" rate_type="NET" min_adv_days="1" max_adv_days="1" min_los="1" max_los="1" cxl_code="1D1N_1N" offertype_id="22" offertype_name="Room Only">
<benefits>
</benefits>
</rateplan>
</rateplans>
<products>
<product room_id="129340033" rateplan_id="3392615"/>
</products>
<channels>
<channel channel_id="1" channel_name="Retail"/>
<channel channel_id="2" channel_name="Private Sale"/>
</channels>
</property>
</result>Elements and Attributes (Data Type)
Get Product Request
| Element / Attribute | Data Type | Occurs | Required | Examples | Description |
|---|---|---|---|---|---|
| Request Timestamp | Numeric | 1 | Y | 1483526410357 (GMT: Wed, 04 Jan 2017 10:40:10.357) | A timestamp is a sequence of characters or encoded information identifying when a certain event occurred. Time provided must correspond with the time in the originating system and in EPOCH. System requires EPOCH timestamps in milliseconds. |
| Type | Numeric Length 1 | 1 | Y | 5 | This number identifies a particular request: 1 SetAri 2 GetAri 3 GetBookingList 4 GetBookingDetail 5 GetProduct 8 SetProduct 9 GetBookingListV2 |
| Criteria Language | Alpha Lentgh 2 | 1 | Y | EN | Language in which the response will be returned. Language should be a valid language supported by Agoda. Refer to language list for languages available for use. |
| Property Id | String Length 1-20 | 1 | Y | 123 | Every request must contain a valid property ID that partner has access to |
| Room_id | Numeric Length 1-20 | 1 | N | 85236 | This is the Agoda room ID related to the property inventory element. Agoda active Room IDs can be returned with Getproduct request. If no room is specified in the request, all active Rooms will be returned in the response. |
| Rateplan_id | Numeric Length 1-6 | 1 | N | 24468 | This is the Agoda Rateplan ID related to a particular offer active on a room. Agoda active Rate Type IDs can be returned with Getproduct request. If no Rateplan ID is specified in the request, all active Rateplans will be returned in the response. |
Get Product Response
| Element / Attribute | Data Type | Occurs | Required | Examples | Description |
|---|---|---|---|---|---|
| Result Timestamp | Numeric | 1 | Y | 1454628391 (2016-02-04T23:26:31Z) | A timestamp is a sequence of characters or encoded information identifying when a certain event occurred. Time provided will correspond with the time in the originating system and in EPOCH. System requires EPOCH timestamps in milliseconds. |
| Property Id | String Length 1-20 | 1 | Y | 123 | Every request must contain a valid property ID that partner has access to |
| Property Name | Alpha | Y | Sunshine Garden Resort | ||
| Property Id | String Length 1-20 | 1 | Y | 123 | Every request must contain a valid property ID that partner has access to |
| Currency | Alpha 3 | 1 | Y | THB | |
| Language | Alpha Length 2 | 1 | Y | EN | Language in which the response will be returned. Refer to language list for languages available for use. |
| Live_status | Numeric 0-1 | 1 | Y | 1 = active 0 = inactive | |
| Occupancy_model | Alpha | 1 | Y | Full Rate | In the 'Full Occupancy’ model there is single, double and full occupancy pricing – plus extra bed pricing based on room settings. |
| Rooms Room_id | Numeric Length 1-20 | unbounded | Y | 72027 | This is the Agoda room ID related to the property inventory element. Agoda active Room IDs can be returned with Getproduct request. If no room is specified in the request, all active Rooms will be returned in the response. |
| Room_name | Alpha | unbounded | Y | Deluxe | |
| num_rooms | Numeric Length 1-3 | 1 | Y | 52 | Total number of rooms for this room type set in Agoda extranet |
| num_persons | Numeric Length 1-2 | 1 | Y | Maximum number of persons that can be accommodated in the room using existing room bedding. | |
| num_children | Numeric Length 1 | 1 | Y | Maximum number of children that can be accommodated in this room. This number is part of the total max occupancy number | |
| total_persons | Numeric Length 1-2 | 1 | Y | Maximum number of persons that can be accommodated in the room using existing room bedding and extra bed. Includes both adults and children. | |
| num_extrabed | Numeric Length 1 | 1 | Y | Maximum number of extra beds that accommodated in room. Each bed allows for 1 extra person. | |
| num_baby_cots | Numeric Length 1 | 1 | Y | Maximum number of baby cots that accommodated in room. | |
| min_rate | Numeric Length 1-9 | 1 | Y | Minimum price for this room. | |
| max_rate | Numeric Length 1-9 | 1 | Y | Maximum price for this room. | |
| rack_rate | Numeric Length 1-9 | 1 | Y | Rack rate for this room. | |
| Rateplans rateplan_id | Numeric Length 1-6 | unbounded | Y | 1 to 6 | This is the Agoda Rateplan ID related to a particular offer active on a room. Agoda active Rate Type IDs can be returned with Getproduct request. If no Rateplan ID is specified in the request, all active Rateplans will be returned in the response. |
| rateplan_name | Alpha | unbounded | Y | Breakfast | |
| master_rate | Numeric Length 0-6 | unbounded | Y | 0 to 6 | If the Master rate=0 this is the master rate on which other rates can be based for discount. If the Master Rate is not =0, this is a child rate and it cannot be updated via Channel Manager. The Child Rate must derive the rate from the Master, the rate can be increased/decreased by amount/percentage from the Master Rate. |
| sell_start | Date YYYY-MM-DDTHH:MM:SS | unbounded | Y | The inclusive start date to sell this rate. | |
| sell_end | Date YYYY-MM-DDTHH:MM:SS | unbounded | Y | The inclusive end date to sell this rate. | |
| stay_start | Date YYYY-MM-DD | unbounded | N | The inclusive start date to stay for this rate. | |
| stay_end | Date YYYY-MM-DD | unbounded | N | The inclusive end date to stay for this rate. | |
| tax_included | Numeric Length 1 | unbounded | Y | "0"= exc "1"= inc | Tax settings information: the tax can be excluded (0) or included (1). |
| rate_type | Alpha | unbounded | Y | Net Sell | If the rate type is Sell, it includes all commissions. If the rate type is Net, it excludes all commissions. |
| min_adv_days | Numeric Length 1-2 | 1 | N | Minimum Days in advance that rate must be booked to be eligible for a specific rateplan. This attribute is returned in the response if min_adv_days is set at Rate Plan level. | |
| max_adv_days | Numeric Length 1-2 | 1 | N | Maximum Days in advance that rate must be booked to be eligible for a specific rateplan. This attribute is returned in the response if max_adv_days is set at Rate Plan level. | |
| min_los | Numeric length 1-2 | 1 | N | Minimum length of stay that is required to search and book this room type. This attribute is returned in the response if min_los is set at Rate Plan level. | |
| max_los | Numeric length 1-2 | 1 | N | 5 | Maximum length of stay that is required to search and book this room type. This attribute is returned in the response if max_los is set at Rate Plan level. |
| cxl_code | String | 1 | Y | Each Agoda cancellation policy has a unique ID. This ID relates to this Agoda cancel policy. All cancellation policies contain 3 policy elements. Polices are set in order and policy 3 is always no-show policy and will list days as 0. The Policies value relates to a value or percentage | |
| offertype_id | Numeric Length 1-6 | Y | It defines the type of offer active for a specific Rateplan. | ||
| offertype_name | Alpha | Y | Breakfast | ||
| benefit_id | Numeric Length 1 | 1 to 9 | Y | 5 | Denotes of all benefits to customer for a Rate Plan. Refer to benefits list for the full list of benefits available. |
| benefit_name | Alpha | 1 to 9 | Y | Lunch | Refer to benefits list for the full list of benefits available. |
| products product room_id | Numeric Length 1-20 | unbounded | Y | 72027 | This is the Agoda room ID related to the property inventory element. Agoda active Room IDs can be returned with Getproduct request. If no room is specified in the request, all active Rooms will be returned in the response. |
| rateplan_id | Numeric Length 1-6 | unbounded | Y | 1 to 6 | This is the Agoda Rateplan ID related to a particular offer active on a room. Agoda active Rateplan type IDs can be returned with Getproduct request. If no Rateplan ID is specified in the request, all active Rateplans will be returned in the response. |
| channels channel channel_id | Numeric Length 1 | 1 | Y | 1 | Channel represents product distribution channel. Channel in YCS5 is replacing the Rateplan in YCS4. Channles are aimed to expand or limit customer type and usually will have price discount or sale limitations: 1 Retail 2 Agoda Private Sale 6 Domestic 7 Mobile 8 Agoda Opaque 9 China |
| channel_name | Alpha | 1 | Y | Retail |
Set Product Request
| Element / Attribute | Data Type | Occurs | Required | Examples | Description |
|---|---|---|---|---|---|
| Request Timestamp | Numeric | 1 | Y | 1454628391 (2017-02-04T23:26:31Z) | A timestamp is a sequence of characters or encoded information identifying when a certain event occurred. Time provided must correspond with the time in the originating system and in EPOCH. System requires EPOCH timestamps in milliseconds. |
| Type | Numeric Length 1 | 1 | Y | 8 | This number identifies a particular request: 1 SetAri 2 GetAri 3 GetBookingList 4 GetBookingDetail 5 GetProduct 8 SetProduct 9 GetBookingListV2 |
| Criteria Property Id | String Length 1-20 | 1 | Y | 123 | Every request must contain a valid agoda property ID. Every property has a unique ID in Agoda and partner must first be authorised by agoda to have access to the property ID. |
| currency | Alpha 3 | 1 | N | THB | Currency is optional attribute but it will be mandadatory if partner would like to set minimum rate in the request. |
| Room Update room_id | Numeric Length 1-20 | unbounded | Y | 72027 | This is the Agoda room ID related to the property inventory element. Agoda active Room IDs can be returned with Getproduct request. If no room is specified in the request, all active Rooms will be returned in the response. |
| num_persons | Numeric Length 1-2 | unbounded | N | 1-30 | Maximum number of persons that can be accommodated in the room using existing bedding. |
| min_rate | Numeric Length 1-9 | unbounded | N | 200.0 | Minimum price for this room. Any value set for specified Room_id will restrict rate value set in SetAri call |
| Rateplan Update rateplan_id | Numeric Length 1-6 | unbounded | Y | 1 to 6 | This is the Agoda Rateplan ID related to a particular offer active on a room. Agoda active Rate Type IDs can be returned with Getproduct request. If no Rateplan ID is specified in the request, all active Rateplans will be returned in the response. |
| min_los | Numeric length 1-2 | unbounded | N | 1 to 99 | Minimum length of stay that is required to search and book this room type. MinLOS cannot be greater than maxLOS. To remove minLOS restriction, default value = ‘1’. |
| max_los | Numeric length 1-2 | unbounded | N | 0 to 99 | Minimum length of stay that is required to search and book this room type. MaxLOS cannot be less than minLOS. To remove maxLOS restriction, default value = ‘0’. |
| min_adv_days | Numeric length 1-2 | unbounded | N | 0 to 90 | Minimum Days in advance that rate must be booked to be eligible for a specific rateplan. To remove MinAdv restriction, default value = ‘0’. |
| max_adv_days | Numeric length 1-2 | unbounded | N | -1 to 90 | Maximum Days in advance that rate must be booked to be eligible for a specific rateplan. To remove MinAdv restriction, default value = ‘-1’. Note: ‘0’ restricts the sale of rate plan to be same day as check in date. |
Set Product Response
| Element / Attribute | Data Type | Occurs | Required | Examples | Description |
|---|---|---|---|---|---|
| Result Timestamp | Numeric | 1 | Y | 1454628391 (2017-02-04T23:26:31Z) | A timestamp is a sequence of characters or encoded information identifying when a certain event occurred. Time provided will correspond with the time in the originating system and in EPOCH. System requires EPOCH timestamps in milliseconds. |
| success | 1 | N | This tag is returned when set product success without error. | ||
| Property id | String Length 1-20 | 1 | Y | 123 | Every request must contain a valid property ID that partner has access to. Every property has a unique ID in Agoda and every Channel Manager partner has to have the access to this specific property via an authorized API key. |
| Error code | Numeric Length 4 | unbounded | N | Refer to Error List | Agoda’s error code. Refer to Error List |
| Error description | String | unbounded | N | Refer to Error List | Agoda’s error message. Refer to Error List |
Updated 13 days ago
