Zum Inhalt

OTA_HotelBookingRuleNotifRQ

Methode zum Lesen von Restriktionen/ Buchungsregeln auf Zimmer- und Angebotsebene (RoomType/RatePlan Kombination) von Kurzurlaub.de.

Siehe auch Entwicklerhandbuch - Restrictionen Push API

LengthOfStay - Mindestaufenthalte MinLOS / MaxLOS

Normalerweise ignorieren wir LengthOfStay-Attribute, können sie aber bei Bedarf verarbeiten. Da wir auf der Basis von Angebote arbeiten, welche eine feste Laufzeit haben, sind diese Werte vorrangig durch das Angebot selbst bestimmt.

  • LengthOfStay (normalerweise SetMinLOS oder SetMaxLOS genannt) kann optional als minimumStay oder maximumStay gesendet werden

Restriktionen Close, CTA, CTD

Wir verwenden das Attribut Restriction im RestrictionStatus mit Open / Close bspw.

  • 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"/>

Wir beschreiben den OTA_HotelBookingRuleNotifRQ Request (RQ) und Response (RS) am Beispiel des Testhotels. Das Senden der Daten erfolgt immer POST Request.

OTA_HotelBookingRuleNotifRQ - Anfrage per POST

Endpunkt für POST Request:

POST /ota/api/HotelBookingRuleNotif

Verwendete Parameter

Parameter für Authentifizierung und Hotel:

  • Source@AgentDutyCode - Agent-ID: 1
  • Source@HotelCode - Hotel-ID: 1234

Parameter für Verfügbarkeiten:

Erwartet wird eine Angebots-ID und Zimmer-ID und ein Zeitraum (Datum von/bis) im DateFormat als StatusApplication

  • StatusApplication@Start - Datum (DateFormat YYYY-MM-DD)
  • StatusApplication@End - Datum (DateFormat YYYY-MM-DD)
  • StatusApplication@InvTypeCode - Zimmer-ID
  • StatusApplication@RatePlanCode - Angebots-ID

Parameter für Restriktionen:

  • RuleCategory@Name - Restriktionen (Werte: Arrival, Departure, Master, MinLOS, MaxLOS)

Validierung eingehender Daten

Validierung der eingehenden Parameter für Datumsbereich (Datum von/bis):

  • eine gültige DatumsPeriode (@Start - @End)
  • ein gültiges DatumsFormat (YYYY-MM-DD)
  • nicht in der Vergangenheit
  • nicht mehr als 2 Jahre im Vorraus
  • nicht mehr als 3 Monate als zusammenhängender Zeitraum

Validierung sonstiger Parameter

  • Hotel-ID gültig und Hotel ist online / aktiv
  • Zimmer-ID gültig und Zimmer ist online / aktiv
  • Angebots-ID gültig und Angebot ist online / aktiv

Hinweis:

Die vom OTA-Partner gesendeten Daten werden nur für Zimmer akzeptiert, die *aktiv und online* sind, alternativ werden Warnungen als Antwort gesendet.

Generell werden Zeilen mit Regeln einzeln betrachtet, d.h. ein Fehler im RoomTypeCode oder im Datumsformat, Datumsbreich wird nur für diese eine Zeile als Warnung gesendet. Alle weiteren Zeilen werden unabhängig davon bearbeitet.

Beispiel für Anfrage

Beispiel 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 - Versionen der Response

Normalerweise wird ein <Success/> als Antwort gesendet oder entsprechende Fehlermeldungen (keine Warnungen)

Beispiel OTA_HotelBookingRuleNotifRS Response mit 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>

Warnungen

Beispiel OTA_HotelBookingRuleRS Response mit Warnungen

<?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>

Fehlermeldungen

Wenn schwere Fehler bspw. in der Authentifizierung oder Validierung der Daten auftreten, senden wird diese in einer OTA_ErrorRS Response mit @ErrorCode und @ErrorMessage

Hier eine Liste gängiger Fehlermeldungen beim Senden von Verfügbarkeiten

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

Beispiel OTA_HotelBookingRuleRS Response mit Fehler

Variante 1: im Kontext der Anfrage mit OTA_HotelBookingRuleRS Response und <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>

Variante 2: Alternativ als OTA_ErrorRS Response und Attributen ErrorCode und 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"/>