ExtraGuestCharges

通过 <OTA_HotelRateAmountNotifRQ> 发送的费率可以是 除了原始房价外,还调整了入住人数和儿童 入住人数。ExtraGuestCharges 消息允许 说明如何为这些额外的房客计算房价, 他们应该对哪些客房、价格方案和住宿日期收费。

容量要求

根据 ExtraGuestCharges 消息计算出的价格仅在满足以下条件时有效: 容量要求请参阅交易(房源数据)

请求

语法

ExtraGuestCharges 消息使用以下语法:

<?xml version="1.0" encoding="UTF-8"?>
<ExtraGuestCharges partner="partner_account_name"
                   id="message_ID"
                   timestamp="timestamp">
  <HotelExtraGuestCharges hotel_id="HotelID" action="[overlay]">
    <ExtraGuestCharge>
      <RatePlans>
        <RatePlan id="PackageID_1"/>
        <RatePlan id="PackageID_2"/>
      </RatePlans>
      <RoomTypes>
        <RoomType id="RoomID_1"/>
        <RoomType id="RoomID_2"/>
      </RoomTypes>
      <StayDates>
        <DateRange start="YYYY-MM-DD" end="YYYY-MM-DD"
                   days_of_week="MTWHFSU_or_subset"/>
      </StayDates>
      <AgeBrackets>
        <AdultCharge amount="float"/>
        <ChildAgeBrackets>
        <!-- The following are different ways child charges can be specified.
        Use the option that matches your system. -->
          <ChildAgeBracket max_age="integer" amount="float"
                           exclude_from_capacity="[true|false]"/>
          <ChildAgeBracket max_age="integer" percentage="float"
                           exclude_from_capacity="[true|false]"
                           counts_as_base_occupant="[never|preferred|always]"/>
          <ChildAgeBracket max_age="integer" discount_amount="float"
                           exclude_from_capacity="[true|false]"
                           counts_as_base_occupant="[never|preferred|always]"/>
        </ChildAgeBrackets>
      </AgeBrackets>
    </ExtraGuestCharge>
  </HotelExtraGuestCharges>
</ExtraGuestCharges>

元素和属性

ExtraGuestCharges 消息包含以下元素 属性:

元素 / @Attribute 出现次数 类型 说明
ExtraGuestCharges 1 Complex element 此消息的根元素。
ExtraGuestCharges / @partner 1 string 此消息所属的合作伙伴账号。此字符串值是 Partner key 值已在 <ph type="x-smartling-placeholder"></ph> Hotel Center 中的“账号设置”页面

注意:如果您的后端为以下对象提供 Feed 多个账号,此值需要与 ID 相匹配 在 <RequestorID> 中指定的属性值 的 <OTA_HotelRateAmountNotifRQ> 的元素和 同一目的地的 <OTA_HotelAvailNotifRQ> 条消息 。

ExtraGuestCharges / @id 1 string 此请求消息的唯一标识符。该值会返回 。允许使用的字符包括:a-zA-Z0-9_(下划线)和 -(短划线)。
ExtraGuestCharges / @timestamp 1 DateTime 此消息的创建日期和时间。
ExtraGuestCharges / HotelExtraGuestCharges 0..n HotelExtraGuestCharges 用于存储单个媒体资源的费用的容器。
ExtraGuestCharges / HotelExtraGuestCharges / @hotel_id 1 string 房源的唯一标识符。该值必须与 使用 指定的酒店 ID <listing> 元素中的 <id>Hotel Center 中也会列出酒店 ID。
ExtraGuestCharges / HotelExtraGuestCharges / @action 0..1 enum 指定如何应用更新。只有overlay 且默认设置为“重叠式广告”之前针对此服务的所有费用 属性在应用更新应用前会被清除。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge 0..99 ExtraGuestCharge

针对一个媒体资源的同一组费用。其中可能包含 对收费方式和收费方式的限制 按年龄或宾客类别计算。

