OTA_HotelBookingRuleRQ / OTA_HotelBookingRuleRS
The OTA_BookingRuleRQ messages are used to read booking rules/restrictions in the Hotel-Spider system, for the four levels :
- Booking rules at Hotel level
- Booking rules at Room level
- Booking rules at RatePlan level
- Booking rules at SellableProduct level
Endpoints
- HTTP RAW POST
- SOAP
- JSON (We recommend using OTA via XML, if you want to use JSON interface please contact us)
Example request and response
Requesting booking rules at Hotel level :
<OTA_HotelBookingRuleRQ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opentravel.org/OTA/2003/05" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelBookingRuleRQ.xsd" TimeStamp="2012-10-05T14:20:50" Target="Test" Version="1.005"> <POS> <Source> <RequestorID Type="5" ID="USERNAME" MessagePassword="PASSWORD"></RequestorID> </Source> </POS> <RuleMessage HotelCode="HOTELCODE"> <StatusApplication Start="2017-04-01" End="2017-04-12" /> </RuleMessage> </OTA_HotelBookingRuleRQ>
Requesting booking rules at Room level :
<OTA_HotelBookingRuleRQ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opentravel.org/OTA/2003/05" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelBookingRuleRQ.xsd" TimeStamp="2012-10-05T14:20:50" Target="Test" Version="1.005"> <POS> <Source> <RequestorID Type="5" ID="USERNAME" MessagePassword="PASSWORD"></RequestorID> </Source> </POS> <RuleMessage HotelCode="HOTELCODE"> <StatusApplication Start="2017-04-01" End="2017-04-12" InvCode="ROOMID" /> </RuleMessage> </OTA_HotelBookingRuleRQ>
Requesting booking rules at RatePlan level :
<OTA_HotelBookingRuleRQ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opentravel.org/OTA/2003/05" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelBookingRuleRQ.xsd" TimeStamp="2012-10-05T14:20:50" Target="Test" Version="1.005"> <POS> <Source> <RequestorID Type="5" ID="USERNAME" MessagePassword="PASSWORD"></RequestorID> </Source> </POS> <RuleMessage HotelCode="HOTELCODE"> <StatusApplication Start="2017-04-01" End="2017-04-12" RatePlanCode="RATEPLANID" /> </RuleMessage> </OTA_HotelBookingRuleRQ>
Requesting booking rules at SellableProduct level :
<OTA_HotelBookingRuleRQ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opentravel.org/OTA/2003/05" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelBookingRuleRQ.xsd" TimeStamp="2012-10-05T14:20:50" Target="Test" Version="1.005"> <POS> <Source> <RequestorID Type="5" ID="USERNAME" MessagePassword="PASSWORD"></RequestorID> </Source> </POS> <RuleMessage HotelCode="HOTELCODE"> <StatusApplication Start="2017-04-01" End="2017-04-12" InvCode="ROOMID" RatePlanCode="RATEPLANID" /> </RuleMessage> </OTA_HotelBookingRuleRQ>
Request structure
OTA_HotelBookingRuleRQ
Parent: None (Root element)
Mandatory: yes
Attributes:
Name | Mandatory | Description |
---|---|---|
TimeStamp | Yes | The format should respect the ISO 8601 2015-11-16T22:23:48+00:00 |
Target | Yes | When sending updates to the staging environment "Test" must be used. When sending updates to the production environment "Production" must be used. |
Version | Yes | The default value should be "1.000" |
Child elements: POS (when using POS authentication. See Authentication methods for more information), AvailStatusMessages
RuleMessage
Parent: OTA_BookingRuleNotifRQ
Mandatory: yes
Attributes:
Name | Mandatory | Description |
---|---|---|
HotelCode | Yes |
Children: StatusApplicationControl
StatusApplicationControl
Parent: RuleMessage
Mandatory: yes
Attributes:
Name | Mandatory | Description |
---|---|---|
Start | Yes | The format should respect the ISO 8601 2015-11-16 |
End | Yes | The format should respect the ISO 8601 2015-11-17 The End date is inclusive meaning that it will also be retrieved. |
InvCode/InvTypeCode/RoomID | No | The Hotel-Spider room ID By default our system will search for the InvCode attribute. Should you have been using InvTypeCode in a previous development (for example: OTA version of the Booking.com interface ), we can configure our interface to ignore InvCode and work with InvTypeCode. The same goes for the RoomID attribute. |
RatePlanCode/RatePlanType/RatePlanID | No | The Hotel-Spider rate ID By default our system will search for the RatePlanCode atttribute. Should you have been using RatePlanType in a previous development, we can configure our interface to ignore RatePlanCode and work with RatePlanType. The same goes for the RatePlanID attribute. |
Determining which level to update
- No InvCode nor RatePlanCode: return the list of booking rules applied at the hotel level
- InvCode is given but no RatePlanCode: return the list of booking rules applied at the room level
- RatePlanCode is given but no InvCode: return the list of booking rules applied at the rate plan level
- InvCode and RatePlanCode are given: return the list of booking rules applied at the product level
Response structure
<?xml version="1.0" encoding="UTF-8"?> <OTA_HotelBookingRuleRS xmlns="http://www.opentravel.org/OTA/2003/05" TimeStamp="2017-03-24T16:39:05+01:00" CorrelationID="00Q58d53d99269fe" Version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelBookingRuleRS.xsd"> <RuleMessage HotelCode="HOTELCODE"> <StatusApplication Start="2017-04-01" End="2017-04-12" InvTypeCode="ROOMID"> <BookingRules> <BookingRule Start="2017-04-01" End="2017-04-02"> <RestrictionStatus Restriction="Master" Status="Close"> <RestrictionStatus Restriction="Arrival" Status="Open"> <RestrictionStatus Restriction="Departure" Status="Open"> <LengthsOfStay ArrivalDateBased="0"> <LengthOfStay MinMaxMessageType="MinLOS" Time="1"> <LengthOfStay MinMaxMessageType="MaxLOS" Time="0"> </LengthsOfStay> <LengthsOfStay ArrivalDateBased="1"> <LengthOfStay MinMaxMessageType="MinLOS" Time="1"> <LengthOfStay MinMaxMessageType="MaxLOS" Time="0"> </LengthsOfStay> <TPA_Extensions> <BookingChannels> <BookingChannel BookingChannelID="16" BookingChannelName="Reconline"> <Rules> <Rule Name="ReconlineCancel">0</Rule> </Rules> </BookingChannel> <BookingChannel BookingChannelID="3" BookingChannelName="Booking"> <Rules> <Rule Name="BookingMinimumContractedRooms">0</Rule> </Rules> </BookingChannel> <BookingChannel BookingChannelID="6" BookingChannelName="Expedia"> <Rules> <Rule Name="ExpediaBaseAllotment">-1</Rule> </Rules> </BookingChannel> </BookingChannels> </TPA_Extensions> </BookingRule> <BookingRule Start="2017-04-03" End="2017-04-12"> <RestrictionStatus Restriction="Master" Status="Open"> <RestrictionStatus Restriction="Arrival" Status="Open"> <RestrictionStatus Restriction="Departure" Status="Open"> <LengthsOfStay> <LengthOfStay MinMaxMessageType="ForwardMinStay" Time="1"> <LengthOfStay MinMaxMessageType="ForwardMaxStay" Time="0"> <LengthOfStay MinMaxMessageType="MinLOS" Time="1"> <LengthOfStay MinMaxMessageType="MaxLOS" Time="0"> <LengthOfStay MinMaxMessageType="FixedLOS" Time="0"> </LengthsOfStay> <TPA_Extensions> <BookingChannels> <BookingChannel BookingChannelID="16" BookingChannelName="Reconline"> <Rules> <Rule Name="ReconlineCancel">0</Rule> </Rules> </BookingChannel> <BookingChannel BookingChannelID="3" BookingChannelName="Booking"> <Rules> <Rule Name="BookingMinimumContractedRooms">0</Rule> </Rules> </BookingChannel> <BookingChannel BookingChannelID="6" BookingChannelName="Expedia"> <Rules> <Rule Name="ExpediaBaseAllotment">-1</Rule> </Rules> </BookingChannel> </BookingChannels> </TPA_Extensions> </BookingRule> </BookingRules> </RuleMessage> <Success></Success> </OTA_HotelBookingRuleRS>
OTA_HotelBookingRuleRS
Parent: None (Root element)
Mandatory: yes
Attributes:
Name | Mandatory | Description |
---|---|---|
TimeStamp | Yes | The format will respect the ISO 8601 2015-11-16T22:23:48+00:00 |
Target | Yes | The same value, used in the request, will be returned. |
Version | Yes | The value wil be "1.000" |
Child elements: Success, Warnings and Errors
Success
Parent: OTA Response root element
Mandatory: No
Attributes: None
Child elements: None
Warnings
Parent: OTA Response root element
Mandatory: No
Attributes: None
Child elements: None
Warning
Parent: Warnings
Mandatory: yes (If Warnings is provided)
Attributes:
Name | Mandatory | Description |
---|---|---|
Type | Yes | OTA EWT type code |
Code | Yes | OTA ERR error code |
Status | Yes | Possible values: NotProcessed | Incomplete | Complete | Unknown |
ShortText | Yes | Textual explanation of the error. |
Child elements: None
Errors
Parent: OTA Response root element
Mandatory: No
Attributes: None
Child elements: Error
Error
Parent: Error
Mandatory: yes (If Errors is provided)
Attributes:
Name | Mandatory | Description |
---|---|---|
Type | Yes | OTA EWT type code |
Code | Yes | OTA ERR error code |
Status | Yes | Possible values: NotProcessed | Incomplete | Complete | Unknown |
ShortText | Yes | Textual explanation of the error. |
Child elements: None
RuleMessage
Parent: OTA_HotelBookingRuleNotifRS
Mandatory: yes
Multiple : no
Attributes:
Name | Mandatory | Description |
---|---|---|
HotelCode | Yes |
Children: BookingRules, StatusApplicationControl
StatusApplicationControl
Parent: RuleMessage
Mandatory: yes
Multiple : no
Attributes:
Name | Mandatory | Description |
---|---|---|
Start | Yes | The format should respect the ISO 8601 2015-11-16 |
End | Yes | The format should respect the ISO 8601 2015-11-17 The End date is inclusive meaning that it will also be updated. |
InvCode/InvTypeCode/RoomID | No | The Hotel-Spider room ID |
RatePlanCode/RatePlanType/RatePlanID | No | The Hotel-Spider rate ID |
BookingRules
Parent: RuleMessage
Mandatory: yes
Multiple : no
Children: BookingRule
BookingRule
Parent: BookingRules
Mandatory: yes
Multiple : yes
Attributes:
Name | Mandatory | Description |
---|---|---|
Start | Yes | The format should respect the ISO 8601 2015-11-16 |
End | Yes | The format should respect the ISO 8601 2015-11-17 The End date is inclusive. |
InvCode/InvTypeCode/RoomID | No | The Hotel-Spider room ID |
RatePlanCode/RatePlanType/RatePlanID | No | The Hotel-Spider rate ID |
Children: RestrictionStatus, LenghtsOfStay, TPA_Extensions
LengthsOfStay
Parent: BookingRule
Multiple : Yes
Mandatory: No
Attributes:
Name | Mandatory | Description |
---|---|---|
ArrivalDateBased | No | Can be set to 0 or 1. If this boolean value is set to 1, the restriction set has an effect only on the arrival day of a booking, whereas the '0' value may affect a search for availability or reservation on all the dates that the query covers. When left out, '0' is assumed. |
Child elements: LengthOfStay
LengthOfStay
Parent: LengthsOfStay
Multiple : Yes
Mandatory: yes (If LengthsOfStay is provided)
Attributes:
Name | Mandatory | Description |
---|---|---|
Time | Yes | The integer value that will determine which Minimum Length Of Stay or which Maximum Length Of Stay will be applied. "1"is the default value for a MinLOS or a ForwardMinStay. This is equal to transmitting "RemoveMinLOS" or "RemoveForwardMinStay". "0" is the default value for a MaxLOS or a ForwardMaxStay. This is equal to transmitting "RemoveMaxLOS" or "RemoveForwardMaxStay". |
MinMaxMessageType | Yes | Possible values are:
|
Children: None
RestrictionStatus
Parent: BookingRule
Mandatory: No
Multiple : Yes
Attributes:
Name | Mandatory | Description |
---|---|---|
Status | Yes | Possible values are "Open" or "Close". |
Restriction | No | Possible values are "Master", "Arrival" or "Departure" When set to "Master", depending on the value of the Status attribute AND the level identification via the StatusApplicationControl element, this will either open/close on Hotel level, on room level, on rate plan level or on product level. When set to "Arrival", depending on the value of the Status attribute AND the level identification via the StatusApplicationControl element, this will either prevent (Status="Close") or allow (Status="Open") a guest to book with this date as arrival. When set to "Departure", depending on the value of the Status attribute AND the level identification via the StatusApplicationControl element, this will either prevent (Status="Close") or allow (Status="Open") a guest to book with this date as departure. |
Children: None
TPA_Extensions
Describe the booking rules applied to connected channels
Parent: BookingRule
Mandatory: No
Attributes: None
Children: BookingChannels
BookingChannels
Parent: TPA_Extension
Mandatory: No
Attributes: None
Children: BookingChannel
BookingChannel
Parent: BookingChannels
Multiple : Yes
Mandatory: No
Attributes:
Name | Mandatory | Description |
---|---|---|
BookingChannelID | Yes | Hotel-Spider channel ID |
BookingChannelName | Yes | Channel name |
Children: BookingChannel
Rules
Parent: BookingChannel
Mandatory: No
Attributes: None
Children: Rule
Rule
Parent: Rules
Mandatory: No
Attributes:
Name | Mandatory | Description |
---|---|---|
Name | Yes | Specific booking rule name |
Node value:
Mandatory | Description |
---|---|
Yes | the value of the specific booking rules |
Children: none