价格和客房空房情况(交易)XML 参考

本页提供了基于 XML 的交易消息的参考信息。

<Transaction>

事务消息的根元素是 <Transaction>。它是一个容器,用于存储有关客房和套餐的描述性信息,以及/或者客房和套餐的价格和空房情况。

<Transaction> 元素显示在交易消息 XML 层次结构中的以下位置:

+ <Transaction>
    + <PropertyDataSet>  // Room and package metadata
        + <Property>
        + <RoomData>
        + <PackageData>
    + <Result>           // Pricing and availability
        + <Rates>
        + <RoomBundle>
        + ...

使用 <Transaction> 作为根元素的消息至少需要一个子元素。事务消息可以有任意数量的子元素,前提是消息总大小不超过 100 MB。

语法

<Transaction> 元素使用以下语法:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="timestamp" id="transaction_ID">

  <!-- Defines data about a room or package (Room Bundle) -->
  <PropertyDataSet>
    ...
  </PropertyDataSet>

  <!-- Updates/sets prices and availability for rooms and Room Bundles -->
  <!-- (Also removes itineraries from inventory) -->
  <Result>
    ...
  </Result>

</Transaction>

属性

<Transaction> 元素具有以下属性:

特性 是否必需? 类型 说明
id Required 字符串 每条交易消息的唯一标识符。
partner Optional string 接收交易消息的合作伙伴帐号。如果您的后端为多个合作伙伴帐号提供价格 Feed,通常使用此方法。此字符串值是 Hotel Center “帐号设置”页面上列出的“合作伙伴键”值。
timestamp Required DateTime

发送交易消息的时间。

系统会处理发送的任何时间戳在过去 24 小时内的消息,而没有传递的消息将被舍弃。

消息会按照 timestamp 的顺序(而不是接收顺序)进行处理。例如,如果在一条时间戳为 2019-05-03 14:10:00 的消息之后收到价格为 2019-05-03 14:09:00 的价格更新,系统仍会按顺序处理该更新,并且将使用时间戳为 2019-05-03 14:10:00 的消息中的价格。

子元素

<Transaction> 元素具有以下子元素:

子元素 是否必需? 类型 说明
<PropertyDataSet> Optional* <PropertyDataSet>

描述特定客房和客房套餐。您通常在单独的交易消息中使用此元素来定义客房套餐的共享值,并缩减交易消息的大小。

<Result> Optional* <Result>

客房行程的价格数据或 <RoomBundle> 元素(用于定义客房套餐和酒店的其他客房类型)。<Result> 元素还可用于从目录中移除行程。

* 必须至少提供 <PropertyDataSet><Result> 中的一个。

示例

客房数据

以下示例在简单的 Transaction 消息中定义房间数据:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>1234</Property>
    <RoomData>
      <RoomID>5440OF</RoomID>
      <Name>
        <Text text="Single King Bed Room" language="en"/>
        <Text text="Simple Lit de Roi" language="fr"/>
      </Name>
      <Description>
        <Text text="One king bed with pillowtop mattresses, 300-thread-count linens,
          and down comforters (bedspreads). City view. 300 square feet. Desk with
          rolling chair. Multi-line phone with voice mail. Cable/satellite TV with
          complimentary HBO and pay movies." language="en"/>
        <Text text="Un très grand lit avec matelas à plateau-coussin, ..." language="fr"/>
      </Description>
      <PhotoURL>
        <Caption>
          <Text text="Bathroom View" language="en"/>
          <Text text="La salle de baines" language="fr"/>
        </Caption>
        <URL>http://www.foo.com/static/bar/image1234.jpg</URL>
      </PhotoURL>
      <Capacity>4</Capacity>
    </RoomData>
  </PropertyDataSet>
</Transaction>

价格数据

以下示例在简单的 Transaction 消息中定义价格数据:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-23T16:20:00-04:00" id="42">
  <Result>
    <Property>060773</Property>
    <RoomID>RoomType101</RoomID>
    <PackageID>Package101</PackageID>
    <Checkin>2018-06-10</Checkin>
    <Nights>2</Nights>
    <Baserate currency="USD">278.33</Baserate>
    <Tax currency="USD">25.12</Tax>
    <OtherFees currency="USD">2.00</OtherFees>
    <AllowablePointsOfSale>
      <PointOfSale id="site1"/>
    </AllowablePointsOfSale>
  </Result>
  <Result>
    <Property>052213</Property>
    <RoomID>RoomType101</RoomID>
    <PackageID>Package101</PackageID>
    <Checkin>2018-06-10</Checkin>
    <Nights>2</Nights>
    <Baserate currency="USD">299.98</Baserate>
    <Tax currency="USD">26.42</Tax>
    <OtherFees currency="USD">2.00</OtherFees>
    <AllowablePointsOfSale>
      <PointOfSale id="otto"/>
      <PointOfSale id="simon"/>
    </AllowablePointsOfSale>
  </Result>
</Transaction>

每晚价格

以下示例定义了从 2023 年 6 月 7 日起 1 到 7 晚的价格数据:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-08-24T16:20:00-04:00" id="42">
  <Result>
    <Property>1234</Property>
    <Checkin>2018-06-07</Checkin>
    <Nights>1</Nights>
    <Baserate currency="USD">209.99</Baserate>
    <Tax currency="USD">25.12</Tax>
    <OtherFees currency="USD">2.00</OtherFees>
  </Result>
  <Result>
    <Property>1234</Property>
    <Checkin>2018-06-07</Checkin>
    <Nights>2</Nights>
    <Baserate currency="USD">419.98</Baserate>
    <Tax currency="USD">25.12</Tax>
    <OtherFees currency="USD">2.00</OtherFees>
  </Result>
  <Result>
    <Property>1234</Property>
    <Checkin>2018-06-07</Checkin>
    <Nights>3</Nights>
    <Baserate currency="USD">614.97</Baserate>
    <Tax currency="USD">21.12</Tax>
    <OtherFees currency="USD">2.00</OtherFees>
  </Result>
  <Result>
    <Property>1234</Property>
    <Checkin>2018-06-07</Checkin>
    <Nights>4</Nights>
    <Baserate currency="USD">819.96</Baserate>
    <Tax currency="USD">21.12</Tax>
    <OtherFees currency="USD">2.00</OtherFees>
  </Result>
  <Result>
    <Property>1234</Property>
    <Checkin>2018-06-07</Checkin>
    <Nights>5</Nights>
    <Baserate currency="USD">999.95</Baserate>
    <Tax currency="USD">21.12</Tax>
    <OtherFees currency="USD">2.00</OtherFees>
  </Result>
  <Result>
    <Property>1234</Property>
    <Checkin>2018-06-07</Checkin>
    <Nights>6</Nights>
    <Baserate currency="USD">1193.94</Baserate>
    <Tax currency="USD">21.12</Tax>
    <OtherFees currency="USD">2.00</OtherFees>
  </Result>
  <Result>
    <Property>1234</Property>
    <Checkin>2018-06-07</Checkin>
    <Nights>7</Nights>
    <Baserate currency="USD">1259.93</Baserate>
    <Tax currency="USD">21.12</Tax>
    <OtherFees currency="USD">2.00</OtherFees>
  </Result>
</Transaction>


基本费率和条件式费率

以下示例展示了包含基本费率和条件式费率的交易消息:

<?xml version="1.0" encoding="UTF-8" ?>
<Transaction timestamp="2023-05-18T16:20:00-04:00" id="42">
  <Result>
    <Property>1234</Property>
    <Checkin>2023-04-10</Checkin>
    <Nights>1</Nights>

    <Baserate currency="USD">200.00</Baserate>
    <Tax currency="USD">20.00</Tax>
    <OtherFees currency="USD">1.00</OtherFees>

    <Rates>
      <!-- The rate_rule_id is required when using conditional rates -->
      <Rate rate_rule_id="mobile">
        <!-- Override base rate and taxes for conditional rates -->
        <Baserate currency="USD">180.00</Baserate>
        <Tax currency="USD">18.00</Tax>
        <!-- NOTE: OtherFees is inherited from the above setting -->
        <Custom1>ratecode123</Custom1>
      </Rate>
    </Rates>

  </Result>
</Transaction>

移除广告资源

以下示例从房源中移除了某家酒店的若干清单(几个不同日期入住 1 晚):

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2023-05-23T16:20:00-04:00" id="42">
  <Result>
    <Property>1123581321</Property>
    <Checkin>2023-05-23</Checkin>
    <Nights>1</Nights>
    <Unavailable>
      <NoVacancy/>
    </Unavailable>
    <Tax currency="USD">0</Tax>
    <OtherFees currency="USD">0</OtherFees>
  </Result>
  <Result>
    <Property>1123581321</Property>
    <Checkin>2023-05-24</Checkin>
    <Nights>1</Nights>
    <Unavailable>
      <NoVacancy/>
    </Unavailable>
    <Tax currency="USD">0</Tax>
    <OtherFees currency="USD">0</OtherFees>
  </Result>
  <!---Sending <Baserate> is optional with <Unavailable> -->
  <Result>
    <Property>1123581321</Property>
    <Checkin>2023-05-25</Checkin>
    <Nights>1</Nights>
    <Baserate currency="USD">-1</Baserate>
    <Unavailable>
      <NoVacancy/>
    </Unavailable>
    <Tax currency="USD">0</Tax>
    <OtherFees currency="USD">0</OtherFees>
  </Result>
</Transaction>

<PropertyDataSet>

<Transaction> 消息中的会议室和软件包(或 Room Bundle)信息的容器。为酒店设置的值会覆盖为合作伙伴设置的值。 Google 会存储此信息,因此您无需在每次发送价格更新时定义此信息。

<PropertyDataSet> 元素显示在交易消息 XML 层次结构中的以下位置:

+ <Transaction>
    + <PropertyDataSet>  // Room and package metadata
        + <Property>
        + <RoomData>
        + <PackageData>
    + <Result>  // Pricing and availability
        + <Rates>
        + <RoomBundle>
        + ...

如需了解详情,请参阅 Room Bundle 元数据

语法

<PropertyDataSet> 元素使用以下语法:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction ... >
  <PropertyDataSet>
    <!-- (Required) ID that matches the Hotel List Feed -->
    <Property>hotel_ID</Property>

    <!-- (Optional) Defines metadata about a room -->
    <RoomData>
      ...
    </RoomData>

    <!-- (Optional) Defines package metadata to be paired with rooms (Room Bundles) -->
    <PackageData>
      ...
    </PackageData>
  </PropertyDataSet>
  ...
</Transaction>

属性

<PropertyDataSet> 元素没有属性。

子元素

<PropertyDataSet> 元素具有以下子元素:

子元素 是否必需? 类型 说明
<PackageData> Optional* <PackageData> 描述 Room Bundle。此数据与合作伙伴和酒店相关联,但与行程无关。此元素与 <RoomData> 类似,但它描述的是实际房间描述中没有的设施和术语。

您可以在价格更新中引用软件包 ID。

如需了解详情,请参阅 Room 软件包元数据

<Property> Required string 关联数据所适用的酒店的 ID。此元素的值必须是与酒店列表 Feed 中的商家信息 <id> 匹配的字符串。
<RoomData> Optional* <RoomData> 描述房间。此数据与合作伙伴和酒店相关联,但与行程无关。

您可以在价格更新中引用客房 ID。

* 必须至少提供 <PackageData><RoomData> 中的一个。

示例

Room 和软件包数据

以下示例显示了 <PropertyDataSet> 中的会议室和软件包数据:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>180054</Property>
    <RoomData>
      <RoomID>060773</RoomID>
      <Name>
        <Text text="Single Bed Room" language="en"/>
        <Text text="Chambre single" language="fr"/>
      </Name>
      <Description>
        <Text text="Non-smoking" language="en"/>
        <Text text="Pas de fumiers" language="fr"/>
      </Description>
      <PhotoURL>
        <Caption>
          <Text text="Living area" language="en"/>
          <Text text="Le chambre" language="fr"/>
        </Caption>
        <URL>http://www.foo.com/static/bar/image1234.jpg</URL>
      </PhotoURL>
    </RoomData>
    <PackageData>
      <PackageID>P54321</PackageID>
      <Name>
        <Text text="Breakfast Included" language="en"/>
        <Text text="Avec le petit déjeuner" language="fr"/>
      </Name>
      <Description>
        <Text text="Includes a delightful array of jams and jellies." language="en"/>
        <Text text="Comprend une délicieuse gamme de confitures et gelées." language="fr"/>
      </Description>
      <BreakfastIncluded>1</BreakfastIncluded>
    </PackageData>
  </PropertyDataSet>
</Transaction>

在发送此客房和/或客房套餐的价格和空房情况时,您需要在价格消息中引用客房和套餐 ID。结果就是,您可以大大减小消息的大小,同时还能减少由于重复数据而可能遇到的错误数量。如需了解详情,请参阅 Room Bundle 元数据

<RoomData>

定义有关客房及客房套餐的独立于行程的元数据(因为客房套餐是客房及其他酒店设施)。使用 <RoomData> 可以减少价格 Feed 中描述性数据的重复。

<RoomData> 元素显示在交易消息 XML 层次结构中的以下位置:

+ <Transaction>
    + <PropertyDataSet>  // Room and package metadata
        + <Property>
        + <RoomData>
        + <PackageData>
    + <Result>           // Pricing and availability
        + <Rates>
        + <RoomBundle>
        + ...