以下时间段内的每个ExtraGuestChargeHotelExtraGuestCharges 必须应用于一组不重复的日期 和产品。如果两个 ExtraGuestCharge 元素引用同一个 日期-产品组合,则会拒绝整条消息。

ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / AgeBrackets 1 AgeBrackets 用于按年龄或 来宾类别。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / AgeBrackets / AdultCharge 0..1 AdultCharge 用于支付额外的成人费用的容器。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / AgeBrackets / AdultCharge / @amount 0..1 float 一个正小数值,用于指定要接受的固定金额 需支付额外的成人费用。这笔费用使用的币种与 为每晚房价指定的值。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / AgeBrackets / ChildAgeBrackets 0..1 ChildAgeBrackets 用于支付额外子级费用的容器。这些年龄段只能 涵盖 0-17 岁(含)的年龄段。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / AgeBrackets / ChildAgeBrackets / ChildAgeBracket 1..99 ChildAgeBracket 针对特定年龄段儿童收取的费用。这些 应按照max_age从低到高的顺序排列 max_age。您可以使用 amountpercentagediscount_amount。必须有且只能有一个 为每个 <ChildAgeBracket> 指定的。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / AgeBrackets / ChildAgeBrackets / ChildAgeBracket / @max_age 1 integer 在 可能需要支付 <ChildAgeBracket>。最短存在时间为零 如果未指定其他 <ChildAgeBracket> 然后再观看本视频否则,该值会比前一个括号中的 最长存在时间。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / AgeBrackets / ChildAgeBrackets / ChildAgeBracket / @exclude_from_capacity 1 boolean 一个布尔值,指示此年龄段的儿童是否应 会计入会议室的总容纳人数和儿童容纳人数。这些 可设置 交易(房源数据)。例如,未达到特定年龄的婴儿 可能不需要计入子级容量。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / AgeBrackets / ChildAgeBrackets / ChildAgeBracket / @amount 0..1 float 一个非负小数值,用于指定要接受的固定金额 额外支付的儿童费用。这笔费用使用 为每晚房价指定的币种相同。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / AgeBrackets / ChildAgeBrackets / ChildAgeBracket / @percentage 0..1 float

一个介于 1 到 99 之间的十进制值,用于指定 这个成人价格应该为一个额外的儿童支付 括号。这笔费用使用的币种与 为 每晚价格。

如需了解详情,请参阅 counts_as_base_occupant 下的讨论 成人价格的计算方式。

ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / AgeBrackets / ChildAgeBrackets / ChildAgeBracket / @discount_amount 0..1 float

一个正小数值,用于指定固定折扣 此年龄段内的一个孩子可额外享受成人价格的优惠金额。 这笔费用使用的币种与每晚指定的币种相同 。

一般而言,此年龄段内的儿童的费用计算方式如下: 从“单价”中扣减固定金额。单价为 的counts_as_base_occupant 属性部分。

ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / AgeBrackets / ChildAgeBrackets / ChildAgeBracket / @counts_as_base_occupant 0..1 string

如果 percentagediscount_amount 属性,则必须指定 counts_as_base_occupant 。此值决定孩子是否应该 选择NumberOfGuest 应用百分比值后的费率为 <BaseByGuestAmount> 费用和折扣。

我们的目标是这里的 计算费用。

unit price = rate / occupancy

此属性的值必须为以下值之一:neverpreferredalways

  • 如果指定了 never,则子项一律不得 包含在费率的入住人数中。

    如果您想计算 2 名成人和 2 名儿童 (2+2) 的房价, 您应该使用 2 名成人入住的房价,因为儿童 。

  • 如果指定了 preferred,则子级应 最好包含在房价的入住人数中。

    如果您想计算 2 名成人和 1 名儿童 (2+1) 的房价, 则最好使用 3 名成人的房价,但如果不能 则您应使用 2 名成人的房价。

  • 如果指定了 always,则子级应 始终包含在房价的入住人数中。

    如果您想计算 2 名成人和 2 名儿童 (2+2) 的房价, 您应该使用 4 名成人入住的房价,因为儿童必须 。

ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / RoomTypes 0..1 RoomTypes 收取相应费用的客房类型列表的容器。 系统将向每个<RoomType>收取此费用 。如果未指定 <RoomTypes>,则 费用适用于指定酒店内的所有客房。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / RoomTypes / RoomType 1..n RoomType 指定房间类型。客房类型是在 <RoomData> 元素在 交易 (媒体资源数据)消息,并使用其 <RoomID> 值。(现在是 <RoomID> 值也由以下格式的 InvTypeCode 属性引用: OTA_HotelRateAmountNotifRQ 消息。)
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / RoomTypes / RoomType / @id 1 string 房源的唯一标识符(房间类型)。此值映射 发送给 <RoomID>。 允许的最大字符数为 50。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / RatePlans 0..1 RatePlans 包含收取相应费用的费率方案列表的容器。 如果未指定 <RatePlans>,费用 适用于所有价格方案
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / RatePlans / RatePlan 1..n RatePlan 指定费率方案。费率方案由 如“交易”中所定义的套餐、费率和空房情况 (房源数据)、OTA_HotelRateAmountNotifRQ 和 OTA_HotelAvailNotifRQ 消息,并通过 PackageID 标识。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / RatePlans / RatePlan / @id 1 string 费率方案的唯一标识符。该值映射到 <PackageData> 中的 PackageID 值 “交易(房源数据)”消息中,以及 RatePlanCode 属性 两者均有 <StatusApplicationControl> <OTA_HotelRateAmountNotifRQ><OTA_HotelAvailNotifRQ> 封邮件。 允许的最大字符数为 50。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / StayDates 0..1 StayDates 一个或多个日期范围的容器,用于确定 费用。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / StayDates / DateRange 1..99 DateRange 用于指定促销活动应用日期的日期范围。
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / StayDates / DateRange / @start 0..1 Date 开始日期(基于房源的时区),包含 日期范围。该日期必须早于或等于 end日期。如果未指定 start,则为 日期范围实际上没有限制
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / StayDates / DateRange / @end 0..1 Date 结束日期(基于房源的时区),包括 日期范围。此日期必须与start相同或更晚 日期。如果未指定 end,则为 日期范围实际上没有结束日期
ExtraGuestCharges / HotelExtraGuestCharges / ExtraGuestCharge / StayDates / DateRange / @days_of_week 0..1 string

