OTA_HotelBookingRuleRQ
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_HotelBookingRuleRQ request (RQ) and response (RS) using the example of the test hotel. The data is always sent via POST request.
OTA_HotelBookingRuleRQ - 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_HotelBookingRuleRQ 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 AgentDutyCode="1" HotelCode="1234">
<RequestorID ID="1234" Name="TestHotel" MessagePassword="12swdedas"/>
</Source>
</POS>
<RuleMessage HotelCode="1234">
<StatusApplication Start="2024-05-17" End="2024-05-22" RatePlanCode="TEST-BAR-2N-MAI" RatePlanID="352547" InvTypeCode="16712"/>
<RuleCategories>
<RuleCategory Name="Arrival"/>
<RuleCategory Name="Departure"/>
<RuleCategory Name="Master"/>
<RuleCategory Name="MinLOS"/>
<RuleCategory Name="MaxLOS"/>
</RuleCategories>
</RuleMessage>
</RuleMessages>
</OTA_HotelBookingRuleRQ>
OTA_HotelBookingRuleRS - versions of the response
Normally a <Success/> is sent as a response or corresponding error messages (no warnings)
Example OTA_HotelBookingRuleRS Response - only one restriction requested
<?xml version="1.0" encoding="utf-8"?>
<OTA_HotelBookingRuleRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
EchoToken="aecb76dd4cea4ea9d72b4b3d17443139" PrimaryLangID="de"
TimeStamp="2024-07-11T13:00:01+02:00" Target="Production" Version="2.051">
<Success/>
<RuleMessage HotelCode="1234">
<StatusApplication RatePlanCode="KU-TEST" InvTypeCode="15815"/>
<BookingRules>
<BookingRule Start="2024-07-17" End="2024-07-22">
<RestrictionStatus Restriction="Master" Status="Open"/>
</BookingRule>
</BookingRules>
</RuleMessage>
</OTA_HotelBookingRuleRS>
Example OTA_HotelBookingRuleRS Response - all restrictions requested
For each restriction, a BookingRule line with period and value is output.
<OTA_HotelBookingRuleRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
EchoToken="5ac5c533f86a902a9b0016be8997c0cb" PrimaryLangID="de"
TimeStamp="2024-07-11T13:02:52+02:00" Target="Production" Version="2.051">
<Success/>
<RuleMessage HotelCode="2805">
<StatusApplication RatePlanCode="KU-TEST" InvTypeCode="15815"/>
<BookingRules>
<BookingRule Start="2024-07-17" End="2024-07-22">
<RestrictionStatus Restriction="Arrival" Status="Open"/>
</BookingRule>
<BookingRule Start="2024-07-17" End="2024-07-22">
<RestrictionStatus Restriction="Departure" Status="Open"/>
</BookingRule>
<BookingRule Start="2024-07-17" End="2024-07-22">
<RestrictionStatus Restriction="Master" Status="Open"/>
</BookingRule>
<BookingRule Start="2024-07-17" End="2024-07-22">
<RestrictionStatus Restriction="MinLOS" Status="Open"/>
</BookingRule>
<BookingRule Start="2024-07-17" End="2024-07-22">
<RestrictionStatus Restriction="MaxLOS" Status="Open"/>
</BookingRule>
</BookingRules>
</RuleMessage>
</OTA_HotelBookingRuleRS>
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_HotelBookingRuleRS response with error
Variant 1: in the context of the request with OTA_HotelBookingRuleRS response and <Errors>
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelBookingRuleRS 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_HotelBookingRuleRS>
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"/>