价格和客房空房情况(交易)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:09:00 的价格更新消息,但该消息的时间戳晚于时间戳为 2019-05-03 14:10:00 的消息,系统仍会按顺序处理这些消息,并使用时间戳为 2019-05-03 14:10:00 的消息中的价格。

子元素

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

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

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

<Result> Optional* <Result>

客房行程或 <RoomBundle> 元素(用于定义房源的客房套餐和其他类型的客房)的价格数据。<Result> 元素也可用于从广告资源中移除行程。

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

示例

会议室数据

以下示例在交易消息中定义了客房数据:

<?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-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>
    <MilesIncluded>
      <NumberOfMiles>1200</NumberOfMiles>
      <Provider>
        <Text language="en" text="United Airlines"/>
      </Provider>
      <LoyaltyCampaignID>my_campaign</LoyaltyCampaignID>
    </MilesIncluded>
  </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>
      </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> 消息中客房和套餐(或客房套餐)信息的容器。酒店上设置的值会替换合作伙伴上设置的值。 Google 会存储此信息,以便您无需在每次发送价格更新时都定义此信息。

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

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

如需了解详情,请参阅会议室套装元数据

语法

<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> 描述房间套装。此数据与合作伙伴和酒店相关联,但与行程无关。此元素与 <RoomData> 类似,但它描述的是不属于实体客房说明的设施和服务条款。

您可以在价格更新中引用相应套餐 ID。

如需了解详情,请参阅会议室套装元数据

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

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

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

示例

客房和套餐数据

以下示例展示了 <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 和套餐 ID。这样一来,您就可以大幅减小消息的大小,同时减少因数据重复而可能遇到的错误数量。如需了解详情,请参阅会议室套装元数据

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

您可以为同一房间或 Room Bundle 同时定义 <RoomData><PackageData> 元素。当 Google 在搜索结果中显示相应客房或套餐时,会同时显示这两个描述,并用连字符分隔。

如需了解详情,请参阅会议室套装元数据

语法