允许出现在日期范围内的星期几。如果不是 指定日期范围,则允许日期范围内的所有日期。每个 字符串中的字符指定了日期。例如:“MTWHF”指定了 日期范围允许工作日。

有效字符包括:

  • M(周一)
  • T(周二)
  • W 表示周三
  • H 表示周四
  • F - 周五
  • 周六 S
  • 周日U

任意字符组合均有效。

示例

成人费用

针对额外成人的费用只能以固定金额表示。通过 以下示例显示了一条指定成人性质的 ExtraGuestCharges 消息 费用:

<?xml version="1.0" encoding="UTF-8"?>
<ExtraGuestCharges timestamp="2001-02-03T04:05:06+00:00" id="1">
  <HotelExtraGuestCharges hotel_id="ABC" action="overlay">
    <ExtraGuestCharge>
      <StayDates />
      <AgeBrackets>
        <AdultCharge amount="50" />
      </AgeBrackets>
    </ExtraGuestCharge>
  </HotelExtraGuestCharges>
</ExtraGuestCharges>

对应的费率如下:

<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelRateAmountNotifRQ xmlns="http://www.opentravel.org/OTA/2003/05"
                            EchoToken="12345678"
                            TimeStamp="2020-05-19T20:50:37-05:00"
                            Version="3.0">
  <RateAmountMessages HotelCode="ABC">
    <RateAmountMessage>
      <StatusApplicationControl Start="2020-05-18"
                                End="2020-05-23"
                                InvTypeCode="RoomID_1"
                                RatePlanCode="PackageID_1"/>
      <Rates>
        <Rate>
          <BaseByGuestAmts>
            <BaseByGuestAmt AmountAfterTax="100.00"
                            CurrencyCode="USD"
                            NumberOfGuests="1"/>
            <BaseByGuestAmt AmountAfterTax="110.00"
                            CurrencyCode="USD"
                            NumberOfGuests="2"/>
            <BaseByGuestAmt AmountAfterTax="120.00"
                            CurrencyCode="USD"
                            NumberOfGuests="3"/>
          </BaseByGuestAmts>
        </Rate>
      </Rates>
    </RateAmountMessage>
  </RateAmountMessages>
</OTA_HotelRateAmountNotifRQ>

那么,当用户在 Google 上搜索四位成人时,总费率为 170 = 120 + 50。

120 来自 <BaseByGuestAmt> 费率,NumberOfGuests="3" 和 50 来自 AdultCharge amount="50"

儿童扣款

儿童费用以不超过 17 岁的年龄段表示,可以是 以固定金额、百分比或折扣的形式表示。

以下示例展示了一条 ExtraGuestCharges 消息,它指定了 子级扣款:

