OTA_HotelBookingRuleNotifRQ
You can update availability restrictions for a single hotel per one request message. However, you can update multiple booking rules within one message. We recommend to update one hotel and one room per request.
Basic Structure
The basic structure of the message is as per below:
Booking Rule Notification - Relative
<OTA_HotelBookingRuleNotifRQ xmlns="http://www.opentravel.org/OTA/2003/05" Target="Production" Version="1.006" PrimaryLangID="en" TimeStamp="2016-09-09T13:20:01.000+07:00">
<RuleMessages BrandCode="MER" ChainCode="MER" HotelCode="YIPPY">
<RuleMessage UniqueID="123456789">
<StatusApplicationControl Start="2016-10-01" End="2016-10-05" InvTypeCode="YR001" RatePlanCode="AAA" />
<BookingRules>
<BookingRule AbsoluteCutoff="2016-10-01">
</BookingRule>
</BookingRules>
</RuleMessage>
<RuleMessage UniqueID="123456789">
<StatusApplicationControl Start="2016-10-02" End="2016-10-04" InvTypeCode="YR001" RatePlanCode="BBB" />
<BookingRules>
<BookingRule MinAdvancedBookingOffset="P11D">
</BookingRule>
</BookingRules>
</RuleMessage>
</RuleMessages>
</OTA_HotelBookingRuleNotifRQ>
The OTA_HotelAvailNotifRQ message contains:
- One RuleMessages element which define the hotel to update (@HotelCode attribute).
- Multiple RuleMessages/RuleMessage elements which define the transaction id (@UniqueID) used to communicate back to the sender.
- Each RuleMessage element will contain a single StatusApplicationControl element. This element is used to specify the room type, rate plan code and date range for which the update applies. The dates affected by the update are controlled by the mandatory @Start and @End attributes.
How to set booking rules
The rules will be identified in BookingRules element which must appear once in each StatusApplicationControl element. The BookingRules element contains a collection of booking rules which apply to the specific room type and rate code indicated by StatusApplicationControl. Each BookingRules element has one or more BookingRule elements.
Each BookingRule can represent an absolute or relative date for the booking restriction. Please see the example of the settings below.
Booking Restriction | How it will be sent |
|---|---|
| Fixed deadline for when a booking must be made | <BookingRule AbsoluteCutoff="2016-10-01" /> |
The first date that the booking can be made | <BookingRule AbsoluteDropTime = "2016-10-01" /> |
| Minimum number of days before arrival for which this rate plan can be booked. | <BookingRule MinAdvancedBookingOffset = "P11D" /> |
| Maximum number of days before arrival for which this rate plan can be booked. | <BookingRule MaxAdvancedBookingOffset = "P3D" /> |
OTA_HotelBookingRuleNotifRQ Specification
Element | Number | Type | Description |
|---|---|---|---|
OTA_HotelBookingRuleNotifRQ | 1 | Root node | |
@TimeStamp | 1 | DateTime | Time of the transaction |
@Version | 1 | Decimal | Current version is 1.0 |
| @Target | 1 | String | Target which can be either Production or Sandbox |
| @PrimaryLangID | 1 | String | Language ID, now only support English (en) |
| @EchoToken | 1 | String | Globally unique identifier for the request. We suggest to use epoch time that the request was sent to Agoda. This should be reflected as an EchoToken in the response. |
OTA_HotelBookingRuleNotifRQ / RuleMessages | 1 | Contains the booking rule messages | |
@HotelCode | 1 | String | The code for the property whose availability is being updated |
| @BrandCode | 1 | String | Code for the brand |
| @ChainCode | 1 | String | Code for the hotel chain |
RuleMessages / RuleMessage | 1..n | Contains the booking rule messages. There can be multiple of these nodes per request | |
@UniqueID | 0..1 | Integer | Use as message identifier, normally use to communicate back to the sender |
RuleMessage / StatusApplicationControl | 1 | Contains date and room identification information | |
@Start | 1 | Date | The start date for which the availability update is being set. This date is inclusive. |
@End | 1 | Date | The end date for which the availability update is being set. This date is inclusive. |
@RatePlanCode | 1 | String | Identifies the rate. The RatePlanCode is used in conjunction with the InvTypeCode to identify the room to update. |
@InvTypeCode | 1 | String | Identifies the room. The InvTypeCode is used in conjunction with the RatePlanCode to identify the room to update. |
StatusApplicationControl / | 0..1 | Set booking rules. At least one of @AbsoluteCutoff or @AbsoluteDropTime or @MinAdvancedBookingOffset or @MaxAdvancedBookingOffset must be specified. | |
@AbsoluteCutoff | 0..1 | String | Fixed deadline for when a booking can be made |
@AbsoluteDropTime | 0..1 | String | The first date that the booking can be made |
| @MinAdvancedBookingOffset | 0..1 | String | Minimum number of days before arrival for which this rate plan can be booked. |
| @MaxAdvancedBookingOffset | 0..1 | String | Maximum number of days before arrival for which this rate plan can be booked. |
Example of the OTA_HotelBookingRuleNotifRQ messages
Relative Booking Rules Example
For stays between 2016-08-01 and 2016-12-31, users must book a minimum of 3 days in advance and a maximum of 365 days in advance to get this room/rate plan. i.e. if today is 2016-09-08 and I want to book a room for 2016-10-02, I will get this room/rate plan. However if I want to book a room for 2016-09-10 or 2017-01-05, this room/rate plan will not be available.
Relative Booking Example
<OTA_HotelBookingRuleNotifRQ xmlns="http://www.opentravel.org/OTA/2003/05" Target="Production" Version="1.006" PrimaryLangID="en" TimeStamp="2016-08-10T11:57:01.000+02:00">
<RuleMessages BrandCode="MER" ChainCode="MER" HotelCode="YIPPY">
<RuleMessage UniqueID="123456789">
<StatusApplicationControl Start="2016-08-01" End="2016-12-31" InvTypeCode="YR001" RatePlanCode="AAA" />
<BookingRules>
<BookingRule MinAdvancedBookingOffset="P3D" MaxAdvancedBookingOffset="P365D">
</BookingRule>
</BookingRules>
</RuleMessage>
</RuleMessages>
</OTA_HotelBookingRuleNotifRQ>
Absolute Booking Rules Example
For stays between 2016-11-01 and 2017-03-31, users must book between 2016-09-01 and 2016-10-05 in order to get this room/rate plan.
Absolute Booking Example
<OTA_HotelBookingRuleNotifRQ xmlns="http://www.opentravel.org/OTA/2003/05" Target="Production" Version="1.006" PrimaryLangID="en" TimeStamp="2016-08-10T11:57:01.000+02:00">
<RuleMessages BrandCode="MER" ChainCode="MER" HotelCode="YIPPY">
<RuleMessage UniqueID="123456789">
<StatusApplicationControl Start="2016-11-01" End="2017-03-31" InvTypeCode="YR001" RatePlanCode="AAA" />
<BookingRules>
<BookingRule AbsoluteDropTime="2016-09-01" AbsoluteCutoff="2016-10-05" >
</BookingRule>
</BookingRules>
</RuleMessage>
</RuleMessages>
</OTA_HotelBookingRuleNotifRQ>