<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 之间的正整数(含 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> 块相匹配。如需了解详情,请参阅会议室套装元数据。(您还可以使用此 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>

多房间套餐

以下示例定义了多个 RoomBundle 的房间和套餐元数据:

<?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>
      <RoomID>RoomID_1</RoomID>
      <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>
      <RoomID>RoomID_1</RoomID>
      <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>
      <RoomID>RoomID_1</RoomID>
      <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>
      <RoomID>RoomID_1</RoomID>
      <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>
      <RoomID>RoomID_1</RoomID>
      <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> 都被视为媒体资源的所有数据,并会覆盖所有现有数据。

如需了解详情,请参阅会议室套装元数据

语法

<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>integer</NumberOfMiles>
        <Provider>
          <Text language="en" text="provider-name">
        </Provider>
        <!-- Add Loyalty point information -->
        <LoyaltyCampaignID>campaign_ID</LoyaltyCampaignID>
      </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)正常运行,<Breakfast><Dinner> 都需要通过 included 属性提供。

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

此元素采用单个子元素 <Text>,该子元素具有两个属性,即 textlanguagetext 属性是说明,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 将 Room Bundle 数据与价格更新中的 <Result> 块进行匹配。如需了解详情,请参阅 Room Bundle 元数据

(您还可以在内嵌定义客房套餐数据时,使用此 ID 引用单个交易消息中使用的通用客房套餐定义。)

<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 之间的整数(含边界值)。
  • refundable_until_time:(如果 availabletrue,强烈建议提供此值)指定最晚在什么时间(酒店所在地的当地时间)前退订可获得全额退款。此元素可与 refundable_until_days 结合使用,以指定“退款截止时间为入住前两天的下午 4 点”。如果未设置 refundable_until_time,则该值默认为午夜。

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

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

  • 如果未设置 availablerefundable_until_days,则相应房价不会显示为可退款。
  • 如果 available0false,则忽略其他属性。即使设置了其他一个或两个属性,相应费率也不会显示为可退款。
<MembershipBenefits Included> Optional boolean 房价包含住宿期间的精英会员福利。包含以下参数:
  • ProgramName:精英会员计划的名称
  • ProgramLevel:计划的级别。例如: “Gold”。
  • NightlyValue (optional):福利的每晚价值。
<CarRentalIncluded> Optional boolean 房价包含入住期间的免费租车服务。
<MilesIncluded> Optional boolean 房价包含飞行常客奖励计划里程。参数包括:
  • NumberOfMiles:每个行程的里程数。
  • Provider:飞行常客奖励计划提供商。
  • LoyaltyCampaignID:一个唯一 ID,用于标识已通过 Google 配置和更新的特定会员回馈活动。 它会将积分添加到酒店价格中。

    如需添加 <MilesIncluded> 元素,应在“会员回馈活动”配置中配置广告系列 ID。 Google 如何在搜索结果中使用会员积分的具体细节取决于会员回馈活动的配置。

    <MilesIncluded> 元素有一个子元素 <NumberOfMiles>,用于计算获得的积分数。如果未设置 <NumberOfMiles>,则所赚取的积分由会员回馈活动配置决定。

    <MilesIncluded>
      <LoyaltyCampaignID>my_campaign</LoyaltyCampaignID>
      <NumberOfMiles>1200</NumberOfMiles>
      <Provider>
        <Text language="en" text="United Airlines">
      </Provider>
    </MilesIncluded>
  • 注意<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>

会议室和软件包元数据

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

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

多房间套餐

以下示例定义了多个 RoomBundle 的房间和套餐元数据:

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


含价格的客房套餐

以下示例定义了具有房价功能的 Room 软件包的客房和套餐元数据:

<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>
        <LoyaltyCampaignID>my_campaign</LoyaltyCampaignID>
      </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>
      <PackageID>PackageID_1</PackageID>
      <Name>
        <Text text="Meals Included" language="en"/>
      </Name>
      <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>
      <PackageID>PackageID_1</PackageID>
      <Name>
        <Text text="Breakfast Included" language="en"/>
      </Name>
      <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> 元素,只要消息的大小不超过 100MB 即可。

语法

<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. -->
    <!-- Child occupancy rates should only be sent through Live pricing
         with context and not through Pull or Changed pricing -->
    <OccupancyDetails>occupancy_info</OccupancyDetails>

    <Rates>...</Rates>

    <RoomBundle>...</RoomBundle>

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

    <MilesIncluded>
      <NumberOfMiles>integer</NumberOfMiles>
      <Provider>
        <Text language="en" text="provider-name">
      </Provider>
      <!-- Add Loyalty point information -->
      <LoyaltyCampaignID>campaign_ID</LoyaltyCampaignID>
    </MilesIncluded>
  </Result>
  ...
  </Transaction>

属性

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

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

子元素

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

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

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

<Baserate> Optional float

住宿的客房价格。此元素的值应反映以下内容:

  • 对于私人客房,请设置您提供的最便宜的双人间价格。如果您没有双人入住价格,并且您的账号已启用非双人入住价格,则允许在此处设置更高的入住人数。请与我们联系,以启用非双人入住费率。 此处不允许设置单人入住费率,必须在 <Rates> 下设置。
  • 对于共享会议室,请留空并使用 <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:由 3 个字母组成的币种代码。例如,USD 表示美元。
<ChargeCurrency> Optional enum 用户何时何地为预订付款。此元素可用于交易消息中的 <Result> 元素(适用于酒店价格)或 <PackageData> 块(适用于客房套餐)。

有效值包括:

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

默认值为 web

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

借助 <Custom> 元素,您可以传递任意数据。 例如,您可以在此字段中指定一个值,然后着陆页文件将使用该值来构建着陆页的自定义网址。每个自定义字段的字符数限制为 200 个字符。如需了解详情,请参阅着陆页文件 <Rate> 元素中提供的 <Custom> 元素不会继承到 <RoomBundle> 元素。您应在每个 <RoomBundle> 中单独定义 <Custom> 属性。

重要提示:如果您想使用 CUSTOM 变量,请与您的技术支持客户经理 (TAM) 联系。

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

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

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

<MilesIncluded> Optional boolean 房价包含飞行常客奖励计划里程。参数包括:
  • NumberOfMiles:每个行程的里程数。
  • Provider:飞行常客奖励计划提供商。
  • LoyaltyCampaignID:一个唯一 ID,用于标识已通过 Google 配置和更新的特定会员回馈活动。 它会将积分添加到酒店价格中。

    如需添加 <MilesIncluded> 元素,应在会员回馈活动配置中配置广告系列 ID。Google 如何在搜索结果中使用会员积分的具体细节取决于会员回馈活动的配置。

    <MilesIncluded> 元素有一个子元素 <NumberOfMiles>,用于计算获得的积分数。如果未设置 <NumberOfMiles>,则所赚取的积分由会员回馈活动配置决定。

    <MilesIncluded>
      <LoyaltyCampaignID>my_campaign</LoyaltyCampaignID>
      <NumberOfMiles>1200</NumberOfMiles>
      <Provider>
        <Text language="en" text="United Airlines">
      </Provider>
    </MilesIncluded>
  • 注意<NumberOfMiles><Provider> 是可选的。

<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 Bundle 元数据

必须在 <Result> 元素中包含 <RoomBundle>,以定义 <PackageID><RoomID>。不过,建议您仅在 <RoomBundle> 元素内指定软件包和会议室 ID,而不是在 <Result> 元素内指定。

<Property> Required string 受关联数据(价格、行程、客房套餐或元数据)影响的酒店的 ID。此元素的值必须是字符串。此元素的值必须与您在酒店列表 Feed 中定义的房源 <id> 一致。
<Rates> Optional <Rates> 包含一个或多个 <Rate> 块的容器。<Rates> 中的每个 <Rate> 都定义了不同的客房/行程组合价格。

如果同一房型/行程组合有多个房价,或者不允许在 <Result> 级别指定房价,请使用 <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 之间的整数(含边界值)。
  • refundable_until_time:(如果 availabletrue,强烈建议提供此值)指定最晚在什么时间(酒店所在地的当地时间)前退订可获得全额退款。此元素可与 refundable_until_days 结合使用,以指定“退款截止时间为入住前两天的下午 4 点”。如果未设置 refundable_until_time,则该值默认为午夜。

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

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

  • 如果未设置 availablerefundable_until_days,则相应房价不会显示为可退款。
  • 如果 available0(或 false),则忽略其他属性。即使设置了其他一个或两个属性,相应费率也不会显示为可退款。
<RoomBundle> Optional <RoomBundle> 一个容器,用于存放有关客房的定价实体描述、任何设施套餐以及指定酒店和行程的一些购买政策详细信息。

一般来说,您可以使用此元素来定义同一房源中基本客房和不同类型客房的价格。虽然可以内嵌定义 Room Bundle 说明,但您应使用单独的 Transaction 消息来定义该信息。Google 会存储元数据,以便您在日后的所有价格更新中引用这些元数据,而不是重复输入。

<RoomID> Optional string 要映射到预定义客房数据的客房的唯一 ID。还用于填充 PARTNER-ROOM-ID 着陆页变量。 如需了解详情,请参阅 Room Bundle 元数据

必须在 <Result> 元素中包含 <RoomBundle>,以定义 <PackageID><RoomID>。不过,建议您仅在 <RoomBundle> 元素内指定软件包和会议室 ID,而不是在 <Result> 元素内指定。

<Tax> Optional float 为客房最终价格计算的税费。 <Tax> 元素具有一个必需属性 currency,用于定义税费的三字母币种代码。例如 USD。如果 <Baserate> 大于零,则必须提供 <Tax> 元素。

如果 <Baserate> 元素的“all_inclusive”属性明确设置为 true,则此值的设置是可选的。

<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=""/>:发生了一些未列举的错误。可选的 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>
    <MilesIncluded>
      <NumberOfMiles>1200</NumberOfMiles>
      <Provider>
        <Text language="en" text="United Airlines"/>
      </Provider>
      <LoyaltyCampaignID>my_campaign</LoyaltyCampaignID>
    </MilesIncluded>
  </Result>
</Transaction>

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

您可以在 Google 存储的单独的 Transaction 消息中一次定义该信息。然后,您可以在所有后续的价格和商品目录更新中引用该 ID。如需了解详情,请参阅会议室套装元数据

多费率示例

以下示例定义了单个行程和房源,其中包含针对不同入住人数的多项价格。<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>
          ...
        <MilesIncluded>
          <NumberOfMiles>integer</NumberOfMiles>
          <Provider>
            <Text language="en" text="provider-name">
          </Provider>
          <LoyaltyCampaignID>campaign_ID</LoyaltyCampaignID>
        </MilesIncluded>
          ...
      </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> 相同。
Optional string 已弃用:可用于将与酒店关联的其他数据传递到着陆页的自定义字段。此元素使用的语法与 <Result> 中的 <Custom[1‑5]> 相同。每个自定义字段的字符数限制为 200 个字符。如需了解详情,请参阅 着陆页文件。如果在 <Result> 元素中提供了 <Custom> 元素,则这些元素不会在 <RoomBundle> 元素中继承,应为每个 <RoomBundle> 单独定义,也可以根据需要在 <PackageData> 中添加。

重要提示:如果您想使用 CUSTOM 变量,请与您的技术支持客户经理 (TAM) 联系。

<ExpirationTime> Optional DateTime 相应费率被视为过期的日期和时间。此元素使用的语法与 <Result> 中的 <ExpirationTime> 相同。
<MilesIncluded> Optional boolean 房价包含飞行常客奖励计划里程。参数包括:
  • NumberOfMiles:每个行程的里程数。
  • Provider:飞行常客奖励计划提供商。
  • LoyaltyCampaignID:一个唯一 ID,用于标识已通过 Google 配置和更新的特定会员回馈活动。 它会将积分添加到酒店价格中。

    如需添加 <MilesIncluded> 元素,应在会员回馈活动配置中配置广告系列 ID。Google 如何在搜索结果中使用会员积分的具体细节取决于会员回馈活动的配置。

    <MilesIncluded> 元素有一个子元素 <NumberOfMiles>,用于计算获得的积分数。如果未设置 <NumberOfMiles>,则所赚取的积分由会员回馈活动配置决定。

    <MilesIncluded>
      <LoyaltyCampaignID>my_campaign</LoyaltyCampaignID>
      <NumberOfMiles>1200</NumberOfMiles>
      <Provider>
        <Text language="en" text="United Airlines">
      </Provider>
    </MilesIncluded>
  • 注意<NumberOfMiles><Provider> 是可选的。

<Occupancy> Optional integer

指定相应房价允许的最大入住人数。如果未指定,则假定与父费率相同。 <Occupancy> 可以与 <OccupancyDetails> 搭配使用,后者用于指定房客类型(成人或儿童)。如需了解子元素的语法和说明,请参阅 <OccupancyDetails>

<OtherFees> Required float 除基本房价和税费之外,会影响客房最终价格的费用。此元素使用与 <Result> 中的 <OtherFees> 相同的语法。

如果 <Baserate> 元素的“all_inclusive”属性明确设置为 true,则此值的设置是可选的。

<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 之间的整数(含边界值)。
  • refundable_until_time:(如果 availabletrue,强烈建议提供此值)指定最晚在什么时间(酒店所在地的当地时间)前退订可获得全额退款。此元素可与 refundable_until_days 结合使用,以指定“退款截止时间为入住前两天的下午 4 点”。如果未设置 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>
      </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>

      <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>
        </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>
        </Rate>
      </Rates>
    </RoomBundle>
  </Result>
</Transaction>

<RoomBundle>

<Transaction> 消息中,将 RoomBundle 定义为 <Result> 的子元素,以指定客房套装的价格和供应情况。为每个套餐或行程组合分别定义一个元素。如需定义会议室套装的套餐和条款,请使用 <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>

      <!-- Add Loyalty point information -->
      <MilesIncluded>
        <NumberOfMiles>integer</NumberOfMiles>
        <Provider>
          <Text language="en" text="provider-name">
        </Provider>
        <LoyaltyCampaignID>campaign_ID</LoyaltyCampaignID>>
      </MilesIncluded>

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

    </RoomBundle>
    ...
  </Result>
</Transaction>

属性

<RoomBundle> 元素没有属性。

子元素

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

子元素 是否必需? 类型 说明
<Baserate> Required float 定义住宿的客房套装价格。此元素使用的语法与 <Result> 中的 <Baserate> 相同,但有以下例外情况:
  • 如果客房不适用于相应行程,请移除 <RoomBundle> 元素,以表明相应客房已不再有库存。如需了解详情,请参阅 移除会议室套装
<BreakfastIncluded> Optional boolean 指定此客房套餐是否包含早餐。
<ChargeCurrency> Optional enum 用户何时何地为预订付款。此元素使用与 <Result> 中的 <ChargeCurrency> 相同的语法。

默认值为 web

Optional string 已弃用:用于向 Room Bundle 的着陆页传递额外数据的自定义字段。这些元素使用与 <Result><Custom[1-5]> 相同的语法。每个自定义字段的字符数限制为 200 个。如需了解详情,请参阅着陆页文件。 只有在您通过交易消息发送价格时,系统才会列出自定义变量。如果在 <Result> 元素中提供了 <Custom> 元素,则这些元素不会在 <RoomBundle> 元素中继承,应为每个 <RoomBundle> 单独定义,也可以根据需要在 <PackageData> 中添加。

重要提示:如果您想使用 CUSTOM 变量,请与您的技术支持客户经理 (TAM) 联系。

<InternetIncluded> Optional boolean 如果某个客房套餐包含免费网络连接,而其他套餐不包含此便利设施。如果酒店为所有客房提供免费互联网,请勿为客房套装设置此元素。此元素不适用于客房内没有的有线互联网或无线互联网。
<MilesIncluded> Optional boolean 房价包含飞行常客奖励计划里程。参数包括:
  • NumberOfMiles:每个行程的里程数。
  • Provider:飞行常客奖励计划提供商。
  • LoyaltyCampaignID:一个唯一 ID,用于标识已通过 Google 配置和更新的特定会员回馈活动。 它会将积分添加到酒店价格中。

    若要包含 <MilesIncluded>,应在会员回馈活动配置中配置广告系列 ID。Google 如何在搜索结果中使用会员积分的具体细节取决于会员营销活动的配置。

    <MilesIncluded> 元素有一个子元素 <NumberOfMiles>,用于计算获得的积分数。如果未设置 <NumberOfMiles>,则所赚取的积分由会员回馈活动配置决定。

    <MilesIncluded>
      <LoyaltyCampaignID>my_campaign</LoyaltyCampaignID>
      <NumberOfMiles>1200</NumberOfMiles>
      <Provider>
        <Text language="en" text="United Airlines">
      </Provider>
    </MilesIncluded>
  • 注意<NumberOfMiles><Provider> 是可选的。

<Occupancy> Required integer 指定相应房价允许的最大入住人数。例如,大型套房可能在物理上可容纳 6 位客人,但“蜜月套餐”仅允许 2 位客人入住。

此值必须小于或等于 <Capacity>,即房间在物理上可容纳的人数。

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

<Occupancy> 的值必须是介于 1 到 99 之间的正整数(含边界值)。

注意

  • 强烈建议为 <RoomBundle> 提供 <Occupancy>,因此将其标记为必需,如果省略,则会抛出 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 将 Room Bundle 数据与 <PackageData> 中发送的数据进行匹配。如需了解详情,请参阅 Room Bundle 元数据。(您还可以使用此 ID 来引用在单个交易消息中使用的通用客房套餐定义,以便内联定义客房套餐数据。)
<ParkingIncluded> Optional boolean 客房套餐是否包含免费停车服务(否则,停车服务在该酒店会收费)。对于提供免费停车位的酒店,请勿为此元素指定值。

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

<RatePlanID> Optional string 房价方案 ID 表示客房和套餐组合的唯一标识符。例如,如果 <RoomID> 值为 5,<PackageID> 值为 ABC,则可以使用 5-ABC 作为 <RatePlanID> 的值。我们强烈建议您使用 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 之间的整数(含边界值)。
  • refundable_until_time:(如果 availabletrue,强烈建议提供此值)指定最晚在什么时间(酒店所在地的当地时间)前退订可获得全额退款。此元素可与 refundable_until_days 结合使用,以指定“退款截止时间为入住前两天的下午 4 点”。如果未设置 refundable_until_time,则该值默认为午夜。

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

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

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

示例

单人入住套餐

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

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

此示例使用 <RoomID><PackageID> 元素引用预定义的 room 和软件包元数据。您可以使用 <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> 元素引用预定义的 room 和软件包元数据。您可以使用 <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>


多房间套餐

以下示例在多个 Room bundle 中设置了入住人数,以展示可能的青年旅舍客房价格。

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

      <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>
        </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>
        </Rate>
      </Rates>
    </RoomBundle>
  </Result>
</Transaction>

<OccupancyDetails>

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

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

如果您在 <RoomBundle> 中包含 <OccupancyDetails>,以及嵌套的 <Rate> 元素,则无法在 <Rate> 中发送基本 <Occupancy>;建议您改用以下任一选项:

  • <Rate> 中省略入住人数:在这种情况下,<Rate> 直接从 <RoomBundle> 继承 <OccupancyDetails>

  • 重复 <OccupancyDetails>:在这种情况下,在 <RoomBundle> 和嵌套的 <Rate> 元素中发送额外的相同 <OccupancyDetails>

语法

当出现 <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> 子元素中。

结果响应

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

<?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>
        <AllowablePointsOfSale>
          <PointOfSale id="yourhotelpartnersite.com"/>
        </AllowablePointsOfSale>
      </Rate>
    </Rates>
  </Result>
</Transaction>

客房套餐

以下示例定义了 2 名成人和 1 名儿童入住 2 晚,并采用可退款的房价。在此示例中,<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>
      <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>
        </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>
        </Rate>
      </Rates>
    </RoomBundle>
  </Result>
</Transaction>