<?xml version="1.0" encoding="UTF-8"?>
<ExtraGuestCharges timestamp="2001-02-03T04:05:06+00:00" id="1">
  <HotelExtraGuestCharges hotel_id="ABC" action="overlay">
    <ExtraGuestCharge>
      <AgeBrackets>
        <ChildAgeBrackets>
          <ChildAgeBracket max_age="3" percentage="10"
                           counts_as_base_occupant="never" />
          <ChildAgeBracket max_age="10" percentage="30"
                           counts_as_base_occupant="preferred"/>
          <ChildAgeBracket max_age="17" discount_amount="10"
                           counts_as_base_occupant="always" />
        </ChildAgeBrackets>
      </AgeBrackets>
    </ExtraGuestCharge>
  </HotelExtraGuestCharges>
</ExtraGuestCharges>

对应的费率如下:

<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelRateAmountNotifRQ xmlns="http://www.opentravel.org/OTA/2003/05"
                            EchoToken="12345678"
                            TimeStamp="2020-05-19T20:50:37-05:00"
                            Version="3.0">
  <RateAmountMessages HotelCode="ABC">
    <RateAmountMessage>
      <StatusApplicationControl Start="2020-05-18"
                                End="2020-05-23"
                                InvTypeCode="RoomID_1"
                                RatePlanCode="PackageID_1"/>
      <Rates>
        <Rate>
          <BaseByGuestAmts>
            <BaseByGuestAmt AmountAfterTax="100.00"
                            CurrencyCode="USD"
                            NumberOfGuests="1"/>
            <BaseByGuestAmt AmountAfterTax="110.00"
                            CurrencyCode="USD"
                            NumberOfGuests="2"/>
          </BaseByGuestAmts>
        </Rate>
      </Rates>
    </RateAmountMessage>
  </RateAmountMessages>
