OTA_HotelBookingRuleNotifRQ
Method for reading restrictions/booking rules at room and offer level (RoomType/RatePlan combination) from Kurzurlaub.de.
See also Developer Guide - Restrictionen Push API
LengthOfStay - Minimum stays MinLOS / MaxLOS
We normally ignore LengthOfStay attributes, but can process them if necessary.
Since we work on the basis of offers that have a fixed duration, these values are primarily determined by the offer itself.
- LengthOfStay (normally called
SetMinLOSorSetMaxLOS) can optionally be sent asminimumStayormaximumStay
Restrictions Close, CTA, CTD
We use the attribute Restriction in the RestrictionStatus with Open / Close e.g.
- Master <RestrictionStatus Status="Close"/> oder <RestrictionStatus Status="Open"/>
- Close to arrival - CTA <RestrictionStatus Status="Close" Restriction="Arrival"/>
- Close to departure - CTD <RestrictionStatus Status="Close" Restriction="Departure"/>
We describe the OTA_HotelBookingRuleNotifRQ request (RQ) and response (RS) using the example of the test hotel. The data is always sent via POST request.
OTA_HotelBookingRuleNotifRQ - request via POST
Endpoint for POST request:
POST /ota/api/HotelBookingRule
Parameters used
Authentication and hotel parameters:
Source@AgentDutyCode- Agent-ID: 1Source@HotelCode- Hotel-ID: 1234
Parameters for availability:
An offer ID and room ID and a period (date from/to) in DateFormat as StatusApplication are expected
- StatusApplication@Start - Date (DateFormat YYYY-MM-DD)
- StatusApplication@End - Date (DateFormat YYYY-MM-DD)
- StatusApplication@InvTypeCode - Room-ID
- StatusApplication@RatePlanCode - Offer-ID
Parameters for restrictions:
RuleCategory@Name- Restrictions (Werte: Arrival, Departure, Master, MinLOS, MaxLOS)
Validation of incoming data
Validation of incoming parameters for date range (date from/to):
- a valid date period (
@Start-@End) - a valid date format (YYYY-MM-DD)
- not in the past
- not more than 2 years in advance
- not more than 3 months as a continuous period
Validation of other parameters
- Hotel ID valid and hotel is online / active
- Room ID valid and room is online / active
- Offer ID valid and offer is online / active
Note:
The data sent by the OTA partner is only accepted for rooms that are *active and online*, alternatively warnings are sent as a response.
Generally, rows with rules are considered individually, i.e. an error in the RoomTypeCode or in the date format, date range is only sent as a warning for that one row. All other rows are processed independently.
Example of request
Example OTA_HotelBookingRuleNotifRQ Request
<?xml version="1.0" encoding="utf-8"?>
<OTA_HotelBookingRuleNotifRQ Version="1.0" xmlns:ota="http://www.opentravel.org/OTA/2003/05"
TimeStamp="2023-10-25T16:34:23" Target="Production" PrimaryLangID="de">
<POS>
<Source AgentSine="13" AgentDutyCode="13" HotelCode="2099">
<RequestorID ID="8022" Name="8022" MessagePassword="hrgKed84hR3w"/>
</Source>
</POS>
<RuleMessages HotelCode="8022">
<RuleMessage>
<StatusApplicationControl InvTypeCode="12345" RatePlanCode="RATEPLAN1"/>
<BookingRules>
<BookingRule Start="2023-11-10" End="2023-11-14">
<LengthsOfStay>
<LengthOfStay MinMaxMessageType="SetMinLOS" Time="2" TimeUnit="Day"/>
</LengthsOfStay>
<RestrictionStatus Restriction="Arrival" Status="Open"/>
<RestrictionStatus Restriction="Departure" Status="Close"/>
<RestrictionStatus Restriction="Master" Status="Open"/>
</BookingRule>
</BookingRules>
</RuleMessage>
<RuleMessage>
<StatusApplicationControl InvTypeCode="12345" RatePlanCode="RATEPLAN1"/>
<BookingRules>
<BookingRule Start="2023-11-15" End="2023-11-15">
<LengthsOfStay>
<LengthOfStay MinMaxMessageType="SetMinLOS" Time="4" TimeUnit="Day"/>
</LengthsOfStay>
<RestrictionStatus Restriction="Arrival" Status="Open"/>
<RestrictionStatus Restriction="Departure" Status="Open"/>
<RestrictionStatus Restriction="Master" Status="Open"/>
</BookingRule>
</BookingRules>
</RuleMessage>
<RuleMessage>
<StatusApplicationControl InvTypeCode="12345" RatePlanCode="RATEPLAN1"/>
<BookingRules>
<BookingRule Start="2023-11-16" End="2023-11-16">
<RestrictionStatus Restriction="Master" Status="Close"/>
</BookingRule>
</BookingRules>
</RuleMessage>
<RuleMessage>
<StatusApplicationControl InvTypeCode="12345" RatePlanCode="RATEPLAN2"/>
<BookingRules>
<BookingRule Start="2023-11-16" End="2023-11-16">
<LengthsOfStay>
<LengthOfStay MinMaxMessageType="SetMinLOS" Time="1" TimeUnit="Day"/>
<LengthOfStay MinMaxMessageType="SetMaxLOS" Time="7" TimeUnit="Day"/>
</LengthsOfStay>
<RestrictionStatus Restriction="Arrival" Status="Open"/>
<RestrictionStatus Restriction="Departure" Status="Open"/>
<RestrictionStatus Restriction="Master" Status="Close"/>
</BookingRule>
</BookingRules>
</RuleMessage>
</RuleMessages>
</OTA_HotelBookingRuleNotifRQ>
OTA_HotelBookingRuleNotifRS - versions of the response
Normally a <Success/> is sent as a response or corresponding error messages (no warnings)
Example OTA_HotelBookingRuleNotifRS Response with Success
<?xml version="1.0" encoding="utf-8"?>
<OTA_HotelBookingRuleNotifRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
EchoToken="8ceec4d63c6e10ee4653ae836542184e" PrimaryLangID="de"
TimeStamp="2024-07-11T13:22:16+02:00" Target="Production" Version="2.050">
<Success/>
</OTA_HotelBookingRuleNotifRS>
Warnings
Example OTA_HotelBookingRuleRS response with warnings
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<OTA_HotelBookingRuleNotifRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
EchoToken="684cbda8918593e9868bcd9cfc456fe8" PrimaryLangID="de"
TimeStamp="2024-07-11T13:20:41+02:00" Target="Production" Version="2.050">
<Warnings>
<Warning Code="404" Type="1">Invalid start date (2024-02-15) is in past</Warning>
<Warning Code="448" Type="1">1 rule/s of 1 incoming RuleMessages ignored. See warnings before</Warning>
</Warnings>
</OTA_HotelBookingRuleNotifRS>
Warnings
No warnings are sent, all outputs, e.g. validation, are sent as errors
Error messages
If serious errors occur, e.g. in the authentication or validation of the data, these are sent in an OTA_ErrorRS
response with @ErrorCode and @ErrorMessage
Here is a list of common error messages when sending availability
| ErrorCode | ErrorMessage |
|---|---|
| 210 | HotelNotLinked - Hotel linked to another channel manager |
| 211 | HotelNotActivated - Hotel not found |
| 104 | InternalError - Empty HotelCode (HotelId) in accepted params (agentdutycode, hotelcode, ...) |
| 220 | RoomMappingError - Hotel does not have rooms created or configured |
| 221 | RoomMappingError - Hotel does not have rates created or configured |
| 230 | RoomMappingError - Invalid room code |
| 232 | RoomMappingError - Invalid rate code (bei Room/Rate Kombinationen) |
| 240 | DateRangeError - Invalid date range |
| 448 | DateRangeError - Invalid start date |
| 448 | InternalError - unknown internal error |
Example OTA_HotelBookingRuleNotifRS response with error
Variant 1: in the context of the request with OTA_HotelBookingRuleNotifRS response and <Errors>
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelBookingRuleNotifRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
EchoToken="eef8223c1e2468da575e2ce7d85eef9e" TimeStamp="2024-07-10T10:45:49+02:00"
Version="2.064">
<Errors>
<Error Code="448" Type="12">Invalid start date (2024-05-23) is in past</Error>
</Errors>
</OTA_HotelBookingRuleNotifRS>
Variant 2: Alternatively as OTA_ErrorRS response and attributes ErrorCode and ErrorMessage
<?xml version="1.0" encoding="UTF-8"?>
<OTA_ErrorRS xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
EchoToken="eef8223c1e2468da575e2ce7d85eef9e" PrimaryLangID="de" TimeStamp="2022-03-08T15:57:43+01:00"
Target="Production" Version="2.064"
ErrorCode="448"
ErrorMessage="Invalid start date (2024-05-23) is in past"/>