1. Overview
The Promotion API allows Channel Managers to
-
Create new promotion
-
Update existing promotion
-
Activate or Deactivate promotion (Toggle)
-
Retrieve promotion
1.1. Version information
Version : 1.0.0
1.2. URI scheme
Host : content-push.agoda.com
BasePath : /
Schemes : HTTPS, HTTP
1.3. Tags
-
ErrorCodes
-
Promotion
-
PromotionRetrieve
-
PromotionToggle
2. Change logs
Release Date | Version | Change logs |
---|---|---|
2020-10-30 |
1.0.0 |
Promotion API will now allow you to create and modify promotions for Agoda. Following features are available in this version
|
3. Security
3.1. apiKey
Type : apiKey
Name : apiKey
In : HEADER
4. Paths
4.1. Create/Update Promotion
POST /cm/promotion
4.1.1. Description
This section outlines the feature to create and update a promotion. All promotion types share many common elements and attributes. Promotion types EarlyBird, ExpressTonight, FreeNights, and LastNight each has unique elements that are specified in the “5. Definitions” section below.
4.1.2. Body parameter
HotelPromotion_RQ must be supplied.
Name : body
Flags : required
Type : HotelPromotion_RQ
4.1.3. Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
The promotion has been created/updated successfully |
No Content |
400 |
The request content was malformed |
No Content |
401 |
The supplier was unauthorized |
No Content |
4.1.4. Consumes
-
application/xml
4.1.5. Produces
-
application/xml
4.1.6. Tags
-
Promotion
4.1.7. Security
Type | Name |
---|---|
apiKey |
4.1.8. Example HTTP request
Request path
/cm/promotion
Request for create Customized promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="Customized" PromotionName="Customized Promotion example" PromotionExternalId="CTM001" HotelId="203103755"/>
<SaleDateRange Start="2021-01-01" End="2021-03-05"/>
<StayDateRange Start="2021-02-01" End="2021-06-05"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-03-15" End="2021-03-30"/>
<DateRange Start="2021-06-01" End="2021-06-03"/>
</BlackoutDateRange>
<LengthOfStay Min="1" Max="7"/>
<BookOn>
<Day>Sunday</Day>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<PercentPerNight NightType="SpecificDOW">
<Value>25.0</Value>
<Value>15.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>10.0</Value>
</PercentPerNight>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="3371504"/>
</RatePlans>
<Rooms>
<Room Id="1201489087"/>
</Rooms>
</HotelPromotion_RQ>
Request for create EarlyBird promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="EarlyBird" PromotionName="EarlyBird Promotion - New Year 2022" PromotionExternalId="EBNY2021" HotelId="203103755"/>
<EarlyBird MinAdvPurchase="5"/>
<SaleDateRange Start="2021-01-01" End="2021-06-05"/>
<StayDateRange Start="2021-12-01" End="2022-01-05"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-12-31" End="2022-01-01"/>
<DateRange Start="2021-12-25" End="2021-12-26"/>
</BlackoutDateRange>
<LengthOfStay Min="1" Max="7"/>
<BookOn>
<Day>Sunday</Day>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<AmountPerNight NightType="SpecificNight">
<Value>100.0</Value>
<Value>110.0</Value>
<Value>120.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>115.0</Value>
</AmountPerNight>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="3371503"/>
</RatePlans>
<Rooms>
<Room Id="1201489087"/>
</Rooms>
</HotelPromotion_RQ>
Request for create ExpressTonight promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="ExpressTonight" PromotionName="ExpressTonight Promotion" PromotionExternalId="EXPRESS001" HotelId="203103755"/>
<SaleDateRange Start="2020-11-19" End="2020-11-20"/>
<StayDateRange Start="2020-11-19" End="2020-11-21"/>
<MinNoOfRooms>2</MinNoOfRooms>
<LengthOfStay Min="1" Max="3"/>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<ExpressTonight Value="3000.0" ChannelDiscount="true"/>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="0"/>
</RatePlans>
<Rooms>
<Room Id="0"/>
</Rooms>
</HotelPromotion_RQ>
Request for create LastMinute promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="LastMinute" PromotionName="LastMinute Promotion" PromotionExternalId="LMN001" HotelId="203103755"/>
<LastMinute MaxAdvPurchase="2"/>
<SaleDateRange Start="2021-01-01" End="2021-03-05"/>
<StayDateRange Start="2021-02-01" End="2021-06-05"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-03-15" End="2021-03-30"/>
<DateRange Start="2021-06-01" End="2021-06-03"/>
</BlackoutDateRange>
<LengthOfStay Min="1" Max="7"/>
<BookOn>
<Day>Sunday</Day>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<AmountPerBooking Value="1500.0"/>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="0"/>
</RatePlans>
<Rooms>
<Room Id="0"/>
</Rooms>
</HotelPromotion_RQ>
Request for create LongStay promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="LongStay" PromotionName="LongStay Promotion" PromotionExternalId="LONG001" HotelId="203103755"/>
<SaleDateRange Start="2021-01-01" End="2021-03-05"/>
<StayDateRange Start="2021-02-01" End="2021-06-05"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-03-15" End="2021-03-30"/>
<DateRange Start="2021-06-01" End="2021-06-03"/>
</BlackoutDateRange>
<LengthOfStay Min="3" Max="7"/>
<BookOn>
<Day>Sunday</Day>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<FreeNights Value="2" IsRecurring="false"/>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="0"/>
</RatePlans>
<Rooms>
<Room Id="0"/>
</Rooms>
</HotelPromotion_RQ>
Request for create SeventyTwoHours promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="SeventyTwoHours" PromotionName="SeventyTwoHours Promotion" PromotionExternalId="72HRS001" HotelId="203103755"/>
<SaleDateRange Start="2021-01-01" End="2021-03-05"/>
<StayDateRange Start="2021-02-01" End="2021-06-05"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-03-15" End="2021-03-30"/>
<DateRange Start="2021-06-01" End="2021-06-03"/>
</BlackoutDateRange>
<LengthOfStay Min="1" Max="7"/>
<BookOn>
<Day>Sunday</Day>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<AmountPerBooking Value="400.0"/>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="0"/>
</RatePlans>
<Rooms>
<Room Id="0"/>
</Rooms>
</HotelPromotion_RQ>
Request for create SpecialOffer promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="SpecialOffer" PromotionName="SpecialOffer Promotion" PromotionExternalId="SPO001" HotelId="203103755"/>
<SaleDateRange Start="2021-01-01" End="2021-03-05"/>
<StayDateRange Start="2021-02-01" End="2021-06-05"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-03-15" End="2021-03-30"/>
<DateRange Start="2021-06-01" End="2021-06-03"/>
</BlackoutDateRange>
<LengthOfStay Min="1" Max="7"/>
<BookOn>
<Day>Sunday</Day>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<AmountPerBooking Value="4500.0"/>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="0"/>
</RatePlans>
<Rooms>
<Room Id="0"/>
</Rooms>
</HotelPromotion_RQ>
Request for update Customized promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="Customized" PromotionName="Customized Promotion example update" PromotionId="75023474" HotelId="203103755"/>
<SaleDateRange Start="2021-01-01" End="2021-03-05"/>
<StayDateRange Start="2021-02-01" End="2021-06-05"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-03-15" End="2021-03-30"/>
<DateRange Start="2021-06-01" End="2021-06-03"/>
</BlackoutDateRange>
<LengthOfStay Min="1" Max="7"/>
<BookOn>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<PercentPerNight NightType="SpecificDOW">
<Value>25.0</Value>
<Value>15.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>10.0</Value>
</PercentPerNight>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="0"/>
</RatePlans>
<Rooms>
<Room Id="0"/>
</Rooms>
</HotelPromotion_RQ>
Request for update EarlyBird promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="EarlyBird" PromotionName="EarlyBird Promotion - New Year 2022 update" PromotionId="75023475" HotelId="203103755"/>
<EarlyBird MinAdvPurchase="5"/>
<SaleDateRange Start="2021-01-01" End="2021-03-01"/>
<StayDateRange Start="2021-12-01" End="2022-01-05"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-12-31" End="2022-01-01"/>
<DateRange Start="2021-12-25" End="2021-12-26"/>
</BlackoutDateRange>
<LengthOfStay Min="1" Max="7"/>
<BookOn>
<Day>Sunday</Day>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<AmountPerNight NightType="SpecificNight">
<Value>100.0</Value>
<Value>110.0</Value>
<Value>120.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>115.0</Value>
</AmountPerNight>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="3371503"/>
</RatePlans>
<Rooms>
<Room Id="1201489087"/>
</Rooms>
</HotelPromotion_RQ>
Request for update ExpressTonight promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="ExpressTonight" PromotionName="ExpressTonight Promotion update" PromotionId="75023484" HotelId="203103755"/>
<SaleDateRange Start="2020-11-19" End="2020-11-20"/>
<StayDateRange Start="2020-11-19" End="2020-11-21"/>
<MinNoOfRooms>2</MinNoOfRooms>
<LengthOfStay Min="1" Max="3"/>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<ExpressTonight Value="3000.0" ChannelDiscount="true"/>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="0"/>
</RatePlans>
<Rooms>
<Room Id="0"/>
</Rooms>
</HotelPromotion_RQ>
Request for update LastMinute promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="LastMinute" PromotionName="LastMinute Promotion update" PromotionId="75023476" HotelId="203103755"/>
<LastMinute MaxAdvPurchase="2"/>
<SaleDateRange Start="2021-01-01" End="2021-03-05"/>
<StayDateRange Start="2021-02-01" End="2021-06-05"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-03-15" End="2021-03-30"/>
<DateRange Start="2021-06-01" End="2021-06-03"/>
</BlackoutDateRange>
<LengthOfStay Min="1" Max="5"/>
<BookOn>
<Day>Sunday</Day>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<AmountPerBooking Value="1500.0"/>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="0"/>
</RatePlans>
<Rooms>
<Room Id="0"/>
</Rooms>
</HotelPromotion_RQ>
Request for update LongStay promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="LongStay" PromotionName="LongStay Promotion update" PromotionId="75023478" HotelId="203103755"/>
<SaleDateRange Start="2021-01-01" End="2021-03-05"/>
<StayDateRange Start="2021-02-01" End="2021-06-05"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-03-15" End="2021-03-30"/>
<DateRange Start="2021-06-01" End="2021-06-03"/>
</BlackoutDateRange>
<LengthOfStay Min="3" Max="7"/>
<BookOn>
<Day>Sunday</Day>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<FreeNights Value="2" IsRecurring="false"/>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="0"/>
</RatePlans>
<Rooms>
<Room Id="0"/>
</Rooms>
</HotelPromotion_RQ>
Request for update SeventyTwoHours promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="SeventyTwoHours" PromotionName="SeventyTwoHours Promotion update" PromotionId="75023477" HotelId="203103755"/>
<SaleDateRange Start="2021-01-01" End="2021-03-05"/>
<StayDateRange Start="2021-02-01" End="2021-06-05"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-03-15" End="2021-03-30"/>
<DateRange Start="2021-06-01" End="2021-06-03"/>
</BlackoutDateRange>
<LengthOfStay Min="1" Max="7"/>
<BookOn>
<Day>Sunday</Day>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<AmountPerBooking Value="400.0"/>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="0"/>
</RatePlans>
<Rooms>
<Room Id="0"/>
</Rooms>
</HotelPromotion_RQ>
Request for update SpecialOffer promotion type
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RQ Timestamp="1605141841949">
<Promotion PromotionType="SpecialOffer" PromotionName="SpecialOffer Promotion update" PromotionId="75023485" HotelId="203103755"/>
<SaleDateRange Start="2021-01-01" End="2021-03-05"/>
<StayDateRange Start="2021-02-01" End="2021-06-05"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-03-15" End="2021-03-30"/>
<DateRange Start="2021-06-01" End="2021-06-03"/>
</BlackoutDateRange>
<LengthOfStay Min="1" Max="7"/>
<BookOn>
<Day>Sunday</Day>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime From="12:00" To="22:00"/>
<IsStackable>false</IsStackable>
<Discount>
<AmountPerBooking Value="4500.0"/>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="0"/>
</RatePlans>
<Rooms>
<Room Id="0"/>
</Rooms>
</HotelPromotion_RQ>
4.1.9. Example HTTP response
Response 200
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RS Tuid="000-000-0000" PromotionId=12345>
<Success/>
</HotelPromotion_RS>
Response 400
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RS>
<Errors>
<Error Code="321" ShortText="Required field missing" Status="NotProcessed"/>
</Errors>
</HotelPromotion_RS>
Response 401
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RS>
<Errors>
<Error Code="497" ShortText="Authorization error" Status="NotProcessed"/>
</Errors>
</HotelPromotion_RS>
4.2. Toggle Promotion
POST /cm/promotion/toggle
4.2.1. Description
This section outlines the feature to activate or deactivate a promotion.
4.2.2. Body parameter
HotelPromotionToggle_RQ must be supplied.
Name : body
Flags : required
Type : HotelPromotionToggle_RQ
4.2.3. Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
The promotion has been toggled successfully |
No Content |
204 |
The promotion has been toggled already |
No Content |
400 |
The request content was malformed |
No Content |
401 |
The supplier was unauthorized |
No Content |
4.2.4. Consumes
-
application/xml
4.2.5. Produces
-
application/xml
4.2.6. Tags
-
PromotionToggle
4.2.7. Security
Type | Name |
---|---|
apiKey |
4.2.8. Example HTTP request
Request path
/cm/promotion/toggle
Request body
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotionToggle_RQ HotelId="680674" IsActive="true" PromotionId="750566" Timestamp="1605243776"/>
4.2.9. Example HTTP response
Response 200
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RS Tuid="000-000-0000" PromotionId=12345>
<Success/>
</HotelPromotion_RS>
Response 204
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RS>
<Errors>
<Error Code="444" ShortText="The promotion has been toggled already" Status="NotProcessed"/>
</Errors>
</HotelPromotion_RS>
Response 400
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RS>
<Errors>
<Error Code="321" ShortText="Required field missing" Status="NotProcessed"/>
</Errors>
</HotelPromotion_RS>
Response 401
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotion_RS>
<Errors>
<Error Code="497" ShortText="Authorization error" Status="NotProcessed"/>
</Errors>
</HotelPromotion_RS>
4.3. Retrieve Promotions
POST /cm/promotion/retrieve
4.3.1. Description
This section outlines the feature to retrieve promotions. Note that only promotion types supported by this API will be returned. Promotion types not supported by this API but supported on the YCS Extranet will not be returned.
4.3.2. Body parameter
HotelPromotionGet_RQ must be supplied.
Name : body
Flags : required
Type : HotelPromotionGet_RQ
4.3.3. Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
The promotions have been retrieved successfully |
No Content |
400 |
The request content was malformed |
No Content |
401 |
The supplier was unauthorized |
No Content |
4.3.4. Consumes
-
application/xml
4.3.5. Produces
-
application/xml
4.3.6. Tags
-
PromotionRetrieve
4.3.7. Security
Type | Name |
---|---|
apiKey |
4.3.8. Example HTTP request
Request path
/cm/promotion/retrieve
Request body
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotionGet_RQ HotelId="680674" IsActive="true" PromotionId="750566" Timestamp="1605243776"/>
4.3.9. Example HTTP response
Response 200
<HotelPromotionGet_RS Tuid="f2512b30-2a53-11eb-9a46-e72138f17e12">
<HotelPromotion IsActive="true">
<Promotion PromotionType="Customized" PromotionName="Customized Promotion example"
PromotionId="75023474" HotelId="203103755"/>
<SaleDateRange Start="2021-01-01+07:00" End="2021-03-05+07:00"/>
<StayDateRange Start="2021-02-01+07:00" End="2021-06-05+07:00"/>
<MinNoOfRooms>2</MinNoOfRooms>
<BlackoutDateRange>
<DateRange Start="2021-03-15+07:00" End="2021-03-30+07:00"/>
<DateRange Start="2021-06-01+07:00" End="2021-06-03+07:00"/>
</BlackoutDateRange>
<LengthOfStay Min="1" Max="7"/>
<BookOn>
<Day>Tuesday</Day>
<Day>Thursday</Day>
<Day>Saturday</Day>
</BookOn>
<StayOn>
<Day>Monday</Day>
<Day>Wednesday</Day>
<Day>Friday</Day>
</StayOn>
<CheckinOn>
<Day>Wednesday</Day>
<Day>Thursday</Day>
<Day>Friday</Day>
<Day>Saturday</Day>
</CheckinOn>
<BookingTime To="22:00:00" From="12:00:00"/>
<IsStackable>false</IsStackable>
<Discount>
<PercentPerNight NightType="SpecificDOW">
<Value>25.0</Value>
<Value>15.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
</PercentPerNight>
</Discount>
<CancellationPolicy Id="963"/>
<Channels>
<Channel Id="1"/>
<Channel Id="7"/>
</Channels>
<CustomerSegments>
<CustomerSegment Id="0"/>
</CustomerSegments>
<RatePlans>
<RatePlan Id="3371504"/>
</RatePlans>
<Rooms>
<Room Id="1201489087"/>
</Rooms>
<PromotionPerformance Revenue="5000.0" NightsAvgPerBooking="3" Bookings="332"/>
</HotelPromotion>
</HotelPromotionGet_RS>
Response 400
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotionGet_RS>
<Errors>
<Error Code="321" ShortText="Required field missing" Status="NotProcessed"/>
</Errors>
</HotelPromotionGet_RS>
Response 401
<?xml version="1.0" encoding="UTF-8"?>
<HotelPromotionGet_RS>
<Errors>
<Error Code="497" ShortText="Authorization error" Status="NotProcessed"/>
</Errors>
</HotelPromotionGet_RS>
4.4. Get Error Codes
GET /cm/codes/promotion/error-codes
4.4.1. Description
Get list of all Promotion API error codes
4.4.2. Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
Success |
|
500 |
Internal server error |
4.4.3. Consumes
-
application/xml
4.4.4. Produces
-
application/xml
4.4.5. Tags
-
ErrorCodes
4.4.6. Example HTTP request
Request path
/cm/codes/promotion/error-codes
4.4.7. Example HTTP response
Response 200
<?xml version="1.0" encoding="UTF-8"?>
<ErrorCodes>
<ErrorCode Code="321" Description="Required field missing"/>
</ErrorCodes>
Response 500
<?xml version="1.0" encoding="UTF-8"?>
<ErrorResponse CorrelationID="8b417d6a-f3df-4d65-870c-240378b8ad3e" Endpoint="RoomAmenities">
<Errors>
<Error Code="321" ShortText="Required field missing" Status="NotProcessed"/>
</Errors>
<Warnings>
<Warning Code="123" ShortText="Please try again in a few minutes" Status="Incomplete"/>
</Warnings>
</ErrorResponse>
5. Definitions
5.1. AmountPerBooking
Name | Description | Schema |
---|---|---|
@Value |
Discount amount per booking value. (Between 0.0 - 99999999.0) |
number (double) |
5.2. AmountPerNight
Name | Description | Schema |
---|---|---|
@NightType |
Required one of night types as follows: EveryNight, SpecificNight, SpecificDOW, FirstNight, and LastNight. |
enum (EVERY_NIGHT, SPECIFIC_NIGHT, SPECIFIC_DOW, FIRST_NIGHT, LAST_NIGHT) |
Value |
List of discount amount per night value. (Between 0.0 - 99999999.0) |
< number (double) > array |
5.3. CancellationPolicy
Name | Description | Schema |
---|---|---|
@Id |
Cancellation policy ID See: Get a list of supported cancel policies |
integer (int32) |
5.4. ChannelType
Name | Description | Schema |
---|---|---|
@Id |
Channel ID See: Get list of supported channels |
integer (int64) |
5.5. Channels
Name | Description | Schema |
---|---|---|
Channel |
Channel of a promotion. This specifies that this channel is applicable to the promotion. |
< ChannelType > array |
5.6. CustomerSegmentType
Name | Description | Schema |
---|---|---|
@Id |
Customer Segment Group ID See: Get a list of supported Customer Segment Groups |
integer (int64) |
5.7. CustomerSegments
Name | Description | Schema |
---|---|---|
CustomerSegment |
Customer segment of a promotion. This specifies that this customer segment is applicable to the promotion. |
< CustomerSegmentType > array |
5.8. DateRange
Name | Description | Schema |
---|---|---|
DateRange |
This encloses one or more date ranges. |
< DateRangeMandatory > array |
5.9. DateRangeMandatory
Name | Description | Schema |
---|---|---|
@End |
End datetime. |
string (date-time) |
@Start |
Start datetime. |
string (date-time) |
5.10. DateRangeType
Name | Description | Schema |
---|---|---|
@End |
End datetime. If not passed, there will not be an end date. |
string (date-time) |
@Start |
Start datetime. |
string (date-time) |
5.11. DayType
Name | Description | Schema |
---|---|---|
Day |
Day of the week |
< string > array |
5.12. Discount
Name | Description | Schema |
---|---|---|
AmountPerBooking |
AmountPerBooking discount type. |
|
AmountPerNight |
AmountPerNight discount type. |
|
ExpressTonight |
ExpressTonight discount type. |
|
FreeNights |
FreeNights discount type. |
|
PercentPerNight |
PercentPerNight discount type. |
5.13. EarlyBird
Name | Description | Schema |
---|---|---|
@MinAdvPurchase |
Minimum advance purchase day. |
integer (int32) |
5.14. ErrorCode
Name | Description | Schema |
---|---|---|
@Code |
Code of an Agoda error message. |
integer (int32) |
@Description |
Description of an Agoda error message. |
string |
5.15. ErrorCodes
Name | Description | Schema |
---|---|---|
ErrorCode |
List of error codes |
< ErrorCode > array |
5.16. ErrorResponse
Name | Description | Schema |
---|---|---|
@CorrelationID |
Allows end-to-end correlation of log messages with the corresponding Web service message throughout the processing of the Web service message. |
string |
@Endpoint |
Endpoint name |
string |
Errors |
A collection of errors that occurred during the processing of a message. |
|
Warnings |
A collection of warnings that occurred during the processing of a message. |
5.17. ErrorType
Name | Description | Schema |
---|---|---|
@Code |
This refers to a table of coded values exchanged between applications to identify errors or warnings. Refer to OpenTravel Code List Error Codes (ERR). |
string |
@ShortText |
An abbreviated version of the error in textual format. |
string |
@Status |
Recommended values are those enumerated in the OTA_ErrorRS, (NotProcessed | Incomplete | Complete | Unknown) however, the data type is designated as string data, recognizing that trading partners may identify additional status conditions not included in the enumeration. |
string |
5.18. ErrorsType
Name | Description | Schema |
---|---|---|
Error |
An error that occurred during the processing of a message. |
< ErrorType > array |
5.19. ExpressTonight
Name | Description | Schema |
---|---|---|
@ChannelDiscount |
ChannelDiscount flag. |
boolean |
@Value |
Amount of ExpressTonight discount type value. (Between 0.0 - 99999999.0) |
number (double) |
5.20. FreeNights
Name | Description | Schema |
---|---|---|
@IsRecurring |
IsRecurring flag. |
boolean |
@Value |
Free nights value. |
integer (int32) |
5.21. HotelPromotion
Name | Description | Schema |
---|---|---|
@IsActive |
Active Status of a promotion. |
boolean |
BlackoutDateRange |
Blackout date ranges of a promotion. |
|
BookOn |
Book on days of week condition of a promotion. The day will be applicable if included. By default, every day of the week is applicable. |
|
BookingTime |
Booking time range condition of a promotion. |
|
CancellationPolicy |
Cancellation policy of a promotion. |
|
Channels |
Channels of a promotion. By default, the promotion will be applied to all channels. |
|
CheckinOn |
Check-in on days of week condition of a promotion. The day will be applicable if included. By default, every day of the week is applicable. |
|
CustomerSegments |
CustomerSegments of a promotion. By default, the promotion will be applied to all customer segments. |
|
Discount |
Discount detail of a promotion. (required one of discount type as follows: AmountPerBooking, AmountPerNight, PercentPerNight, FreeNights, and ExpressTonight) |
|
EarlyBird |
For EarlyBird promotion type only. |
|
IsStackable |
This specifies if this promotion can be combined with other active promotions. (e.g., if you have an existing active promotion of 20% and load this promotion for 10%, the total discount will be 30%). It will also combine with existing active stackable promotions. |
boolean |
LastMinute |
For LastMinute promotion type only. |
|
LengthOfStay |
Length of stay condition of a promotion. |
|
MinNoOfRooms |
Minimum number of rooms condition of a promotion. (between 1 - 5) |
integer (int32) |
Promotion |
Promotion of a hotel. |
|
PromotionPerformance |
Promotion’s Performance. |
|
RatePlans |
RatePlans of a promotion. By default, the promotion will be applied to all rate plans. |
|
RoomIds |
Rooms of a promotion. This specifies that the Agoda Rooms are applicable to the promotion. By default, the promotion will be applied to all rooms. |
|
SaleDateRange |
Range of promotion’s sale dates. |
|
StayDateRange |
Range of promotion’s stay dates. |
|
StayOn |
Stay on days of week condition of a promotion. The day will be applicable if included. By default, every day of the week is applicable. |
5.22. HotelPromotionGet_RQ
Name | Description | Schema |
---|---|---|
@HotelId |
Hotel ID of Promotions. |
integer (int32) |
@IsActive |
Active status of a promotion. |
boolean |
@PromotionId |
Promotion’s ID. |
integer (int64) |
@Timestamp |
Request unix timestamp |
integer (int64) |
5.23. HotelPromotionGet_RS
Name | Description | Schema |
---|---|---|
@Tuid |
TUID of a promotion. |
string |
Errors |
A collection of errors that occurred during the processing of a message. |
|
HotelPromotion |
Promotions of a hotel. |
< HotelPromotion > array |
Success |
Returning an empty element of this type indicates the successful processing of a message. |
5.24. HotelPromotionToggle_RQ
Name | Description | Schema |
---|---|---|
@HotelId |
Hotel ID of Promotions. |
integer (int32) |
@IsActive |
Active Status of a promotion. |
boolean |
@PromotionId |
Promotion’s ID. |
integer (int64) |
@Timestamp |
Request unix timestamp |
integer (int64) |
5.25. HotelPromotionToggle_RS
Name | Description | Schema |
---|---|---|
@PromotionId |
ID of toggled promotion. |
integer (int32) |
@Tuid |
TUID of toggled promotion. |
string |
Errors |
A collection of errors that occurred during the processing of a message. |
|
Success |
Returning an empty element of this type indicates the successful processing of a message. |
5.26. HotelPromotion_RQ
Name | Description | Schema |
---|---|---|
@Timestamp |
Request unix timestamp |
integer (int64) |
BlackoutDateRange |
Blackout date ranges of a promotion. |
|
BookOn |
Book on days of week condition of a promotion. The day will be applicable if included. By default, every day of the week is applicable. |
|
BookingTime |
Booking time range condition of a promotion. |
|
CancellationPolicy |
Cancellation policy of a promotion. |
|
Channels |
Channels of a promotion. By default, the promotion will be applied to all channels. |
|
CheckinOn |
Check-in on days of week condition of a promotion. The day will be applicable if included. By default, every day of the week is applicable. |
|
CustomerSegments |
CustomerSegments of a promotion. By default, the promotion will be applied to all customer segments. |
|
Discount |
Discount detail of a promotion. (required one of discount type as follows: AmountPerBooking, AmountPerNight, PercentPerNight, FreeNights, and ExpressTonight) |
|
EarlyBird |
Required for EarlyBird promotion type only. |
|
IsStackable |
This specifies if this promotion can be combined with other active promotions. (e.g., if you have an existing active promotion of 20% and load this promotion for 10%, the total discount will be 30%). It will also combine with existing active stackable promotions. (not applicable for Express Tonight Promotion) |
boolean |
LastMinute |
Required for LastMinute promotion type only. |
|
LengthOfStay |
Length of stay condition of a promotion. |
|
MinNoOfRooms |
Minimum number of rooms condition of a promotion. (between 1 - 5) |
integer (int32) |
Promotion |
Promotion of a hotel. |
|
RatePlans |
RatePlans of a promotion. By default, the promotion will be applied to all rate plans. |
|
RoomIds |
Rooms of a promotion. This specifies that the Agoda Rooms are applicable to the promotion. By default, the promotion will be applied to all rooms. |
|
SaleDateRange |
Range of promotion’s sale dates. |
|
StayDateRange |
Range of promotion’s stay dates. |
|
StayOn |
Stay on days of week condition of a promotion. The day will be applicable if included. By default, every day of the week is applicable. |
5.27. HotelPromotion_RS
Name | Description | Schema |
---|---|---|
@PromotionId |
ID of created/updated promotion. |
integer (int32) |
@Tuid |
TUID of created/updated promotion. |
string |
Errors |
A collection of errors that occurred during the processing of a message. |
|
Success |
Returning an empty element of this type indicates the successful processing of a message. |
5.28. LastMinute
Name | Description | Schema |
---|---|---|
@MaxAdvPurchase |
Maximum advance purchase day. |
integer (int32) |
5.29. PercentPerNight
Name | Description | Schema |
---|---|---|
@NightType |
Required one of night types as follows: EveryNight, SpecificNight, SpecificDOW, FirstNight, and LastNight. |
enum (EVERY_NIGHT, SPECIFIC_NIGHT, SPECIFIC_DOW, FIRST_NIGHT, LAST_NIGHT) |
Value |
List of percent per night value. (Between 0.0 - 90.0) |
< number (double) > array |
5.30. Promotion
Name | Description | Schema |
---|---|---|
@HotelId |
Hotel’s ID. |
integer (int32) |
@PromotionExternalId |
Promotion’s external ID. |
string |
@PromotionId |
Internal Agoda promotion’s ID. (required for update only) |
integer (int32) |
@PromotionName |
Promotion’s name. |
string |
@PromotionType |
Promotion’s type. (required one of promotion types as follows: Customized, EarlyBird, LastMinute, SeventyTwoHours, ExpressTonight, LongStay, and SpecialOffer) |
enum (CUSTOMIZED, EARLY_BIRD, LAST_MINUTE, SEVENTY_TWO_HOURS, EXPRESS_TONIGHT, LONG_STAY, SPECIAL_OFFER) |
5.31. PromotionPerformance
Name | Description | Schema |
---|---|---|
@Bookings |
Number of bookings via this promotion. |
integer (int32) |
@NightsAvgPerBooking |
Nights average per booking of this promotion. |
integer (int32) |
@Revenue |
Revenue of this promotion. |
number (double) |
5.32. RangeType
Name | Description | Schema |
---|---|---|
@Max |
Maximum value. |
integer (int32) |
@Min |
Minimum value. |
integer (int32) |
5.33. RatePlanType
Name | Description | Schema |
---|---|---|
@Id |
Rate Plan ID See: Get list of rate plans |
integer (int64) |
5.34. RatePlans
Name | Description | Schema |
---|---|---|
RatePlan |
Rate plan of a promotion. This specifies that this rate plan is applicable to the promotion. |
< RatePlanType > array |
5.35. RoomType
Name | Description | Schema |
---|---|---|
@Id |
Room ID See: Get list of rooms |
integer (int64) |
5.36. Rooms
Name | Description | Schema |
---|---|---|
Room |
Room of a promotion. This specifies that this room is applicable to the promotion. |
< RoomType > array |
5.37. SuccessType
Type : object
5.38. TimeRangeType
Name | Description | Schema |
---|---|---|
@From |
Time from. |
string |
@To |
Time to. |
string |
5.39. WarningType
Name | Description | Schema |
---|---|---|
@Code |
This refers to a table of coded values exchanged between applications to identify errors or warnings. Refer to OpenTravel Code List Error Codes (ERR). |
string |
@ShortText |
An abbreviated version of the warning in textual format. |
string |
@Status |
Recommended values are those enumerated in the OTA_ErrorRS, (NotProcessed | Incomplete | Complete | Unknown) however, the data type is designated as string data, recognizing that trading partners may identify additional status conditions not included in the enumeration. |
string |
5.40. WarningsType
Name | Description | Schema |
---|---|---|
Warning |
Optionally used to indicate that the recipient of the request message identified one or more business-level warnings. |
< WarningType > array |
6. FAQ
6.1. When updating a promotion and optional fields are not passed, will they get deleted?
All fields that not passed with request will assign with default value. Suggest to include all fields with request.
6.2. Are the date and time fields based on hotel time zone?
Yes.
6.3. How do we specify the discounts with different NightType ?
For SpecificNight, suggest to provide 7 values, starting with the discounted value for the first night till the seventh night. (if provide less than 7 values then the rest will fill with default value: 0.0 / provide more than 7 values is not allowed)
<AmountPerNight NightType="SpecificNight">
<Value>0.0</Value>
<Value>110.0</Value>
<Value>110.0</Value>
<Value>120.0</Value>
<Value>0.0</Value>
<Value>130.0</Value>
<Value>130.0</Value>
</AmountPerNight>
For SpecificDOW, suggest to provide 7 values, starting with the discounted percentage for Sunday till Saturday. (if provide less than 7 values then the rest will fill with default value: 0.0 / provide more than 7 values is not allowed)
<PercentPerNight NightType="SpecificDOW">
<Value>25.0</Value>
<Value>20.0</Value>
<Value>0.0</Value>
<Value>25.0</Value>
<Value>10.0</Value>
<Value>0.0</Value>
<Value>0.0</Value>
</PercentPerNight>
For EveryNight, suggest to provide only 1 value. (will ignore the rest if provide more than 1)
<AmountPerNight NightType="EveryNight">
<Value>110.0</Value>
</AmountPerNight>
For FirstNight, suggest to provide only 1 value. (will ignore the rest if provide more than 1)
<PercentPerNight NightType="FirstNight">
<Value>110.0</Value>
</PercentPerNight>
For LastNight, suggest to provide only 1 value. (will ignore the rest if provide more than 1)
<AmountPerNight NightType="LastNight">
<Value>110.0</Value>
</AmountPerNight>