</OTA_HotelRateAmountNotifRQ>
```

  1.  Suppose you want the total price for 2 adults and 1 child of 2 years
      of age.

      Children aged 0-3 are never included in the rate's occupancy,
      so here you should take the double occupancy rate and divide by 2 to
      get the unit price. Then, multiply by the percentage rate and sum
      with the rate to get the total price.

      `unit price ` = 110 / 2 = 55

      `total price` = 110 + 55 * 0.1 = 115.5

  1.  Suppose you want the total price for 1 adult and 2 children, both of 5
      years of age.

      Children aged 4-10 are preferably included in the rate's
      occupancy. you should start by looking for a 3 adult rate since both
      children are preferably included in the rate's occupancy. Since
      that doesn't exist you should fall back to the 2 adult rate and then,
      take this rate and divide by two to get the unit price. Finally,
      multiply by the percentage rate and sum with the scaled rate to
      get the total price.

      `unit price` = 110 / 2 = 55

      `total price` = 55 + 55 * 0.3 + 55 * 0.3 = 88

  1.  Suppose you want the total price for 1 adult and 1 child of 17
      years of age.

      Children aged 11-17 are always included in the rate's occupancy, so,
      in this case, take the double occupancy rate and divide by 2 to get
      the unit price. Then, deduct it by the discount amount and sum with
      the scaled rate to get the total price.

      `unit price` = 110 / 2 = 55

      `total price` = 55 + (55 - 10) = 100

费用限制

所有类型的限制都是可选的,并且它们的任意组合都可以 。

以下示例展示了一条 ExtraGuestCharges 消息,它指定了 限制:

<?xml version="1.0" encoding="UTF-8"?>
<ExtraGuestCharges timestamp="2001-02-03T04:05:06+00:00" id="1">
  <HotelExtraGuestCharges hotel_id="ABC" action="overlay">
    <ExtraGuestCharge>
      <RoomTypes>
        <RoomType id="queen" />
        <RoomType id="king" />
      </RoomTypes>
      <RatePlans>
        <RatePlan id="free-wifi" />
        <RatePlan id="hot-breakfast" />
      </RatePlans>
      <StayDates>
        <DateRange start="2020-09-01" end="2020-09-14"/>
      </StayDates>
      <AgeBrackets>
        <AdultCharge amount="50" />
      </AgeBrackets>
    </ExtraGuestCharge>
  </HotelExtraGuestCharges>
</ExtraGuestCharges>

上述消息规定,任何商品都应向成人付费 客房类型为“大号”或“国王”包含“免费 Wi-Fi”价格方案或 “热早餐”日期范围为 2020 年 9 月 1 日至 2020 年 9 月 14 日

重叠费用

此部分显示了一个无效消息示例,该消息指定不同的 按相同的日期和产品组合收费。


<?xml version="1.0" encoding="UTF-8"?>
<ExtraGuestCharges timestamp="2001-02-03T04:05:06+00:00" id="1">
  <HotelExtraGuestCharges hotel_id="ABC" action="overlay">
    <ExtraGuestCharge>
      <RoomTypes>
        <RoomType id="queen" />
      </RoomTypes>
      <RatePlans>
        <RatePlan id="free-wifi" />
      </RatePlans>
      <StayDates>
        <DateRange start="2020-09-01" end="2020-09-14"/>
      </StayDates>
      <AgeBrackets>
        <AdultCharge amount="50" />
      </AgeBrackets>
    </ExtraGuestCharge>
    <ExtraGuestCharge>
      <RoomTypes>
        <RoomType id="queen" />
        <RoomType id="king" />
      </RoomTypes>
      <RatePlans>
        <RatePlan id="free-wifi" />
        <RatePlan id="hot-breakfast" />
      </RatePlans>
      <StayDates>
        <DateRange start="2020-09-01" end="2020-09-05"/>
      </StayDates>
      <AgeBrackets>
        <AdultCharge amount="20" />
      </AgeBrackets>
    </ExtraGuestCharge>
  </HotelExtraGuestCharges>
</ExtraGuestCharges>

以上消息无效,因为第一个 <ExtraGuestCharge> 指定“queen”和“免费 Wi-Fi”9 月 1 日至 9 月 14 日的费用 额外增加 50 名成人。第二个 <ExtraGuestCharge> 指定任何“皇后”或“国王”任意“免费 Wi-Fi”或 “热早餐”入住 9 月 1 日至 9 月 5 日的费用应额外加收 20 名成人。 “queen”存在重叠的扣款和“免费 Wi-Fi”:9 月 1 日至 5,并且对于额外成人收取 20 美元还是 50 美元之间存在冲突。

响应

语法

ExtraGuestChargesResponse 消息使用以下内容: 语法:

<?xml version="1.0" encoding="UTF-8"?>
<ExtraGuestChargesResponse timestamp="timestamp"
                    id="message_ID"
                    partner="partner_key">
  <!-- Either Success or Issues will be populated. -->
  <Success/>
  <Issues>
    <Issue code="issue_code" status="issue_type">issue_description</Issue>
  </Issues>
</ExtraGuestChargesResponse>

元素和属性

ExtraGuestChargesResponse 消息包含以下元素 和属性:

元素 / @Attribute 出现次数 类型 说明
ExtraGuestChargesResponse 1 Complex element 表示收到的 ExtraGuestCharges 请求消息。
ExtraGuestChargesResponse / @timestamp 1 DateTime 此消息的创建日期和时间。
ExtraGuestChargesResponse / @id 1 string 关联的 ExtraGuestCharges 消息中的唯一标识符。
ExtraGuestChargesResponse / @partner 1 string 此消息所属的合作伙伴账号。
ExtraGuestChargesResponse / Success 0..1 Success 指示 ExtraGuestCharges 消息已成功处理 而不会出现警告、错误或故障

<Success><Issues> 为 。

ExtraGuestChargesResponse / Issues 0..1 Issues 处理 ExtraGuestCharges 条消息。

<Success><Issues> 为 。

ExtraGuestChargesResponse / Issues / Issue 1..n Issue 对在调试过程中遇到的警告、错误或失败情况的说明 处理 ExtraGuestCharges 消息。如需详细了解这些问题,请访问 Feed 状态错误消息
ExtraGuestChargesResponse / Issues / Issue / @code 1 integer 问题的标识符。
ExtraGuestChargesResponse / Issues / Issue / @status 1 enum

遇到的问题类型。

有效值为 warningerror、 和 failure

示例

成功

以下是对已成功处理的 ExtraGuestCharges 条消息。

<?xml version="1.0" encoding="UTF-8"?>
<ExtraGuestChargesResponse timestamp="2020-05-18T16:20:00-04:00"
                    id="12345678"
                    partner="partner_key">
  <Success/>
</ExtraGuestChargesResponse>

问题

以下是对未处理的 ExtraGuestCharges 消息的响应 发生错误。

<?xml version="1.0" encoding="UTF-8"?>
<ExtraGuestChargesResponse timestamp="2020-05-18T16:20:00-04:00"
                    id="12345678"
                    partner="partner_key">
  <Issues>
    <Issue code="1001" status="error">Example</Issue>
  </Issues>
</ExtraGuestChargesResponse>