<RoomData> 元素包含与合作伙伴和酒店相关联的信息,但不包含与行程相关的信息。预期用途适用于所有非行程数据。

<RoomData> 元素与 <PackageData> 类似,但它描述的是物理房间,而不是套餐的设施和条款。您可以结合使用 <RoomData><PackageData> 来提供 Room Bundle 的详细信息。对于不属于软件包的各个房间,仅使用 <RoomData>

您可以为同一个房间或房间套装同时定义 <RoomData><PackageData> 元素。当 Google 在搜索结果中显示该房间或套餐时,将同时显示两者的说明,并以连字符分隔。

如需了解详情,请参阅 Room Bundle 元数据

语法

<RoomData> 元素使用以下语法:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction ... >
  <PropertyDataSet>
    ...
    <RoomData>
      <RoomID>room_ID</RoomID>

      <Name>
        <Text text="room_name" language="language_code"/>
        ...
      </Name>

      <Description>
        <Text text="room_description" language="language_code"/>
        ...
      </Description>

      <Capacity>max_number_of_occupants</Capacity>
      <Occupancy>max_number_of_intended_occupants</Occupancy>
      <OccupancyDetails> <!-- optional info about the types of guests,
      whether adults, children, or seniors --></OccupancyDetails>
      <OccupancySettings>
        <MinOccupancy>min_number_of_occupants</MinOccupancy>
        <MinAge>min_age_of_occupants</MinAge>
      </OccupancySettings>

      <PhotoURL>
        <Caption>
          <Text text="photo_description" language="language_code"/>
          ...
        </Caption>
        <URL>photo_location</URL>
      </PhotoURL>
      <RoomFeatures>
        ...
      </RoomFeatures>
    </RoomData>
    ...
  </PropertyDataSet>
</Transaction>

属性

<RoomData> 元素没有属性。

子元素

<RoomData> 元素具有以下子元素:

子元素 是否必需? 类型 说明
<Capacity> Optional integer 客房实际可以容纳的房客人数上限。会议室容纳人数大于或等于入住人数。

指定后,此值必须等于或大于 <Occupancy> 元素的值,即特定房间的预期房客数量。例如,大型套件的 <Capacity> 可能为 6,但其 <Occupancy> 为 4。

<Capacity> 的值必须是 1-20(含)之间的正整数。

<Description> Optional Object 聊天室的详细说明。此元素应包含未由其他元素或 <Name> 元素描述的信息。在指定客房的说明时,不应全部使用大写字母。

<Description> 元素接受单个子元素 <Text>,该子元素具有以下两个必需属性:

  • text:聊天室的详细说明。
  • language:两个字母的语言代码;例如 fr

针对您的广告或免费预订链接可能展示的每种语言,分别使用单独的 <Text> 元素(language 属性的值不同)。

以下示例显示了法语和英语版本的会议室说明:

<Description>
  <Text text="Two queen-sized beds" language="en"/>
  <Text text="Deux lits de la reine" language="fr"/>
</Description>
<Name> Required string 客房类别的名称。此值应与酒店着陆页(以前称为销售终端)上显示的值一致。请勿将此元素的值设为全大写字母。

此元素接受单个子元素 <Text>,该子元素具有以下两个必需属性:

  • text:房间的名称。
  • language:两个字母的语言代码;例如 fr

针对您的广告或免费预订链接可能展示的每种语言,分别使用单独的 <Text> 元素(language 属性的值不同)。

以下示例显示了法语和英语版本的房间名称:

<Name>
  <Text text="Standard Double Room" language="en"/>
  <Text text="Le chambre double" language="fr"/>
</Name>
<Occupancy> Optional integer 会议室适合的邀请对象人数上限。 例如,大型套房实际可能能够容纳 6 位房客(容纳人数 = 6 位),但最多只能容纳 4 位房客。

此值必须小于或等于 <Capacity> 元素,即房间的实际可容纳人数。

<Occupancy> 的值必须是 1-99(含)之间的正整数。

<Occupancy> 可能会附带 <OccupancyDetails>,用于指定宾客类型(成人或儿童)。如需了解子元素的语法和说明,请参阅 <OccupancyDetails>

<OccupancySettings> Optional Object 用于限制或修改会议室入座要求的设置。

<OccupancySettings> 元素接受以下子元素:

  • <MinOccupancy>:客房内可入住的最少房客数量。例如,如果此属性设置为 2,则无法为单个邀请对象预订此会议室。

    <MinOccupancy> 的值必须是 1-99(含)之间的正整数。

  • <MinAge>:入住客房的所有房客的最低年龄。例如,如果此属性设为 18,则只能为所有邀请对象均年满 18 周岁的群组预订此会议室。

    <MinAge> 的值必须是 0 到 99(含)之间的正整数。

<OccupancySettings>
  <MinOccupancy>2</MinOccupancy>
  <MinAge>16</MinAge>
</OccupancySettings>

并非所有子元素都需要包含在内。

<PhotoURL> Optional Object 给定房间或客房套餐的照片的网址和可选图片说明。您可以为一个客房或客房套餐指定多个 <PhotoURL>。每个照片网址都必须位于各自的 <PhotoURL> 中。

该元素接受以下子元素:

  • <URL>:指定照片的位置。该位置应公开(而非位于防火墙后面),并且应包含协议(例如 https://)。每个 <PhotoURL> 只能使用一个 <URL>
  • <Caption>:定义照片的图片说明。 此元素接受单个子元素 <Text>,该子元素有两个必需属性:textlanguagetext 属性是图片说明,language 属性指定双字母语言代码,例如 en

例如:

<PhotoURL>
  <URL>https://www.example.com/static/bar/image1234.jpg</URL>
  <Caption>
    <Text text="A bright and breezy way to enjoy your mornin'
      cuppa tea." language="en"/>
    <Text text="Une façon lumineuse et aérée pour profiter
      de votre journée tasse de thé." language="fr"/>
  </Caption>
</PhotoURL>
<PhotoURL>
  <URL>https://www.foo.com/static/bar/image5678.jpg</URL>
  <Caption>
    <Text text="Or, perhaps you prefer coffee." language="en"/>
    <Text text="Ou peut-être préférez-vous le café." language="fr"/>
  </Caption>
</PhotoURL>
<RoomFeatures> Optional <RoomFeatures> 包含房间设施的相关信息。
<RoomID> Required string 客房的唯一 ID。使用此 ID 可将客房数据与价格更新中的“<Result>”区块进行匹配。如需了解详情,请参阅 Room 软件包元数据。(以内嵌方式定义会议室数据时,您也可以使用此 ID 在单个交易消息中引用通用会议室定义。)

示例

客房数据

以下示例定义了房间数据:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>1234</Property>
    <RoomData>
      <RoomID>5440OF</RoomID>
      <Name>
        <Text text="Single King Bed Room" language="en"/>
        <Text text="Simple Lit de Roi" language="fr"/>
      </Name>
      <Description>
        <Text text="One king bed with pillowtop mattresses, 300-thread-count linens,
          and down comforters (bedspreads). City view. 300 square feet. Desk with
          rolling chair. Multi-line phone with voice mail. Cable/satellite TV with
          complimentary HBO and pay movies." language="en"/>
        <Text text="Un très grand lit avec matelas à plateau-coussin, ..." language="fr"/>
      </Description>
      <PhotoURL>
        <Caption>
          <Text text="Bathroom View" language="en"/>
          <Text text="La salle de baines" language="fr"/>
        </Caption>
        <URL>http://www.foo.com/static/bar/image1234.jpg</URL>
      </PhotoURL>
      <Capacity>4</Capacity>
    </RoomData>
  </PropertyDataSet>
</Transaction>

客房和套餐元数据

以下示例定义了会议室和软件包元数据:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>180054</Property>
    <RoomData>
      <RoomID>060773</RoomID>
      <Name>
        <Text text="Single Bed Room" language="en"/>
        <Text text="Chambre single" language="fr"/>
      </Name>
      <Description>
        <Text text="Non-smoking" language="en"/>
        <Text text="Pas de fumiers" language="fr"/>
      </Description>
      <PhotoURL>
        <Caption>
          <Text text="Living area" language="en"/>
          <Text text="Le chambre" language="fr"/>
        </Caption>
        <URL>http://www.foo.com/static/bar/image1234.jpg</URL>
      </PhotoURL>
    </RoomData>
    <PackageData>
      <PackageID>P54321</PackageID>
      <Name>
        <Text text="Breakfast Included" language="en"/>
        <Text text="Avec le petit déjeuner" language="fr"/>
      </Name>
      <Description>
        <Text text="Includes a delightful array of jams and jellies." language="en"/>
        <Text text="Comprend une délicieuse gamme de confitures et gelées." language="fr"/>
      </Description>
      <BreakfastIncluded>1</BreakfastIncluded>
    </PackageData>
  </PropertyDataSet>
</Transaction>

多个客房套餐

以下示例定义了多个 Room 软件包的 Room 和软件包元数据:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
  <!-- A transaction message with room types result. -->
  <PropertyDataSet>
    <Property>12345</Property>
    <RoomData>
      <RoomID>single</RoomID>
      <Name>
        <Text text="Single room" language="en"/>
        <Text text="Chambre simple" language="fr"/>
      </Name>
      <Description>
        <Text text="A single room" language="en"/>
        <Text text="Le chambre simple" language="fr"/>
      </Description>
      <PhotoURL>
        <Caption>
          <Text text="Living area" language="en"/>
          <Text text="Le chambre" language="fr"/>
        </Caption>
        <URL>http://www.foo.com/static/bar/image1234.jpg</URL>
      </PhotoURL>
      <PhotoURL>
        <URL>http://www.foo.com/static/bar/image1235.jpg</URL>
      </PhotoURL>
      <Capacity>2</Capacity>
    </RoomData>
    <RoomData>
      <RoomID>double</RoomID>
      <Name>
        <Text text="Double room" language="en"/>
        <Text text="Chambre double" language="fr"/>
      </Name>
      <Occupancy>1</Occupancy>
    </RoomData>
    <PackageData>
      <PackageID>refundbreakfast</PackageID>
      <Name>
        <Text text="Refundable Room with Breakfast" language="en"/>
        <Text text="Chambre remboursable avec le petit déjeuner" language="fr"/>
      </Name>
      <Description>
        <Text text="Continental Breakfast" language="en"/>
        <Text text="Petit déjeuner continental" language="fr"/>
      </Description>
      <ChargeCurrency>hotel</ChargeCurrency>
      <Refundable available="1" refundable_until_days="3"/>
      <BreakfastIncluded>1</BreakfastIncluded>
    </PackageData>
    <PackageData>
      <PackageID>prepaid</PackageID>
      <Name>
        <Text text="Nonrefundable" language="en"/>
        <Text text="Non remboursable" language="fr"/>
      </Name>
      <Description>
        <Text text="Blah blah blad" language="en"/>
        <Text text="Le blah blah blad" language="fr"/>
      </Description>
      <Occupancy>2</Occupancy>
      <ChargeCurrency>web</ChargeCurrency>
      <Refundable available="0"/>
    </PackageData>
  </PropertyDataSet>
</Transaction>

<RoomFeatures>

定义会议室中的功能。

<RoomFeatures> 元素显示在交易消息 XML 层次结构中的以下位置:

+ <Transaction>
    + <PropertyDataSet>  // Room and package metadata
        + <Property>
        + <RoomData>
            + <RoomFeatures>

语法

<RoomFeatures> 元素使用以下语法:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction ... >
  <PropertyDataSet ... >
    ...
    <RoomData>
      <RoomFeatures>
        <JapaneseHotelRoomStyle>[western|japanese|japanese_western]</JapaneseHotelRoomStyle>
        <Beds>
           <Bed size="[single|semi_double|double|queen|king]">
             <Width unit="cm" number="width"/>
             <Length unit="cm" number="length"/>
           </Bed>
           <!-- Include with any additional beds. -->
        </Beds>
        <Suite/>
        <Capsule/>
        <Roomsharing>[shared|private]</Roomsharing>
        <Outdoor/>
        <MobilityAccessible/>
        <Smoking>[smoking|non_smoking]</Smoking>
        <BathAndToilet relation="[together|separate]">
          <Bath bathtub="[false|true]" shower="[false|true]"/>
          <Toilet electronic_bidet="[false|true]" mobility_accessible="[false|true]"/>
        </BathAndToilet>
        <OpenAirBath/>
        <AirConditioning/>
        <Balcony/>
        <Views>
          <!-- (Optional) Defines the type of views from the room. -->
          <!-- Example: <OceanView/> -->
        </Views>

      </RoomFeatures>
      ...
    </RoomData>
    ...
  </PropertyDataSet>
</Transactions>

属性

<RoomFeatures> 元素没有属性。

子元素

<RoomFeatures> 元素具有以下子元素:

子元素 是否必需? 类型 说明
<JapaneseHotelRoomStyle> Optional enum

表示日式酒店客房的风格。

有效值包括:

  • western:带床的西式客房。
  • japanese:日式客房,配有日式床垫。
  • japanese_western:日式西式客房,配有西式睡床和日式日式床垫。
<Beds> Optional Object 所含<Bed>的数量与会议室数量相同。请注意,此处不应计入日式日式床垫。

每个 <Bed> 都具有以下属性:

  • size(可选):有效值为 singlesemi_doubledoublequeenking
每个 <Bed> 都具有以下子元素:
  • <Width>(可选):指定床宽度。必须具有属性 unit(值为 cm)和属性 number(值为整数厘米)。
  • <Length>(可选):指定床长度。 必须具有 unit 属性(值为 cm)和 number 属性(床长需为整数厘米)。
示例:
<Beds>
  <Bed size="double">
    <Width unit="cm" number="140"/>
    <Length unit="cm" number="195"/>
  </Bed>
  <Bed/> <!-- Size unknown -->
</Beds>
<Suite> Optional empty 如果此会议室是套房,请提供此元素。
<Capsule> Optional empty 如果此会议室是胶囊客房,请提供此元素。
<Roomsharing> Optional enum 此会议室是否与其他房客(例如所有者或其他房客)共用。有效值为 sharedprivate
<Outdoor> Optional empty 如果此房间是没有固定墙、管道和空调的户外住宿,请提供此元素。例如,酒店客房不是户外住宿,而房客入住帐篷的露营地和房客自带房车的房车营地则属于户外住宿。
<MobilityAccessible> Optional empty 如果此会议室设有无障碍设施,请提供此元素。
<Smoking> Optional enum 此客房是无烟房间还是吸烟室。有效值为 non_smokingsmoking
<BathAndToilet> Optional Object 包含房间内浴室和卫生间的相关信息。

该属性为:

  • relation(可选):表示浴室和马桶的相对位置。有效值为 together(浴室和卫生间位于同一房间(例如浴室)紧贴在一起)和 separate(浴室和卫生间都有专用空间)。如果房间没有浴缸和卫生间,则不得设置此属性。

该元素可以选择接受以下子元素:

  • <Bath>(可选):此元素的存在表示房间内有浴缸。

    这些属性包括:

    • bathtub(可选):表示浴室在浴室中有浴缸。有效值为 0(或 false)和 1(或 true)。
    • shower(可选):表示浴室有淋浴间。有效值为 0(或 false)和 1(或 true)。
  • <Toilet>(可选):此元素的存在表示此房间有卫生间。

    这些属性包括:

    • electronic_bidet(可选):表示马桶有电子马桶。 有效值为 0(或 false)和 1(或 true)。
    • mobility_accessible(可选):表示厕所无障碍设施。有效值为 0(或 false)和 1(或 true)。

例如:

<BathAndToilet relation="separate">
  <Bath bathtub="1" shower="1"/>
  <Toilet
    electronic_bidet="1"
    mobility_accessible="1"/>
</BathAndToilet>
<OpenAirBath> Optional empty 如果此房间有私人露天浴池,请提供此元素。
<AirConditioning> Optional empty 如果此房间有空调,请提供此元素。
<Balcony> Optional empty 如果此房间有阳台或阳台,请提供此元素。
<Views> Optional Object 有效选项包括:

<AirportView/>
<BayView/>
<BeachView>/>
<CastleView/>
<CityView/>
<CountrysideView/>
<CourtyardView/>
<DuneView/>
<ForestView/>
<GardenView/>
<GolfCourseView/>
<HarborView/>
<LagoonView/>
<LakeView/>
<MarinaView/>
<MountainView/>
<NatureView/>
<OceanView/>
<ParkView/>
<PartialOceanView/>
<PisteView/>
<PoolView/>
<PyramidView/>
<RiverView/>
<StreetView/>

示例

JapaneseHotelRoomStyle 没有默认值。省略某个值不会导致 XML 错误,但当用户按房间风格或床位进行过滤时,您的商家信息不会显示在搜索结果中。

两张单人床

以下示例展示了如何使用 <RoomFeatures>

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>1234</Property>
    <RoomData>
      <RoomFeatures>
        <JapaneseHotelRoomStyle>western</JapaneseHotelRoomStyle>
        <Beds> <!-- Two single beds -->
          <Bed size="single">
            <Width unit="cm" number="97"/>
            <Length unit="cm" number="195"/>
          </Bed>
          <Bed size="single">
            <Width unit="cm" number="97"/>
            <Length unit="cm" number="195"/>
          </Bed>
        </Beds>
        <Suite/>
        <Capsule/>
        <Roomsharing>private</Roomsharing>
        <Outdoor/>
        <MobilityAccessible/>
        <Smoking>non_smoking</Smoking>
        <BathAndToilet relation="separate">
          <Bath bathtub="1" shower="1"/>
          <Toilet electronic_bidet="1" mobility_accessible="1"/>
        </BathAndToilet>
        <OpenAirBath/>
        <AirConditioning/>
        <Balcony/>
        <Views>
          <LakeView/>
          <MarinaView/>
          <BeachView/>
          <ForestView/>
          <MountainView/>
          <NatureView/>
        </Views>
      </RoomFeatures>
    </RoomData>
  </PropertyDataSet>
</Transaction>

两张双人床

下面的示例展示了 western 式日式客房,配有两张 double 床。

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2023-07-23T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>1234</Property>
    <RoomData>
      <RoomFeatures>
        <JapaneseHotelRoomStyle>western</JapaneseHotelRoomStyle>
        <Beds> <!-- Two double beds-->
          <Bed size="double"></Bed>
          <Bed size="double"></Bed>
        </Beds>
      </RoomFeatures>
    </RoomData>
  </PropertyDataSet>
</Transaction>


日式房型,无床

下面的示例展示了日式无床的房间。japanese 样式的房间不需要床位信息。

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2023-07-23T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>1234</Property>
    <RoomData>
      <RoomFeatures>
        <JapaneseHotelRoomStyle>japanese</JapaneseHotelRoomStyle>
      </RoomFeatures>
    </RoomData>
  </PropertyDataSet>
</Transaction>

日式西餐厅(带床)

下例展示了一个 japanese_western 样式的房间,配有 king 尺寸的床。

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2023-07-23T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>1234</Property>
    <RoomData>
      <RoomFeatures>
        <JapaneseHotelRoomStyle>japanese_western</JapaneseHotelRoomStyle>
        <Beds>
          <Bed size="king"></Bed>
        </Beds>
      </RoomFeatures>
    </RoomData>
  </PropertyDataSet>
</Transaction>

如果合作伙伴没有 japanese_western 间房间的床数信息,请遵循以下示例:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2023-07-23T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>1234</Property>
    <RoomData>
      <RoomFeatures>
        <JapaneseHotelRoomStyle>japanese_western</JapaneseHotelRoomStyle>
      </RoomFeatures>
    </RoomData>
  </PropertyDataSet>
</Transaction>

<PackageData>

为房源定义有关客房套餐的独立于行程的元数据。 此元素包含与合作伙伴和酒店关联的信息,但不包含与行程相关的信息。预期目的是一次性定义所有非行程数据,并从行程数据中引用这些数据。

<PackageData> 元素显示在交易消息 XML 层次结构中的以下位置:

+ <Transaction>
    + <PropertyDataSet>  // Room and package metadata
        + <Property>
        + <RoomData>
        + <PackageData>
    + <Result>           // Pricing and availability
        + <Rates>
        + <RoomBundle>
        + ...

<PackageData> 元素与 <RoomData> 类似,但它描述了不属于实际房间说明的费率功能和术语。您可以结合使用 <RoomData><PackageData> 提供有关客房套餐和房价功能的详细信息。对于不属于软件包的各个房间,仅使用 <RoomData>

您可以为同一房间或房间套装同时定义 <RoomData><PackageData> 元素。当 Google 在搜索结果中显示该房间或套餐时,将同时显示两者的说明,并以连字符分隔。

如果您更新属性的单个 <PackageData> 元素,则必须更新该属性的所有 <PackageData><RoomData> 元素。每个 <PropertyDataSet> 都被视为与属性相关的所有数据,并覆盖任何现有数据。

如需了解详情,请参阅 Room Bundle 元数据

语法

<PackageData> 元素使用以下语法:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction ... >
  <PropertyDataSet ... >
    <PackageData>
      <PackageID>package_ID</PackageID>
      <Name>
        <Text text="package_name" language="language_code"/>
        ...
      </Name>
      <Description>
        <Text text="package_description" language="language_code"/>
        ...
      </Description>
      <Refundable available="[false|true]" refundable_until_days="number_of_days"
        refundable_until_time="time"/>
      <ChargeCurrency>[deposit|hotel|installments|web]</ChargeCurrency>
      <Occupancy>max_number_of_intended_occupants</Occupancy>
      <OccupancyDetails><!-- optional info about the types of guests,
      whether adults or children --></OccupancyDetails>
      <!-- For these next 3 elements, boolean_value can be 0/1 or true/false -->
      <BreakfastIncluded>boolean_value</BreakfastIncluded>
      <InternetIncluded>boolean_value</InternetIncluded>
      <ParkingIncluded>boolean_value</ParkingIncluded>
      <PhotoURL>
        <Caption>
          <Text text="photo_description" language="language_code"/>
          ...
        </Caption>
        <URL>photo_location</URL>
      </PhotoURL>
      ...
      <Meals>
        <Breakfast
          included="[true|false]" buffet="[true|false]"
          in_room="[true|false]" in_private_space="[true|false]"/>
        <Dinner
          included="[true|false]" buffet="[true|false]"
          in_room="[true|false]" in_private_space="[true|false]"/>
      </Meals>
      <CheckinTime>checkin_time</CheckinTime>
      <CheckoutTime>checkout_time</CheckoutTime>
      <MembershipBenefitsIncluded>
        <ProgramName>
          <Text language="en" text="Special Rewards">
        </ProgramName>
        <ProgramLevel>
          <Text language="en" text="Platinum">
        </ProgramLevel>
      </MembershipBenefitsIncluded>
      <OnPropertyCredit>
        <Amount currency="USD">123.45</Amount>
      </OnPropertyCredit>
    </PackageData>
    <!-- a PackageID with a MilesIncluded rate feature -->
    <PackageData>
      <PackageID>room_with_miles</PackageID>
      <Name>
       <Text text="Room with Bundled Miles" language="en">
      </Name>
      <ChargeCurrency>hotel </ChargeCurrency>
      <MilesIncluded>
        <NumberOfMiles>1000 </NumberOfMiles>
        <Provider>
          <Text language="en" text="United Airlines">
        </Provider>
      </MilesIncluded>
    </PackageData>
    ...
    ...
  </PropertyDataSet>
  ...
</Transaction>

属性

<PackageData> 元素没有属性。

子元素

<PackageData> 元素具有以下子元素:

子元素 是否必需? 类型 说明
<BreakfastIncluded> Optional boolean 指明此套餐是否含房价含早餐。 有效值为 0(或 false)和 1(或 true)。

建议您使用 <Meals> 而不是 <BreakfastIncluded>

<ChargeCurrency> Optional enum 用户支付预订费用的时间和地点。此元素使用的语法与 <Result> 中的 <ChargeCurrency> 相同。

默认值为 web

<CheckinTime> Optional Time 可能的最早入住时间。 时间必须少于酒店当地时间的 24:00。
<CheckoutTime> Optional Time 酒店的当地时间可能的最晚退房时间。
<Description> Optional Object 对软件包的详细说明。此元素应包含未由其他元素或 <Name> 元素描述的信息。在指定客房的说明时,不应全部使用大写字母。

<Description> 元素接受单个子元素 <Text>,该子元素有两个必需属性:textlanguagetext 属性是说明,language 属性指定双字母语言代码,如以下示例所示:

<Description>
  <Text text="Two breakfast buffet certificates for
    each night of stay." language="en"/>
  <Text text="Deux certificats petit-déjeuner buffet
    pour chaque nuit de séjour." language="fr"/>
</Description>
<InternetIncluded> Optional boolean 如果某套餐包含免费互联网访问权限,而其他套餐则不包含该酒店设施。如果酒店的所有客房均免费上网,请勿为客房套餐设置此元素。此元素不适用于客房内有线互联网或客房不支持的无线互联网。有效值为 0(或 false)和 1(或 true)。
<Meals> Optional Object 此包裹中包含餐食信息。

<Meals> 元素接受两个可选的子元素:<Breakfast><Dinner>,它们具有以下属性:

  • included(必需):如果房价包含早餐/晚餐,则设置为 1(或 true);否则设置为 0false
  • in_room(可选):如果房客可以选择在自己入住的客房享用早餐/晚餐,则设置为 1(或 true);否则,设置为 0(或 false)。
  • in_private_space(可选):如果房客可以选择在可以避免与其他房客接触的空间(房间除外)吃早餐/晚餐,则设置为 1(或 true);否则,设置为 0(或 false)。
  • buffet(可选):如果早餐/晚餐是自助餐,则设置为 1(或 true);否则,设置为 0(或 false)。

仅当 included 为 true 时,才使用可选属性。

如需使膳食过滤条件(no mealsbreakfast onlydinner onlybreakfast and dinner)正常运行,需要通过 included 属性提供 <Breakfast><Dinner>

<Name> Required string 软件包的名称。此值应与酒店着陆页上显示的值一致。请勿将此元素的值设为全大写字母。

此元素接受单个子元素 <Text>,后者具有 textlanguage 这两个属性。 text 属性是说明,language 属性指定双字母语言代码,如以下示例所示:

<Name>
  <Text text="Bed and Breakfast" language="en"/>
  <Text text="Lit et petit déjeuné" language="fr"/>
</Name>
<Occupancy> Optional integer 客房套餐适用的房客人数上限。例如,大型套房实际可以容纳 6 位房客,但最多只适合 4 位房客。

此值必须小于或等于 <Capacity> 元素,即房间的实际可容纳人数。

<Occupancy> 的值必须是 1-99(含)之间的正整数。

如果您同时在 <RoomBundle><PackageData> 中指定此元素,则 <RoomBundle> 中的值优先。

注意

<Occupancy> 可能会附带 <OccupancyDetails>,用于指定宾客类型(成人或儿童)。如需了解子元素的语法和说明,请参阅 <OccupancyDetails>

<PackageID> Required string 文件包的唯一 ID。使用此 ID 可将客房套餐数据与价格更新中的 <Result> 代码块相匹配。如需了解详情,请参阅 Room 软件包元数据

(以内嵌方式定义 Room Bundle 数据时,您还可以使用此 ID 来引用单个事务消息中使用的通用 Room Bundle 定义。)

<ParkingIncluded> Optional boolean 客房套餐是否包括免费停车位,以及此酒店的停车服务是否属于付费服务。对于提供免费停车位的酒店,请勿为此元素指定值。

有效值为 0(或 false)和 1(或 true)。默认值为 false

<PhotoURL> Optional Object (与 <RoomData> 中的 <PhotoURL> 相同,但适用于套餐(例如用餐照片)。
<Refundable> Optional Object 允许将房价列为可全额退款或提供免费取消服务。如果未提供,则不会显示任何退款信息。 <PackageData> 级别的退款政策会覆盖 <Result> 级别的退款政策。<Rates> 级别的退款政策会覆盖 <PackageData> 级别的退款政策。您还可以通过替代选项向用户突出显示可退款价格,而无需直接修改交易消息架构。如需详细了解这些选项,请点击此处

以下示例显示了设置了其所有属性的 <Refundable> 元素:

<Refundable available="1" refundable_until_days="7"
refundable_until_time="18:00:00"/>

注意:我们建议您设置所有属性。如果一个或多个属性未设置,系统会生成一条 Feed 状态警告消息。

如果您未设置任何属性,则费率不会显示为可退款。这些属性包括:

  • available:(必需)设置为 1true,以指明费率是否允许全额退款;否则设置为 0false
  • refundable_until_days:(如果 availabletrue,则为必需)指定可在入住前多少天申请全额退款。refundable_until_days 的值必须是 0 到 330(含 0 和 330)之间的整数。
  • refundable_until_time:(如果 availabletrue,则强烈建议提供) 以酒店的当地时间指定最晚在一天中的什么时间支持全额退款。该属性可与 refundable_until_days 结合使用,例如指定“退款截止时间为入住前两天下午 4:00”。如果未设置 refundable_until_time,则该值默认为午夜。

    此属性的值使用时间格式。

设置属性时,请注意以下事项:

  • 如果未设置 availablerefundable_until_days,则费率不会显示为可退款。
  • 如果 available0false,则系统会忽略其他属性。即使设置了其中一个或两个属性,费率也不会显示为可退款。
<MembershipBenefits Included> Optional boolean 房价包含入住期间的精英会员福利。包含以下参数:
  • ProgramName:精英资质计划的名称
  • ProgramLevel:节目的级别,例如“黄金。”
  • NightlyValue (optional):每晚福利价值。
<CarRentalIncluded> Optional boolean 房价包含住宿期间的免费租车费用。
<MilesIncluded>> Optional boolean 房价包含常客飞行里程数。参数包括:
  • NumberofMiles:每条行程的英里数。
  • Provider:提供飞行常客奖励计划的里程数。
<OnPropertyCredit> Optional boolean 房价包含酒店住宿赠金(餐饮、度假村、水疗中心等)。参数:
  • Amount:每个行程的赠金值,以本地货币计算。
<AirportTransportationIncluded> Optional Object 房费包含往返附近机场的免费交通工具。可选的 direction 属性用于指定交通的方向。有效值包括:
    from:提供从机场到酒店的交通服务。如果未指定方向,则此值为默认值。 to:提供从属性到机场的接送服务。 round_trip:提供往返机场的交通服务。

示例

单间客房套餐

以下示例定义了一个客房套餐,入住人数为 2 人(1 名成人 + 1 名儿童),含早餐:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>1234</Property>
    <PackageData>
      <Occupancy>2</Occupancy>
      <OccupancyDetails>
        <NumAdults>1</NumAdults>
        <Children>
          <Child age="17"/>
        </Children>
      </OccupancyDetails>
      <PackageID>P54321</PackageID>
      <Name>
         <Text text="Breakfast Included" language="en"/>
         <Text text="Avec le petit déjeuner" language="fr"/>
      </Name>
      <Description>
        <Text text="Two certificates for continental
          breakfast will be provided." language="en"/>
        <Text text="Deux certificats pour le petit déjeuner
          continental seront fournis." language="fr"/>
      </Description>
      <BreakfastIncluded>1</BreakfastIncluded>
    </PackageData>
  </PropertyDataSet>
</Transaction>

Room 和软件包元数据

以下示例定义了会议室和软件包元数据:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>180054</Property>
    <RoomData>
      <RoomID>060773</RoomID>
      <Name>
        <Text text="Single Bed Room" language="en"/>
        <Text text="Chambre single" language="fr"/>
      </Name>
      <Description>
        <Text text="Non-smoking" language="en"/>
        <Text text="Pas de fumiers" language="fr"/>
      </Description>
      <PhotoURL>
        <Caption>
          <Text text="Living area" language="en"/>
          <Text text="Le chambre" language="fr"/>
        </Caption>
        <URL>http://www.foo.com/static/bar/image1234.jpg</URL>
      </PhotoURL>
    </RoomData>
    <PackageData>
      <PackageID>P54321</PackageID>
      <Name>
        <Text text="Breakfast Included" language="en"/>
        <Text text="Avec le petit déjeuner" language="fr"/>
      </Name>
      <Description>
        <Text text="Includes a delightful array of jams and jellies." language="en"/>
        <Text text="Comprend une délicieuse gamme de confitures et gelées." language="fr"/>
      </Description>
      <BreakfastIncluded>1</BreakfastIncluded>
    </PackageData>
  </PropertyDataSet>
</Transaction>

多个客房套餐

以下示例定义了多个 Room 软件包的 Room 和软件包元数据:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
  <!-- A transaction message with room types result. -->
  <PropertyDataSet>
    <Property>12345</Property>
    <RoomData>
      <RoomID>single</RoomID>
      <Name>
        <Text text="Single room" language="en"/>
        <Text text="Chambre simple" language="fr"/>
      </Name>
      <Description>
        <Text text="A single room" language="en"/>
        <Text text="Le chambre simple" language="fr"/>
      </Description>
      <PhotoURL>
        <Caption>
          <Text text="Living area" language="en"/>
          <Text text="Le chambre" language="fr"/>
        </Caption>
        <URL>http://www.foo.com/static/bar/image1234.jpg</URL>
      </PhotoURL>
      <PhotoURL>
        <URL>http://www.foo.com/static/bar/image1235.jpg</URL>
      </PhotoURL>
      <Capacity>2</Capacity>
    </RoomData>
    <RoomData>
      <RoomID>double</RoomID>
      <Name>
        <Text text="Double room" language="en"/>
        <Text text="Chambre double" language="fr"/>
      </Name>
      <Occupancy>1</Occupancy>
    </RoomData>
    <PackageData>
      <PackageID>refundbreakfast</PackageID>
      <Name>
        <Text text="Refundable Room with Breakfast" language="en"/>
        <Text text="Chambre remboursable avec le petit déjeuner" language="fr"/>
      </Name>
      <Description>
        <Text text="Continental Breakfast" language="en"/>
        <Text text="Petit déjeuner continental" language="fr"/>
      </Description>
      <ChargeCurrency>hotel</ChargeCurrency>
      <Refundable available="1" refundable_until_days="3"/>
      <BreakfastIncluded>1</BreakfastIncluded>
    </PackageData>
    <PackageData>
      <PackageID>prepaid</PackageID>
      <Name>
        <Text text="Nonrefundable" language="en"/>
        <Text text="Non remboursable" language="fr"/>
      </Name>
      <Description>
        <Text text="Blah blah blad" language="en"/>
        <Text text="Le blah blah blad" language="fr"/>
      </Description>
      <Occupancy>2</Occupancy>
      <ChargeCurrency>web</ChargeCurrency>
      <Refundable available="0"/>
    </PackageData>
  </PropertyDataSet>
</Transaction>


含房价的客房套餐

以下示例定义了包含房价功能的客房套餐的客房和套餐元数据:

<Transaction timestamp="2010-04-24T20:44:56-04:00" id="TXNID">
  <PropertyDataSet>
    <Property>12345</Property>
    <RoomData>
     ...
    </RoomData>
<!-- definitions of PackageData types including rate features -->
    <PackageData>
      <PackageID>room_with_addl_benefits</PackageID>
      <Name>
        <Text text="Acme Hotels 2017 Promotion Package" language="en"/>
      </Name>
      <ChargeCurrency>hotel</ChargeCurrency>
      <BreakfastIncluded>1</BreakfastIncluded>
      <MembershipBenefitsIncluded>
        <ProgramName>
          <Text language="en" text="Marriott Rewards"/>
        </ProgramName>
        <ProgramLevel>
          <Text language="en" text="Platinum"/>
        </ProgramLevel>
      </MembershipBenefitsIncluded>
      <OnPropertyCredit>
        <Amount currency="USD">123.45</Amount>
      </OnPropertyCredit>
    </PackageData>
    <PackageData>
      <PackageID>room_with_miles</PackageID>
      <Name>
        <Text text="Room with Bundled Miles" language="en"/>
      </Name>
      <ChargeCurrency>hotel</ChargeCurrency>
      <MilesIncluded>
        <NumberOfMiles>1000</NumberOfMiles>
        <Provider>
          <Text language="en" text="United Airlines"/>
        </Provider>
      </MilesIncluded>
      <AirportTransportationIncluded direction="from"/>
    </PackageData>
  </PropertyDataSet>

<!-- The actual list of prices -->
  <Result>
…
  </Result>
</Transaction>

餐食与照片

以下示例定义了用餐、照片以及入住和退房时间的房间和套餐元数据:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>1234</Property>
    <PackageData>
      <PhotoURL>
        <Caption>
          <Text text="Breakfast" language="en"/>
          <Text text="朝食" language="ja"/>
        </Caption>
        <URL>http://example.com/static/bar/image1234.jpg</URL>
      </PhotoURL>
      <Meals>
        <!-- Guests can choose to have breakfast in their room or in another
        space to avoid contact with other guests. -->
        <Breakfast included="1" in_room="1" in_private_space="1"/>
        <Dinner included="1" buffet="1"/>
      </Meals>
      <CheckinTime>15:00</CheckinTime>
      <CheckoutTime>11:00</CheckoutTime>
    </PackageData>
  </PropertyDataSet>
</Transaction>

早餐

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
  <PropertyDataSet>
    <Property>1234</Property>
    <PackageData>
      <PhotoURL>
        <Caption>
          <Text text="Breakfast" language="en"/>
          <Text text="朝食" language="ja"/>
        </Caption>
        <URL>http://example.com/static/bar/image1234.jpg</URL>
      </PhotoURL>
      <Meals>
        <Breakfast included="true"/>
        <!-- Dinner not included needs to be explicitly specified -->
        <Dinner included="false"/>
      </Meals>
      <CheckinTime>15:00</CheckinTime>
      <CheckoutTime>11:00</CheckoutTime>
    </PackageData>
  </PropertyDataSet>
</Transaction>

<Result>

<Transaction> 消息中用于存储价格和库存状况更新的容器。

<Result> 元素显示在交易消息 XML 层次结构中的以下位置:

+ <Transaction>
    + <PropertyDataSet>  // Room and package metadata
        + <Property>
        + <RoomData>
        + <PackageData>
    + <Result>           // Pricing and availability
        + <Rates>
        + <RoomBundle>
        + ...

使用 <Result> 设置或更新客房价格以及定义空房库存。此元素中定义的项通常引用 <PackageData><RoomData> 中定义的有关客房或套餐的独立于行程的元数据(例如说明或一组酒店设施)。

您通常非常频繁地发送包含价格更新的事务消息。此操作的确切方式和频率取决于您的投放模式

您可以在交易消息中使用 <Result> 移除行程,如移除广告资源中所述。如需详细了解如何使用交易消息更新价格和空房情况,请参阅添加和更新商品目录

一条事务消息可以包含任意数量的 <Result> 元素,只要消息大小不超过 100 MB 即可。

语法

<Result> 元素使用以下语法:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction ... >
  <Result>
    <!-- Required -->
    <Property>hotel_ID</Property>
    <!-- Required -->
    <Checkin>YYYY-MM-DD</Checkin>
    <!-- Required -->
    <Nights>number_of_nights</Nights>

    <Baserate currency="currency_code">price</Baserate>
    <!-- Only required when <Baserate> contains a real price -->
    <Tax currency="currency_code">tax_amount</Tax>
    <!-- Only required when <Baserate> contains a real price  -->
    <OtherFees currency="currency_code">fee_amount</OtherFees>
    <Refundable available="[false|true]" refundable_until_days="number_of_days"
      refundable_until_time="time"/>

    <RoomID>room_ID</RoomID>
    <PackageID>package_ID</PackageID>
    <ExpirationTime>expiration_time</ExpirationTime>
    <ChargeCurrency>[deposit|hotel|installments|web]</ChargeCurrency>

    <Occupancy>max_number_of_intended_occupants</Occupancy>
    <!-- For Baserate, occupancy value must be greater than or equal to 2.
         If a value is not provided for occupancy, it defaults to 2. -->
    <OccupancyDetails>occupancy_info</OccupancyDetails>

    <Rates>...</Rates>

    <RoomBundle>...</RoomBundle>

    <AllowablePointsOfSale>
      <PointOfSale id="landing_page_identifier"/>
      ...
    </AllowablePointsOfSale>

    <Custom[1-5]>custom_value</Custom[1-5]>
  </Result>
  ...
  </Transaction>

属性

<Result> 元素具有以下属性:

特性 是否必需? 类型 说明
mergeable Optional boolean 默认情况下,特定酒店和行程组合的新价格将覆盖 Google 缓存中存在的所有先前(未过期)的价格。借助可合并的属性,您可以将其他价格存储在 Google 的缓存中,而无需删除先前的价格信息。无论您的交易消息响应如何,具有上下文响应的实时价格查询将始终将此属性设置为 true

子元素

<Result> 元素具有以下子元素:

子元素 是否必需? 类型 说明
<AllowablePointsOfSale> Optional Object 符合酒店条件的一个或多个着陆页。着陆页是指能够为最终用户处理预订流程的网站。如需明确包含特定着陆页(并排除其他着陆页),请在着陆页文件中添加一个或多个与 <PointOfSale> 元素的 id 属性匹配的 <AllowablePointsOfSale> 元素。

如果您不添加此元素,则着陆页文件中定义的所有着陆页都会被视为可用于预订房间。如需了解详情,请参阅着陆页文件语法

<Baserate> Optional float 住宿期间的客房价格。此元素的值应反映以下内容:

  • 对于私人单间,请设置您提供的最便宜的双人间费率。
  • 对于共享聊天室,请将此字段留空并使用 <RoomBundle>
  • 住宿总长度,而不是平均每晚房价。

当行程无法提供会议室时,应省略 <Baserate> 或将其设置为 -1,同时指定 <Unavailable>,并说明可能导致不可用的所有已知原因。

如需移除客房套餐,请按照移除客房套餐中的说明操作。

<Baserate> 不得包含任何数字分组符号,例如逗号 (,) 或句点 (.)。务必使用句点 (.) 作为小数点来分隔小数。例如,将 $1,200.40 表示为:

<Baserate currency="USD">1200.40</Baserate>

<Baserate> 元素采用以下可选属性:

  • all_inclusive:一个布尔值,表示此费率是否包含税费及其他费用。通常,对于美国和加拿大最终用户,应将此值设置为 false,并为 <Tax><OtherFees> 元素提供值。如果您使用的是全包价,且未区分美国和加拿大用户的税费和其他费用,则您的价格可能不符合在商品详情中显示的条件。

    对于所有其他最终用户,您通常需要在基本费率中包含税费和其他费用,并将 all_inclusive 属性的值设置为 true。如需了解详情,请参阅税费和其他费用政策

    默认值为 false

  • currency:由三个字母组成的货币代码。例如,USD 表示美元。
<ChargeCurrency> Optional enum 用户支付预订费用的时间和地点。此元素可以用在酒店价格块或客房套餐的 <PackageData> 块的 <Result> 元素中的交易消息中。

有效值包括:

  • web:系统会在用户预订时在线向用户收取费用。 此设置为默认值。 实际着陆页由着陆页文件定义,可能会受用户的币种、地理位置、语言或其他因素的影响。
  • hotel:用户在酒店入住时需要支付费用。如果付款必须始终以酒店的币种付款,请将 <ChargeCurrency> 的值设为 hotel。实际着陆页不会受用户所用币种的影响。
  • deposit:立即向用户收取部分费用,剩余费用则会在稍后的时间点(通常是在用户退房时)收取。
  • installments:用户需要支付应付总额的初始部分,并且预计会在固定的时间段内定期支付设定的余额。

默认值为 web

<Checkin> Required Date 行程的入住日期,使用日期格式。<Nights> 元素和 <Checkin> 元素的组合构成一个行程。
<Custom[1‑5]> Optional string 定义一个自定义字段,您可以使用该字段传递与酒店相关联的其他数据。您最多可以通过以下元素名称传递五个自定义值:
  • <Custom1>
  • <Custom2>
  • <Custom3>
  • <Custom4>
  • <Custom5>

您可以使用 <Custom> 元素传递任意数据。例如,您可以在此字段中指定一个值,然后着陆页文件将使用该值为着陆页构建自定义网址。每个自定义字段的字符数上限为 200。如需了解详情,请参阅着陆页文件

<Rate> 元素中提供的 <Custom> 元素不会继承到 <RoomBundle> 元素。您应该在每个 <RoomBundle> 中分别定义 <Custom> 属性。

<ExpirationTime> Optional DateTime 价格被视为已过期的日期和时间(最短 3 小时)。

如果到期时间戳对您的价格结构不重要,我们建议您不要提供时间戳。

Google 不会提供任何已过期的价格,并且任何已过期的行程都将符合实时价格查询的条件。

<Nights> Required integer 行程的住宿晚数。<Nights> 元素的值必须是正整数。 <Nights><Checkin> 的组合构成了行程。
<OtherFees> Optional float 影响客房最终价格的费用(基本费率和税费除外)。<OtherFees> 元素接受一个必需属性 currency,该属性定义了费用的三个字母货币代码。例如 USD

如果 <Baserate> 大于零,则必须包含 <OtherFees> 元素。

<Occupancy> Optional integer 指定入住人数上限。 当 <Occupancy> 显示在 <Result> 下时,它必须指定 2 或更多值。<Occupancy> 可以带有 <OccupancyDetails>,用于指定宾客类型(成人或儿童)。如需了解子元素的语法和说明,请参阅 <OccupancyDetails>。如果未提供 <Occupancy> 元素,则默认入住人数为 2

注意:如需启用此功能来发送非双人入住价格,请与您的支持团队联系。

<PackageID> Optional string 软件包的唯一 ID,用于将其映射到预定义的软件包数据。 也用于填充 PACKAGE-ID 着陆页变量。 如需了解详情,请参阅 Room 软件包元数据
<Property> Required string 受关联数据(价格、行程、客房套餐或元数据)影响的酒店的 ID。此元素的值必须是字符串。此元素的值必须与您在酒店列表 Feed 中定义的房源信息 <id> 一致。
<Rates> Optional <Rates> 一个或多个 <Rate> 块的容器。<Rates> 中的每个 <Rate> 为客房/行程组合定义不同的价格。

仅当同一客房/行程组合有多种房价时,才使用 <Rates> 元素。例如,您可以为条件式费率不公开费率客房套餐中的条件式费率定义多个费率。

<Refundable> Optional Object 允许将房价列为可全额退款或提供免费取消服务。如果未提供,则不会显示任何退款信息。 <PackageData> 级别的退款政策会覆盖 <Result> 级别的退款政策。<Rates> 级别的退款政策会覆盖 <PackageData> 级别的退款政策。您还可以通过替代选项向用户突出显示可退款价格,而无需直接修改交易消息架构。如需详细了解这些选项,请点击此处

以下示例显示了设置了其所有属性的 <Refundable> 元素:

<Refundable available="1" refundable_until_days="7"
refundable_until_time="18:00:00"/>

注意:我们建议您设置所有属性。如果一个或多个属性未设置,系统会生成一条 Feed 状态警告消息。

如果您未设置任何属性,则费率不会显示为可退款。这些属性包括:

  • available:(必需)设置为 1(或 true),以指明费率是否允许全额退款;否则设置为 0(或 false)。
  • refundable_until_days:(如果 availabletrue,则为必需)指定可在入住前多少天申请全额退款。refundable_until_days 的值必须是 0 到 330(含 0 和 330)之间的整数。
  • refundable_until_time:(如果 availabletrue,则强烈建议提供) 以酒店的当地时间指定最晚在一天中的什么时间支持全额退款。该属性可与 refundable_until_days 结合使用,例如指定“退款截止时间为入住前两天下午 4:00”。如果未设置 refundable_until_time,则该值默认为午夜。

    此属性的值使用时间格式。

设置属性时,请注意以下事项:

  • 如果未设置 availablerefundable_until_days,则费率不会显示为可退款。
  • 如果 available0(或 false),则系统会忽略其他属性。即使设置了其中一个或两个属性,费率也不会显示为可退款。
<RoomBundle> Optional <RoomBundle> 一个容器,用于存储有关特定酒店和行程的带价客房实物说明、任何设施包装以及一些购买政策详情的信息。

通常,可使用此元素为基本房间和同一酒店内不同类型的客房定义价格。虽然可以内嵌定义客房套餐说明,但您应使用单独的交易消息来定义该信息。Google 将存储元数据,以便您在未来的所有价格更新中引用(而不是重复)元数据。

<RoomID> Optional string 会议室的唯一 ID,用于将其映射到预定义的会议室数据。还用于填充 PARTNER-ROOM-ID 着陆页变量。 如需了解详情,请参阅 Room 软件包元数据
<Tax> Optional float 针对客房最终价格计算的税费。 <Tax> 元素接受一个必需属性 currency,该属性用于定义税费的三个字母货币代码。例如 USD。如果 <Baserate> 大于零,则必须包含 <Tax> 元素。
<Unavailable> Optional Object 表示此行程不可预订。充当容器,用于详细说明行程不可用的原因。以下一个或多个不可用原因可能会嵌套在 <Unavailable> 标记下:
  • <NoVacancy/>:入住一晚或多晚没有更多可供出售的客房。
  • <MinNightStay value=N/>:行程低于住宿日期的最短住宿晚数(N)。
  • <MaxNightStay value=N/>:行程超出了住宿日期的最长住宿晚数(N)。
  • <MinAdvancePurchase value=N/>:行程低于住宿日期的最短提前预订期限(N)。
  • <MaxAdvancePurchase value=N/>:该行程超出了入住日期的提前预订期限最长 N
  • <ClosedToArrival/>:房源不允许在行程的到达日期办理入住。
  • <ClosedToDeparture/>:房源不允许在行程的出发日期退房。
  • <PropertyClosed first_open="YYYY-MM-DD" first_closed="YYYY-MM-DD"/>:酒店在部分入住或全部住宿期间停业。推荐属性 first_openfirst_closed 分别指定不早于房源开始营业或结束营业的抵达日期的第一个日期。 对于在入住日期之后关闭的房源,first_open 应等于入住日期,first_closed 应为房源的关闭日期。对于在入住日关闭的房源,first_closed 应等于入住日期,first_opened 应为房源的下一个营业日期。
  • <NotFetched/>:下游数据源未提供行程的价格。
  • <InvalidProperty/>:无法识别请求的媒体资源标识符。
  • <InvalidOccupancy/>:房源不支持请求的入住人数。
  • <PriceIssue/>:价格问题导致其无法发送。
  • <InternalError reason=""/>:发生了一些未枚举的错误。可选的原因属性能够以文本形式报告错误。
  • <OtherRestriction restriction=""/>:由于存在某些未枚举的预订限制,行程不可用。可选的限制属性允许以文本形式报告限制。

示例

多媒体资源示例

以下示例定义了一个行程及其针对两个房源的价格:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-23T16:20:00-04:00" id="42">
  <Result>
    <Property>060773</Property>
    <RoomID>RoomType101</RoomID>
    <PackageID>Package101</PackageID>
    <Checkin>2018-06-10</Checkin>
    <Nights>2</Nights>
    <Baserate currency="USD">278.33</Baserate>
    <Tax currency="USD">25.12</Tax>
    <OtherFees currency="USD">2.00</OtherFees>
    <AllowablePointsOfSale>
      <PointOfSale id="site1"/>
    </AllowablePointsOfSale>
  </Result>
  <Result>
    <Property>052213</Property>
    <RoomID>RoomType101</RoomID>
    <PackageID>Package101</PackageID>
    <Checkin>2018-06-10</Checkin>
    <Nights>2</Nights>
    <Baserate currency="USD">299.98</Baserate>
    <Tax currency="USD">26.42</Tax>
    <OtherFees currency="USD">2.00</OtherFees>
    <AllowablePointsOfSale>
      <PointOfSale id="otto"/>
      <PointOfSale id="simon"/>
    </AllowablePointsOfSale>
  </Result>
</Transaction>

此示例中未显示房间的详细信息,例如说明、图片和说明、房间名称及其容纳人数。

您可以在 Google 存储的单独交易消息中定义该信息一次。然后,您可以在所有后续的价格和库存更新中引用它。如需了解详情,请参阅 Room 软件包元数据

多费率示例

以下示例定义了针对不同入住人数提供多种费率的单个行程和房源。<Rates> 元素可用于为特定房源提供多费率价格。以下示例对于民宿 (VR) 媒体资源也很有用。

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2020-07-23T16:20:00-04:00" id="42">
  <Result>
    <Property>1234</Property>
    <Checkin>2021-01-13</Checkin>
    <Nights>9</Nights>
    <Baserate currency="USD">3196.1</Baserate>
    <Tax currency="USD">559.49</Tax>
    <OtherFees currency="USD">543.34</OtherFees>
    <Occupancy>2</Occupancy>
    <Rates>
      <Rate>
        <Baserate currency="USD">3196.1</Baserate>
        <Tax currency="USD">559.49</Tax>
        <OtherFees currency="USD">543.34</OtherFees>
        <Occupancy>1</Occupancy>
      </Rate>
      <Rate>
        <Baserate currency="USD">3196.1</Baserate>
        <Tax currency="USD">559.49</Tax>
        <OtherFees currency="USD">543.34</OtherFees>
        <Occupancy>3</Occupancy>
      </Rate>
      <Rate>
        <Baserate currency="USD">3196.1</Baserate>
        <Tax currency="USD">559.49</Tax>
        <OtherFees currency="USD">543.34</OtherFees>
        <Occupancy>4</Occupancy>
      </Rate>
      <Rate>
        <Baserate currency="USD">3196.1</Baserate>
        <Tax currency="USD">559.49</Tax>
        <OtherFees currency="USD">543.34</OtherFees>
        <Occupancy>5</Occupancy>
      </Rate>
      <Rate>
        <Baserate currency="USD">3196.1</Baserate>
        <Tax currency="USD">559.49</Tax>
        <OtherFees currency="USD">543.34</OtherFees>
        <Occupancy>6</Occupancy>
      </Rate>
    </Rates>
  </Result>
</Transaction>

不可用的示例

以下示例定义了一个行程的空房情况无法从下游渠道检索,第二个行程低于最短住宿晚数且已针对指定日期预订;第三个行程的属性在入住日期关闭,但在入住期间打开:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-23T16:20:00-04:00" id="42">
  <Result>
    <Property>060773</Property>
    <Checkin>2018-06-10</Checkin>
    <Nights>2</Nights>
    <Unavailable>
      <NotFetched/>
    </Unavailable>
  </Result>
  <Result>
    <Property>073313</Property>
    <Checkin>2018-06-10</Checkin>
    <Nights>2</Nights>
    <Unavailable>
      <NoVacancy/>
      <MinNightStay value=3/>
    </Unavailable>
  </Result>
  <Result>
    <Property>052213</Property>
    <Checkin>2018-06-10</Checkin>
    <Nights>10</Nights>
    <Unavailable>
      <PropertyClosed first_open="2018-06-15" first_closed="2018-06-10"/>
    </Unavailable>
  </Result>
</Transaction>

<Rates>

一个或多个 <Rate> 块的容器。<Rates> 中的每个 <Rate> 为客房/行程组合定义不同的价格。

仅当同一客房/行程组合有多种房价时,才使用 <Rates> 元素。例如,您可以为条件式费率不公开费率客房套餐中的条件式费率定义多个费率。

<Rates> 元素显示在交易消息 XML 层次结构中的以下位置:

+ <Transaction>
    + <PropertyDataSet>  // Room and package metadata
        + <Property>
        + <RoomData>
        + <PackageData>
    + <Result>           // Pricing and availability
        + <Rates>
        + <RoomBundle>           (Can also contain <Rates>)
        + ...

<Rate> 中设置的值会替换父 <Result><RoomBundle> 元素中与价格相关的值。如果未在 <Rate> 中设置这些值,则会继承父元素的值。只有 <AllowablePointsofSale> 会继承到 <RoomBundle> 元素。

语法

<Rates> 元素使用以下语法:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction ... >
  <Result>
    <Rates>
      <Rate rate_rule_id="rate_rule_id">
        <Baserate currency="currency_code">price</Baserate>
        <Tax currency="currency_code">tax_amount</Tax>
        <OtherFees currency="currency_code">fee_amount</OtherFees>
        <ExpirationTime>expiration_time</ExpirationTime>
        <Refundable available="[false|true]" refundable_until_days="number_of_days"
        refundable_until_time="time"/>
        <ChargeCurrency>[deposit|hotel|installments|web]</ChargeCurrency>
        <AllowablePointsOfSale>
          <PointOfSale id="landing_page_identifier"/>
        </AllowablePointsOfSale>
        <Occupancy>max_number_of_intended_occupants</Occupancy>
        <OccupancyDetails> <!-- optional info about the types of guests,
      whether adults or children --></OccupancyDetails>
          ...
        <Custom[1-5]>custom_value</Custom[1-5]>
      </Rate>
      ...
    </Rates>
  </Result>
  ...
</Transaction>

属性

<Rates> 元素具有以下属性:

特性 是否必需? 说明
rate_rule_id Optional 对于条件式费率,此 ID 会将费率与费率规则定义文件中的定义进行匹配。 此字段的字符数限制为 40。

子元素

<Rates> 元素具有以下子元素:

子元素 是否必需? 类型 说明
<AllowablePointsOfSale> Optional Object 符合酒店条件的一个或多个着陆页。此元素使用的语法与 <Result> 上的 <AllowablePointsOfSale> 相同。
<Baserate> Required float 住宿期间的客房价格。此元素使用的语法与 <Result> 上的 <Baserate> 相同。

注意:不能将 <Rate> 下的 <Baserate> 子元素定义为不可用。

<ChargeCurrency> Optional enum 用户支付预订费用的时间和地点。此元素使用的语法与 <Result> 中的 <ChargeCurrency> 相同。
<Custom[1‑5]> Optional string 自定义字段,可用于向着陆页传递与酒店相关的其他数据。此元素使用的语法与 <Result> 中的 <Custom[1‑5]> 相同。每个自定义字段的字符数上限为 200。如需了解详情,请参阅着陆页文件

如果 <Result> 元素中提供了 <Custom> 元素,则这些元素不会在 <RoomBundle> 元素中继承,因此应单独为每个 <RoomBundle> 定义,或者也可以根据需要将其包含在 <PackageData> 中。

<ExpirationTime> Optional DateTime 费率被视为已过期的日期和时间。此元素使用的语法与 <Result> 中的 <ExpirationTime> 相同。
<Occupancy> Optional integer

指定入住人数上限。 <Occupancy> 可能会附带 <OccupancyDetails>,用于指定房客类型(成人或儿童)。如需了解子元素的语法和说明,请参阅 <OccupancyDetails>

<OtherFees> Required float 影响客房最终价格的费用(基本费率和税费除外)。此元素使用的语法与 <Result> 中的 <OtherFees> 相同。
<Refundable> Optional Object 允许将房价列为可全额退款或提供免费取消服务。如果未提供,则不会显示任何退款信息。 <PackageData> 级别的退款政策会覆盖 <Result> 级别的退款政策。<Rates> 级别的退款政策会覆盖 <PackageData> 级别的退款政策。您还可以通过替代选项向用户突出显示可退款价格,而无需直接修改交易消息架构。如需详细了解这些选项,请点击此处

以下示例显示了设置了其所有属性的 <Refundable> 元素:

<Refundable available="1" refundable_until_days="7"
refundable_until_time="18:00:00"/>

注意:我们建议您设置所有属性。如果一个或多个属性未设置,系统会生成一条 Feed 状态警告消息。

如果您未设置任何属性,则费率不会显示为可退款。这些属性包括:

  • available:(必需)设置为 1(或 true),以指明费率是否允许全额退款;否则设置为 0(或 false)。
  • refundable_until_days:(如果 availabletrue,则为必需)指定可在入住前多少天申请全额退款。refundable_until_days 的值必须是 0 到 330(含 0 和 330)之间的整数。
  • refundable_until_time:(如果 availabletrue,则强烈建议提供) 以酒店的当地时间指定最晚在一天中的什么时间支持全额退款。该属性可与 refundable_until_days 结合使用,例如指定“退款截止时间为入住前两天下午 4:00”。如果未设置 refundable_until_time,则该值默认为午夜。

    此属性的值使用时间格式。

设置属性时,请注意以下事项:

  • 如果未设置 availablerefundable_until_days,则费率不会显示为可退款。
  • 如果 available0(或 false),则系统会忽略其他属性。即使设置了其中一个或两个属性,费率也不会显示为可退款。
<Tax> Required float 针对客房最终价格计算的税费。此元素使用的语法与 <Result> 中的 <Tax> 相同。

示例

基本费率和条件式费率

以下示例展示了包含基本费率和条件式费率的交易消息:

<?xml version="1.0" encoding="UTF-8" ?>
<Transaction timestamp="2023-05-18T16:20:00-04:00" id="42">
  <Result>
    <Property>1234</Property>
    <Checkin>2023-04-10</Checkin>
    <Nights>1</Nights>

    <Baserate currency="USD">200.00</Baserate>
    <Tax currency="USD">20.00</Tax>
    <OtherFees currency="USD">1.00</OtherFees>

    <Rates>
      <!-- The rate_rule_id is required when using conditional rates -->
      <Rate rate_rule_id="mobile">
        <!-- Override base rate and taxes for conditional rates -->
        <Baserate currency="USD">180.00</Baserate>
        <Tax currency="USD">18.00</Tax>
        <!-- NOTE: OtherFees is inherited from the above setting -->
        <Custom1>ratecode123</Custom1>
      </Rate>
    </Rates>

  </Result>
</Transaction>

多个条件式费率

以下示例定义了一个 <RoomBundle> 中的一个基本费率和多个条件式费率:

<?xml version="1.0" encoding="UTF-8" ?>
<Transaction timestamp="2023-05-18T16:20:00-04:00" id="42">
  <Result>
    <Property>1234</Property>
    <Checkin>2023-04-10</Checkin>
    <Nights>2</Nights>
    <!-- When Google receives new room bundle information for an itinerary, all
    previous room bundle pricing is dropped from Google's cache. Thus, if you
    want to delete a specific room bundle from Google's cache, you may do so
    by simply not providing that specific room bundle in subsequent transaction
    messages. -->
    <RoomBundle>
     ...
      <!-- RoomID is required, PackageID is recommended. -->
      <RoomID>5</RoomID>
      <PackageID>ABC</PackageID>
      <!-- Baserate is required. -->
      <Baserate currency="USD">275.00</Baserate>
      <Tax currency="USD">27.50</Tax>
      <OtherFees currency="USD">2.00</OtherFees>

      <!-- RatePlanID is optional and represents the unique identifier for a
      room and package data combination. We strongly recommend using RatePlanID
      as a variable to build your dynamic landing page (formerly Point of Sale)
      URL. For details, see Using Variables and Conditions. -->
      <RatePlanID>5-ABC</RatePlanID>

      <!-- Occupancy is mandatory for RoomBundle elements. -->
      <!-- Elements below will get inherited to nested rate elements. -->
      <Occupancy>2</Occupancy>
      <OccupancyDetails>
        <NumAdults>2</NumAdults>
      </OccupancyDetails>
      <InternetIncluded>1</InternetIncluded>


      <!-- Rate rule "mobile" overrides chargeCurrency, "us_or_gb" doesn't. -->
      <ChargeCurrency>web</ChargeCurrency>
      <Custom1>ratebasic</Custom1>
      <!-- Neither rate overrides Custom2. -->
      <Custom2>ratebasic</Custom2>

      <Rates>
        <Rate rate_rule_id="mobile">
          <Baserate currency="USD">258.33</Baserate>
          <Tax currency="USD">25.83</Tax>
          <OtherFees currency="USD">1.00</OtherFees>
          <!-- The value below overrides ChargeCurrency from roombundle. -->
          <ChargeCurrency>hotel</ChargeCurrency>
          <!-- The value below overrides Custom1 from roombundle. -->
          <Custom1>ratecode321</Custom1>
          <!-- Custom2 is inherited from roombundle. -->
        </Rate>
        <Rate rate_rule_id="us_or_gb">
          <Baserate currency="USD">268.33</Baserate>
          <Tax currency="USD">26.83</Tax>
          <OtherFees currency="USD">1.00</OtherFees>
          <!-- The value below overrides Custom1 from roombundle. -->
          <Custom1>ratecode432</Custom1>
          <!-- Custom2 is inherited from roombundle. -->
        </Rate>
      </Rates>
    </RoomBundle>
  </Result>
</Transaction>

<RoomBundle>

<Transaction> 消息中将客房套餐的价格和空房情况定义为 <Result> 的子级。为每个软件包/行程组合定义一个单独的元素。如需定义 Room 软件包的软件包和术语,请使用 <RoomData>

<RoomBundle> 元素显示在交易消息 XML 层次结构中的以下位置:

+ <Transaction>
    + <PropertyDataSet>  // Room and package metadata
        + <Property>
        + <RoomData>
        + <PackageData>
    + <Result>           // Pricing and availability
        + <Rates>
        + <RoomBundle>
        + ...

如需了解详情,请参阅使用客房套餐

语法

<RoomBundle> 元素使用以下语法:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction ... >
  <Result>
    ...
    <RoomBundle>
      <!-- Required unless specified inline under <RoomData> -->
      <RoomID>room_ID</RoomID>
      <!-- Required  <PackageData> -->
      <PackageID>package_ID</PackageID>

      <!-- Required -->
      <Baserate currency="currency_code">price</Baserate>
      <!-- Required -->
      <Tax currency="currency_code">taxes</Tax>
      <!-- Required -->
      <OtherFees currency="currency_code">other_fees</OtherFees>

      <Refundable available="[false|true]" refundable_until_days="number_of_days"
        refundable_until_time="time"/>
      <!-- Required -->
      <ChargeCurrency>[deposit|hotel|installments|web]</ChargeCurrency>
      <Occupancy>max_number_of_intended_occupants</Occupancy>
      <OccupancyDetails> <!-- optional info about the types of guests,
      whether adults or children --></OccupancyDetails>

      <BreakfastIncluded>boolean_value</BreakfastIncluded>
      <InternetIncluded>boolean_value</InternetIncluded>
      <ParkingIncluded>boolean_value</ParkingIncluded>

      <RatePlanID>rate_plan_ID</RatePlanID>

      <Rates>...</Rates>

      <Custom1>custom_value_1</Custom1>
      <Custom2>custom_value_2</Custom2>
      <Custom3>custom_value_3</Custom3>
      <Custom4>custom_value_4</Custom4>
      <Custom5>custom_value_5</Custom5>
    </RoomBundle>
    ...
  </Result>
</Transaction>

属性

<RoomBundle> 元素没有属性。

子元素

<RoomBundle> 元素具有以下子元素:

子元素 是否必需? 类型 说明
<Baserate> Required float 定义住宿期间客房套餐的价格。此元素的语法与 <Result> 中的 <Baserate> 相同,但存在以下例外:
  • 当该房间无法用于行程时,请移除 <RoomBundle> 元素以指明该房间已不在房源目录中。如需了解详情,请参阅移除 Room Bundle
<BreakfastIncluded> Optional boolean 指定此客房套餐是否包括含房价的早餐。
<ChargeCurrency> Optional enum 用户支付预订费用的时间和地点。此元素使用的语法与 <Result> 中的 <ChargeCurrency> 相同。

默认值为 web

<Custom[1‑5]> Optional string 用于将其他数据传递到客房套餐的着陆页的自定义字段。这些元素使用的语法与 <Result> 中的 <Custom[1-5]> 相同。每个自定义字段的字符数上限为 200。如需了解详情,请参阅着陆页文件

如果 <Result> 元素中提供了 <Custom> 元素,则这些元素不会在 <RoomBundle> 元素中继承,因此应单独为每个 <RoomBundle> 定义,或者也可以根据需要将其包含在 <PackageData> 中。

<InternetIncluded> Optional boolean 如果某个客房套餐包含免费互联网连接,而其他套餐不包含该设施。如果酒店的所有客房均免费上网,请勿为客房套餐设置此元素。此元素不适用于客房内有线互联网或客房不支持的无线互联网。
<Occupancy> Required integer 提供客房套餐的房客人数上限。例如,大型套房实际可能能够容纳 6 位客人,但“蜜月套餐”仅适用于 2 位客人。

此值必须小于或等于 <Capacity>(房间可容纳的人数)。

在着陆页网址中定义入住人数时,请使用 NUM-ADULTSNUM-CHILDREN 变量,如使用变量和条件中所述。默认值为 2(成人)和 0(儿童)。

<Occupancy> 的值必须是 1-99(含)之间的正整数。

注意

  • 强烈建议将 <Occupancy> 用于 <RoomBundle>,因此应将其标记为必需,如果省略,将抛出 1097 错误。
  • <Occupancy> 按以下顺序来自数据对象:<RoomBundle><PackageData>,然后 <RoomData>。 如果上述类型中没有值,则默认值为 2。
  • <Occupancy> 可能会附带 <OccupancyDetails>,用于指定房客类型(成人或儿童)。如需了解子元素的语法和说明,请参阅 <OccupancyDetails>
  • 如果您同时在 <RoomBundle><PackageData> 中设置 <Occupancy>,则 <RoomBundle> 中的值优先。
<OtherFees> Required float 影响客房最终价格的费用(基本费率和税费除外)。<OtherFees> 元素接受一个必需属性 currency,该属性定义了费用的三个字母货币代码。例如,使用 USD 表示美元。
<PackageID> Optional (recommended) string 文件包数据的唯一 ID。使用此 ID 可将客房套餐数据与 <PackageData> 中发送的内容进行匹配。如需了解详情,请参阅 Room 软件包元数据。(以内嵌方式定义客房套餐数据时,您还可以使用此 ID 来引用单个事务消息中使用的通用客房套餐定义。)
<ParkingIncluded> Optional boolean 客房套餐是否包括免费停车位,以及此酒店的停车服务是否属于付费服务。对于提供免费停车位的酒店,请勿为此元素指定值。

有效值为 0(或 false)和 1(或 true)。默认值为 false

<RatePlanID> Optional string 费率方案 ID 表示客房和套餐组合的唯一标识符。例如,假设 <RoomID> 值为 5,<PackageID> 值为 ABC,您可以为 <RatePlanID> 使用值 5-ABC。我们强烈建议您使用 RatePlanID 作为变量来构建动态着陆页(以前称为“销售终端”)网址。

如需了解详情,请参阅使用变量和条件

<Rates> Optional <Rates> 系统会覆盖此客房套餐默认值的费率。此元素使用的语法与 <Result> 中的 <Rates> 相同。
<Refundable> Optional Object 允许将房价列为可全额退款或提供免费取消服务。如果未提供,则不会显示任何退款信息。 <PackageData> 级别的退款政策会覆盖 <Result> 级别的退款政策。<Rates> 级别的退款政策会覆盖 <PackageData> 级别的退款政策。您还可以通过替代选项向用户突出显示可退款价格,而无需直接修改交易消息架构。如需详细了解这些选项,请点击此处

以下示例显示了设置了其所有属性的 <Refundable> 元素:

<Refundable available="1" refundable_until_days="7"
refundable_until_time="18:00:00"/>

注意:我们建议您设置所有属性。如果一个或多个属性未设置,系统会生成一条 Feed 状态警告消息。

如果您未设置任何属性,则费率不会显示为可退款。这些属性包括:

  • available:(必需)设置为 1(或 true),以指明费率是否允许全额退款;否则设置为 0(或 false)。
  • refundable_until_days:(如果 availabletrue,则为必需)指定可在入住前多少天申请全额退款。refundable_until_days 的值必须是 0 到 330(含 0 和 330)之间的整数。
  • refundable_until_time:(如果 availabletrue,则强烈建议提供) 以酒店的当地时间指定最晚在一天中的什么时间支持全额退款。该属性可与 refundable_until_days 结合使用,例如指定“退款截止时间为入住前两天下午 4:00”。如果未设置 refundable_until_time,则该值默认为午夜。

    此属性的值使用时间格式。

设置属性时,请注意以下事项:

  • 如果未设置 availablerefundable_until_days,则费率不会显示为可退款。
  • 如果 available0(或 false),则系统会忽略其他属性。即使设置了其中一个或两个属性,费率也不会显示为可退款。
<RoomID> Required string 客房数据的唯一 ID。使用此 ID 可将客房套餐数据与您在 <RoomData> 中发送的数据进行匹配。如需了解详情,请参阅 Room 软件包元数据。 (在以内嵌方式定义会议室数据时,您还可以使用此 ID 引用单个交易消息中的通用会议室定义。)
<Tax> Required float 针对客房最终价格计算的税费。 <Tax> 元素接受一个必需属性 currency,该属性用于定义税费的三个字母货币代码。例如,使用 USD 表示美元。

示例

单人住宿套餐

以下示例定义了包含单个入住套餐的响应。 当用户在入住选择器中选择 1 时,无论入住人数如何,Google 都会显示最低的符合条件的价格。

如果未提供单人入住价格,Google 将显示最低的双人入住价格。请注意,如果为行程缓存了双人入住或更多价格,则系统不会实时查询单人入住价格。

此示例通过 <RoomID><PackageID> 元素引用了预定义的会议室和软件包元数据。请使用 <RoomData><PackageData> 元素定义该信息。

<!-- Efficient method of defining Room Bundles-->
<!----- Occupancy of 1 example ----->

<Transaction timestamp="2017-07-18T16:20:00-04:00" id="12345678">
  <!-- Part1: Define RoomData and PackageData in PropertyDataSet -->
  <!-- Note:  Once defined it does not have to be repeated for future
              Transaction Messages.
              PropertyDataSets can also be defined and sent in their own
              Transaction Message separately from pricing. Google can be
              configured to pull just PropertyDataSets once per day
              (or on a predefined frequency). -->
  <PropertyDataSet>
    <Property>180054</Property>
    <!-- Can be reused by multiple Room Bundles -->
    <RoomData>
      <RoomID>060773</RoomID>
      <Name>
        <Text text="Single Queen Room - Non-Smoking" language="en"/>
        <Text text="Chambre de la Roi Premium - Pas de Fumeurs" language="fr"/>
      </Name>
      <!-- Room can accommodate up to 4, but package data specifies occupancy
           between 1 to 4 -->
      <Capacity>4</Capacity>
    </RoomData>
    <RoomData>
      <RoomID>436233</RoomID>
      <Name>
        <Text text="Premium King Room - Non-Smoking" language="en"/>
        <Text text="Chambre de le Roi Premium - Pas de Fumeurs" language="fr"/>
      </Name>
      <Capacity>4</Capacity>
    </RoomData>
    <!-- Can be reused by multiple Room Bundles -->
    <PackageData>
      <PackageID>P11111</PackageID>
      <Occupancy>1</Occupancy>
      <ChargeCurrency>web</ChargeCurrency>
      <Refundable available="1" refundable_until_days="7"
           refundable_until_time="18:00:00"/>
      <ParkingIncluded>1</ParkingIncluded>
      <InternetIncluded>1</InternetIncluded>
    </PackageData>
    <PackageData>
      <PackageID>P54321</PackageID>
      <Occupancy>2</Occupancy>
      <ChargeCurrency>web</ChargeCurrency>
      <Refundable available="1" refundable_until_days="7"
           refundable_until_time="18:00:00"/>
      <ParkingIncluded>1</ParkingIncluded>
      <InternetIncluded>1</InternetIncluded>
    </PackageData>
    <PackageData>
      <PackageID>P12345</PackageID>
      <Occupancy>4</Occupancy>
      <ChargeCurrency>web</ChargeCurrency>
      <Refundable available="1" refundable_until_days="1"
           refundable_until_time="18:00:00"/>
      <ParkingIncluded>1</ParkingIncluded>
      <InternetIncluded>1</InternetIncluded>
    </PackageData>
  </PropertyDataSet>

    <!-- Efficient method of defining Room Bundles -->
    <!-- Part 2: Reference RoomData and PackageData through ID -->
  <Result>
    <!-- Single occupancy pricing will be specified in a room bundle below -->
    <Property>180054</Property>
    <Checkin>2017-10-07</Checkin>
    <Nights>2</Nights>
    <!-- Base Room Bundle -->
    <RoomBundle>
      <RoomID>060773</RoomID>
      <PackageID>P54321</PackageID>
      <Baserate currency="USD">199.99</Baserate>
      <Tax currency="USD">25.12</Tax>
      <OtherFees currency="USD">2.00</OtherFees>
      <RatePlanID>060773-P54321</RatePlanID>
    </RoomBundle>
    <RoomBundle>
      <RoomID>060773</RoomID>
      <PackageID>P11111</PackageID>
      <!-- Price for 1 ("occupancy") is the lowest price and will be
           displayed -->
      <Baserate currency="USD">174.99</Baserate>
      <Tax currency="USD">22.08</Tax>
      <OtherFees currency="USD">2.00</OtherFees>
      <RatePlanID>060773-P11111</RatePlanID>
    </RoomBundle>
    <!-- Premium Room Bundle -->
    <RoomBundle>
      <RoomID>436233</RoomID>
      <PackageID>P12345</PackageID>
      <!-- Price for 4 ("occupancy"), any eligible room bundle with 1 or more
           occupancy will be displayed-->
      <Baserate currency="USD">298.88</Baserate>
      <Tax currency="USD">42.12</Tax>
      <OtherFees currency="USD">10.00</OtherFees>
      <RatePlanID>436233-P12345</RatePlanID>
    </RoomBundle>
    <!-- ..Continue providing all available RoomBundle rates under matched
         property for 1 or more occupancies..-->
  </Result>
</Transaction>


两人或更多人

以下示例定义了包含两个或更多入住人数的响应。

此示例通过 <RoomID><PackageID> 元素引用了预定义的会议室和软件包元数据。请使用 <RoomData><PackageData> 元素定义该信息。

<!-- Efficient method of defining Room Bundles-->
<!----- Occupancy of 3 example ----->

<Transaction timestamp="2017-07-18T16:20:00-04:00" id="12345678">
  <!-- Efficient method of defining Room Bundles-->
  <!-- Part1: Define RoomData and PackageData in PropertyDataSet -->
  <PropertyDataSet>
    <Property>180054</Property>
    <!-- Can be reused by multiple Room Bundles -->
    <RoomData>
      <RoomID>060773</RoomID>
      <Name>
        <Text text="Single Queen Room - Non-Smoking" language="en"/>
        <Text text="Chambre de la Roi Premium - Pas de Fumeurs" language="fr"/>
      </Name>
      <!-- Room can accommodate up to 4, but package data specifies occupancy
           between 1 to 4 -->
      <Capacity>4</Capacity>
    </RoomData>
    <RoomData>
      <RoomID>436233</RoomID>
      <Name>
        <Text text="Premium King Room - Non-Smoking" language="en"/>
        <Text text="Chambre de le Roi Premium - Pas de Fumeurs" language="fr"/>
      </Name>
      <Capacity>4</Capacity>
    </RoomData>
    <!-- Can be reused by multiple Room Bundles -->
    <PackageData>
      <PackageID>P33333</PackageID>
      <Occupancy>3</Occupancy>
      <ChargeCurrency>web</ChargeCurrency>
      <Refundable available="1" refundable_until_days="7"
           refundable_until_time="18:00:00"/>
      <ParkingIncluded>1</ParkingIncluded>
      <InternetIncluded>1</InternetIncluded>
    </PackageData>
    <PackageData>
      <PackageID>P12345</PackageID>
      <Occupancy>4</Occupancy>
      <ChargeCurrency>web</ChargeCurrency>
      <Refundable available="1" refundable_until_days="1"
           refundable_until_time="18:00:00"/>
      <ParkingIncluded>1</ParkingIncluded>
      <InternetIncluded>1</InternetIncluded>
    </PackageData>
  </PropertyDataSet>

  <Result>
    <Property>180054</Property>
    <Checkin>2017-10-07</Checkin>
    <Nights>2</Nights>
    <!-- Efficient method of defining Room Bundles -->
    <!-- Part 2: Reference RoomData and PackageData through ID -->
    <!-- Base Room Bundle -->
    <RoomBundle>
      <!-- Baserate above and attributes must match atleast one room bundle
           below -->
      <RoomID>060773</RoomID>
      <PackageID>P33333</PackageID>
      <Baserate currency="USD">499.99</Baserate>
      <Tax currency="USD">55.12</Tax>
      <OtherFees currency="USD">22.00</OtherFees>
    </RoomBundle>
    <!-- Premium Room Bundle -->
    <RoomBundle>
      <RoomID>436233</RoomID>
      <PackageID>P12345</PackageID>
      <!-- Lowest price for 3 ("occupancy"), shown below, will be displayed -->
      <Baserate currency="USD">598.88</Baserate>
      <Tax currency="USD">62.12</Tax>
      <OtherFees currency="USD">30.00</OtherFees>
    </RoomBundle>
    <!-- ..Continue providing all available RoomBundle rates under matched
         property for 2 or more occupancies..-->
  </Result>
</Transaction>


多个客房套餐

以下示例在多个客房套餐中设置了入住人数,以展示可能的旅馆客房价格。

<?xml version="1.0" encoding="UTF-8"?>
<Transaction ... >
  <Result>
    ...
    <!-- Suite Room Bundle -->
    <RoomBundle>
      <RoomID>suite1</RoomID>
      <PackageID>standard</PackageID>
      <Occupancy>2</Occupancy>
      <!-- Price for room -->
      <Baserate currency="USD">80.00</Baserate>
      <Tax currency="USD">5.12</Tax>
      <OtherFees currency="USD">2.00</OtherFees>
      <RoomData>
        <Name>
          <Text text="Suite for 2" language="en"/>
        </Name>
      </RoomData>
    </RoomBundle>

    <!-- Small Dorm Room Bundle -->
    <RoomBundle>
      <RoomID>small_dorm</RoomID>
      <PackageID>economy</PackageID>
      <Occupancy>1</Occupancy>
      <!-- Price per bed -->
      <Baserate currency="USD">35.00</Baserate>
      <Tax currency="USD">3.50</Tax>
      <OtherFees currency="USD">2.00</OtherFees>
      <RoomData>
        <Name>
          <Text text="1 bed in small dorm" language="en"/>
        </Name>
      </RoomData>
    </RoomBundle>

    <!-- Large Dorm Room Bundle -->
    <RoomBundle>
      <RoomID>large_dorm</RoomID>
      <PackageID>economy</PackageID>
      <Occupancy>1</Occupancy>
      <!-- Price per bed -->
      <Baserate currency="USD">20.00</Baserate>
      <Tax currency="USD">2.50</Tax>
      <OtherFees currency="USD">2.00</OtherFees>
      <RoomData>
        <Name>
          <Text text="1 bed in large dorm" language="en"/>
        </Name>
      </RoomData>
    </RoomBundle>
    ...
  </Result>
</Transaction>

多种条件式费率

以下示例定义了一个 <RoomBundle> 中的一个基本费率和多个条件式费率:

<?xml version="1.0" encoding="UTF-8" ?>
<Transaction timestamp="2023-05-18T16:20:00-04:00" id="42">
  <Result>
    <Property>1234</Property>
    <Checkin>2023-04-10</Checkin>
    <Nights>2</Nights>
    <!-- When Google receives new room bundle information for an itinerary, all
    previous room bundle pricing is dropped from Google's cache. Thus, if you
    want to delete a specific room bundle from Google's cache, you may do so
    by simply not providing that specific room bundle in subsequent transaction
    messages. -->
    <RoomBundle>
     ...
      <!-- RoomID is required, PackageID is recommended. -->
      <RoomID>5</RoomID>
      <PackageID>ABC</PackageID>
      <!-- Baserate is required. -->
      <Baserate currency="USD">275.00</Baserate>
      <Tax currency="USD">27.50</Tax>
      <OtherFees currency="USD">2.00</OtherFees>

      <!-- RatePlanID is optional and represents the unique identifier for a
      room and package data combination. We strongly recommend using RatePlanID
      as a variable to build your dynamic landing page (formerly Point of Sale)
      URL. For details, see Using Variables and Conditions. -->
      <RatePlanID>5-ABC</RatePlanID>

      <!-- Occupancy is mandatory for RoomBundle elements. -->
      <!-- Elements below will get inherited to nested rate elements. -->
      <Occupancy>2</Occupancy>
      <OccupancyDetails>
        <NumAdults>2</NumAdults>
      </OccupancyDetails>
      <InternetIncluded>1</InternetIncluded>


      <!-- Rate rule "mobile" overrides chargeCurrency, "us_or_gb" doesn't. -->
      <ChargeCurrency>web</ChargeCurrency>
      <Custom1>ratebasic</Custom1>
      <!-- Neither rate overrides Custom2. -->
      <Custom2>ratebasic</Custom2>

      <Rates>
        <Rate rate_rule_id="mobile">
          <Baserate currency="USD">258.33</Baserate>
          <Tax currency="USD">25.83</Tax>
          <OtherFees currency="USD">1.00</OtherFees>
          <!-- The value below overrides ChargeCurrency from roombundle. -->
          <ChargeCurrency>hotel</ChargeCurrency>
          <!-- The value below overrides Custom1 from roombundle. -->
          <Custom1>ratecode321</Custom1>
          <!-- Custom2 is inherited from roombundle. -->
        </Rate>
        <Rate rate_rule_id="us_or_gb">
          <Baserate currency="USD">268.33</Baserate>
          <Tax currency="USD">26.83</Tax>
          <OtherFees currency="USD">1.00</OtherFees>
          <!-- The value below overrides Custom1 from roombundle. -->
          <Custom1>ratecode432</Custom1>
          <!-- Custom2 is inherited from roombundle. -->
        </Rate>
      </Rates>
    </RoomBundle>
  </Result>
</Transaction>

<OccupancyDetails>

交易消息中的 <Occupancy> 用于指定客房或套餐的房客人数上限。<OccupancyDetails> 可以包含其他信息,例如房客(成人或儿童)的数量和类型。

<Occupancy><OccupancyDetails> 出现在 <Result><RoomBundle><Rates> 元素中时,表示费率受入住详细信息的限制。

语法

<OccupancyDetails> 出现时,它前面始终是 <Occupancy>。请注意以下语法:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction ... >
  <Result>
  ...
    <Occupancy>max_number_of_intended_occupants</Occupancy>
    <OccupancyDetails>
      <NumAdults>number_of_adults</NumAdults>
      <Children>
        <Child age=age_of_one_child_guest/>
        <Child age=age_of_one_child_guest/>
      </Children>
    </OccupancyDetails>
  </Result>
</Transaction>

子元素

<OccupancyDetails> 元素具有以下子元素:

子元素 是否必需? 类型 说明
<NumAdults> Required integer 成人房客的人数。最小值:1,最大值:20。
<Children> Optional Object 一个或多个 <Child> 元素的容器。
<Child age> Optional integer 此子级的年龄上限,例如 <Child age="17">

示例

以下示例展示了 <OccupancyDetails><Results><RoomBundle><Rates> 子元素中的显示方式。

结果响应

以下示例定义了一个行程及其价格,以响应用户指定了房客数量和类型的实时价格查询。此处,<Result> 中返回了 <OccupancyDetails>(2 名成人和一个儿童)。

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-23T16:20:00-04:00" id="42">
  <Result>
    <Property>060773</Property>
    <RoomID>RoomType101</RoomID>
    <PackageID>Package101</PackageID>
    <Checkin>2018-06-10</Checkin>
    <Nights>2</Nights>
    <Baserate currency="USD">278.33</Baserate>
    <Tax currency="USD">25.12</Tax>
    <OtherFees currency="USD">2.00</OtherFees>
    <AllowablePointsOfSale>
      <PointOfSale id="site1"/>
    </AllowablePointsOfSale>
    <Occupancy>3</Occupancy>
    <OccupancyDetails>
      <NumAdults>2</NumAdults>
      <Children>
        <Child age="17"/>
      </Children>
    </OccupancyDetails>
  </Result>
</Transaction>

对回答的评分

以下示例定义了一个行程及其适用于 1 名成人和 1 名儿童的价格。此处,<OccupancyDetails><Result><Rates> 元素中返回。

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Transaction id="Wtdj8QoQIWcAAbaTGlIAAAC4" timestamp="2018-04-18T11:27:45-04:00">
  <Result>
    <Property>8251</Property>
    <Checkin>2018-06-20</Checkin>
    <Nights>1</Nights>
    <Baserate currency="USD">62.18</Baserate>
    <Tax currency="USD">2.45</Tax>
    <OtherFees currency="USD">0.00</OtherFees>
    <Rates>
      <Rate rate_rule_id="rule-951">
        <Occupancy>2</Occupancy>
        <OccupancyDetails>
          <NumAdults>1</NumAdults>
          <Children>
            <Child age="17"/>
          </Children>
        </OccupancyDetails>
        <Baserate currency="USD">42.61</Baserate>
        <Tax currency="USD">5.70</Tax>
        <OtherFees currency="USD">0.00</OtherFees>
        <Custom1>abc4</Custom1>
        <AllowablePointsOfSale>
          <PointOfSale id="yourhotelpartnersite.com"/>
        </AllowablePointsOfSale>
      </Rate>
    </Rates>
  </Result>
</Transaction>

客房套餐

以下示例定义了两晚的 2 名成人和 1 名儿童入住,并采用可退款房价。在这里,<OccupancyDetails> 显示在 <RoomBundle> 内部

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-23T16:20:00-04:00" id="42">
  <Result>
    <Property>6781291</Property>
    <Checkin>2017-08-05</Checkin>
    <Nights>2</Nights>
    ...
    <RoomBundle>
      <RoomID>10291</RoomID>
      <RatePlanID>564739</RatePlanID>
      <PackageID>564739</PackageID>
      <Occupancy>3</Occupancy>
      <OccupancyDetails>
        <NumAdults>2</NumAdults>
        <Children>
          <Child age="17"/>
        </Children>
      </OccupancyDetails>
      <ChargeCurrency>web</ChargeCurrency>
      <Refundable available="true" refundable_until_days="1" refundable_until_time="23:59:00" />
      <Baserate currency="USD">185.34</Baserate>
      <Tax currency="USD">37.06</Tax>
      <OtherFees currency="USD">2.22</OtherFees>
    </RoomBundle>
  </Result>
</Transaction>

多个客房套餐

以下示例定义了多种 <RoomBundle> 费率,但房价仅限于 2 名成人和 2 名儿童入住。在这里,<OccupancyDetails> 显示在 <RoomBundle><Rates> 元素中。

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
  <Result>
    <Property>1234</Property>
    <Checkin>2018-06-10</Checkin>
    <Nights>2</Nights>
    <Baserate currency="USD">275.00</Baserate>
    <Tax currency="USD">27.50</Tax>
    <OtherFees currency="USD">0</OtherFees>
    <RoomBundle>
      <RoomID>5</RoomID>
      <PackageID>STD</PackageID>
      <Baserate currency="USD">275.00</Baserate>
      <Tax currency="USD">27.50</Tax>
      <OtherFees currency="USD">0</OtherFees>
      <InternetIncluded>1</InternetIncluded>
      <ChargeCurrency>web</ChargeCurrency>
      <Custom1>ratebasic</Custom1>
      <Custom2>ratebasic</Custom2>
      <Occupancy>4</Occupancy>
      <OccupancyDetails>
          <NumAdults>2</NumAdults>
          <Children>
              <Child age="17"/>
              <Child age="17"/>
          </Children>
      </OccupancyDetails>
      <Rates>
        <Rate rate_rule_id="mobile">
          <Baserate currency="USD">258.33</Baserate>
          <Tax currency="USD">25.83</Tax>
          <OtherFees currency="USD">1.00</OtherFees>
          <ChargeCurrency>hotel</ChargeCurrency>
          <Custom1>ratecode321</Custom1>
        </Rate>
        <Rate rate_rule_id="us_or_gb">
          <Baserate currency="USD">268.33</Baserate>
          <Tax currency="USD">26.83</Tax>
          <OtherFees currency="USD">1.00</OtherFees>
          <Custom1>ratecode432</Custom1>
        </Rate>
      </Rates>
    </RoomBundle>
  </Result>
</Transaction>