交易(媒体资源数据)

请求

语法

Transaction (Property Data) 消息使用以下语法:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="timestamp"
             id="message_ID"
             partner="partner_key">
  <PropertyDataSet action="[overlay|delta]">
    <!-- (Required) ID that matches the Hotel List Feed -->
    <Property>HotelID</Property>
    <RoomData>
      <!-- (Required) One room ID per RoomData element -->
      <RoomID>RoomID</RoomID>
      <Name>
        <Text text="room_name" language="language_code"/>
      </Name>
      <Description>
        <Text text="room_description" language="language_code"/>
      </Description>
      <!-- (Optional) Restricts the rate plans allowed for this room type to
        those listed here. If specified, don't specify AllowableRoomIDs. -->
      <AllowablePackageIDs>
        <AllowablePackageID>PackageID</AllowablePackageID>
      </AllowablePackageIDs>
      <Capacity>max_number_of_occupants</Capacity>
      <AdultCapacity>max_number_of_adult_occupants</AdultCapacity>
      <ChildCapacity>max_number_of_child_occupants</ChildCapacity>
      <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>
        <JapaneseHotelRoomStyle>[western|japanese|japanese_western]</JapaneseHotelRoomStyle>
        <Beds>
           <Bed size="[single|semi_double|double|queen|king]">
             <Width unit="cm" number="bed_width"/>
             <Length unit="cm" number="bed_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>
    <PackageData>
      <!-- (Required) One package ID per PackageData element -->
      <PackageID>PackageID</PackageID>
      <Name>
        <Text text="package_name" language="language_code"/>
      </Name>
      <Description>
        <Text text="package_description" language="language_code"/>
      </Description>
      <!-- (Optional) Restricts the room types allowed for this rate plan to
        those listed here. If specified, don't specify AllowablePackageIDs. -->
      <AllowableRoomIDs>
        <AllowableRoomID>RoomID</AllowableRoomID>
      </AllowableRoomIDs>
      <Refundable available="[false|true]" refundable_until_days="number_of_days"
        refundable_until_time="time"/>
      <!-- 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>
    </PackageData>
  </PropertyDataSet>
</Transaction>

元素和属性

交易(房源数据)消息具有以下元素和属性:

Element / @Attribute 出现次数 类型 说明
Transaction 1 Complex element 在 ARI 实现中,这是为单个房源定义房间类型和套餐的消息的根元素。
Transaction / @timestamp 1 DateTime 此消息的创建日期和时间。
Transaction / @id 1 string 此请求消息的唯一标识符。此值会在响应消息中返回。允许使用的字符包括 a-z、A-Z、0-9、_(下划线)和 -(短划线)。
Transaction / @partner 1 string 此消息的合作伙伴账号。此字符串值是 Hotel Center 的 “帐号设置”页面上列出的“合作伙伴密钥”值。

注意:如果您的后端为多个帐号提供 Feed,则此值需要与同一帐号的 <OTA_HotelRateAmountNotifRQ><OTA_HotelAvailNotifRQ> 消息的 <RequestorID> 元素中指定的 ID 属性值匹配。

Transaction / PropertyDataSet 1.. PropertyDataSet 用于定义单个房源的房间类型和套餐的容器。
Transaction / PropertyDataSet / @action 0..1 enum

要应用于房价定义的更新类型。

有效值包括:

  • overlay : 替换属性先前定义的所有 <RoomData><PackageData>。当前消息中只有 <RoomData><PackageData> 有效。
  • delta : 添加先前未定义的 <RoomData><PackageData> 或修改现有的列。

此属性是可选的,如果未指定,则默认为 delta

Transaction / PropertyDataSet / Property 1 string 房源的唯一标识符。此值必须与酒店列表 Feed 的 <listing> 元素中使用 <id> 指定的酒店 ID 一致。酒店 ID 也会显示在 Hotel Center 中。
Transaction / PropertyDataSet / RoomData 0..n RoomData

描述房间。

注意:必须至少提供 <RoomData><PackageData> 中的一个。

Transaction / PropertyDataSet / RoomData / RoomID 1 RoomID 房间类型的唯一标识符。此值使用 <OTA_HotelAvailNotifRQ><OTA_HotelRateAmountNotifRQ> 消息的 <StatusApplicationControl> 元素中的 InvTypeCode 属性引用。
Transaction / PropertyDataSet / RoomData / Name 1 Name 一种或多种语言的会议室类别名称的容器。
Transaction / PropertyDataSet / RoomData / Name / Text 1..n Text 以一种语言指定会议室类别的名称。
Transaction / PropertyDataSet / RoomData / Name / Text / @text 1..n string 房间类别的名称,采用 language 属性所指定的语言。
Transaction / PropertyDataSet / RoomData / Description 1 Name 包含一个或多个语言版本的房间类别说明的容器。
Transaction / PropertyDataSet / RoomData / Description / Text 1..n Text 以一种语言指定房间类别的说明。
Transaction / PropertyDataSet / RoomData / Description / Text / @text 1..n string language 属性指定的语言提供的房间类别说明。
Transaction / PropertyDataSet / RoomData / Description / Text / @language 1..n string 由两个字母组成的语言代码
Transaction / PropertyDataSet / RoomData / AllowablePackageIDs 0..1 AllowablePackageIDs <AllowablePackageID> 元素的容器。

如果指定了 <AllowablePackageIDs>,则父 <RoomData> 元素中的 <RoomID> 标识的客房类型只能与 <AllowablePackageID> 元素定义的费率方案结合使用。

如果未指定 <AllowablePackageIDs>,则父 <RoomData> 元素中由 <RoomID> 标识的客房类型可与任何费率方案结合使用。

请使用 <AllowablePackageIDs><AllowableRoomIDs>,但不能同时使用这两者。

Transaction / PropertyDataSet / RoomData / AllowablePackageIDs / AllowablePackageID 1..n AllowablePackageID 指定可与此客房类型结合使用的费率方案的 PackageID。费率方案由套餐、费率和空房情况组合定义。PackageID 对应于 OTA_HotelRateAmountNotifRQ 和 OTA_HotelAvailNotifRQ 消息中的 RatePlanCode
Transaction / PropertyDataSet / RoomData / Capacity 0..1 integer 一个房间实际可以容纳的成人和儿童数量上限。此值应大于或等于您使用费率发送的任何 NumberOfGuests 值。

<Capacity> 的值必须是 199 之间的正整数(包括这两个数值)。如需查看示例,请点击此处

注意:如果未设置 <Capacity>,允许的入住人数会被视为无限制。如果未设置此字段,并定义了 ExtraGuestChargesAdditionalGuestAmounts,则可以为任意数量的入住人数生成价格。我们建议您在定义了 ExtraGuestChargesAdditionalGuestAmounts 的情况下设置 <Capacity>,以确保系统不会针对无效的入住人数选项显示价格。

Transaction / PropertyDataSet / RoomData / AdultCapacity 0..1 integer 房间实际可以容纳的成人数量上限。此值应大于或等于您使用费率发送的任何 NumberOfGuests 值。

<AdultCapacity> 的值必须是 199 之间的正整数(包括这两个数值)。如需查看示例,请点击此处

Transaction / PropertyDataSet / RoomData / ChildCapacity 0..1 integer 一个房间实际可以容纳的子级数量上限。

<ChildCapacity> 的值必须是 1-99(含)之间的正整数。如需查看示例,请点击此处

Transaction / PropertyDataSet / RoomData / OccupancySettings 0..1 OccupancySettings 用于限制或修改会议室入座要求的设置。

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

  • <MinOccupancy>:一个房间内可以入住的人数下限。例如,如果设为 2,则无法为单个邀请对象预订此会议室。

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

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

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

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

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

Transaction / PropertyDataSet / RoomData / PhotoURL 0..n PhotoURL 指定房间或客房套餐的照片的网址和可选图片说明。您可以为单个房间或客房套餐指定多个 <PhotoURL>

该元素接受以下子元素:

  • <URL>:指定照片的位置。该位置应是公开的(不在防火墙后面),并且应包含协议 (http://)。
  • <Caption>:定义照片的说明。 该元素接受一个子元素 <Text>,它有两个必需属性:TextlanguageText 属性是图片说明,language 属性指定双字母语言代码,例如 en
<PhotoURL>
 <URL>http://www.example.com/image1.jpg</URL>
 <Caption>
  <Text text="A bright way to enjoy your
   mornin' cuppa tea." language="en"/>
  <Text text="Une façon lumineuse pour profiter
   de votre tasse de thé." language="fr"/>
 </Caption>
</PhotoURL>
Transaction / PropertyDataSet / RoomData / RoomFeatures 0..1 <RoomFeatures> 包含客房设施相关信息。
Transaction / PropertyDataSet / RoomData / RoomFeatures / JapaneseHotelRoomStyle 0..1 enum

表示日式酒店客房的样式。

有效值包括:

  • western:西式客房配有床。
  • japanese:配有日式床垫的日式客房。
  • japanese_western:日式西式客房,配有西式睡床和日式日式床垫。
Transaction / PropertyDataSet / RoomData / RoomFeatures / Beds 0..1 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>
Transaction / PropertyDataSet / RoomData / RoomFeatures / Suite 0.. enum 如果此会议室是套房,请提供此元素。
Transaction / PropertyDataSet / RoomData / RoomFeatures / Capsule 0..1 enum 如果此房间是胶囊房间,请提供此元素。
Transaction / PropertyDataSet / RoomData / RoomFeatures / Roomsharing 0..1 enum 此会议室是否与其他房客(例如所有者或其他邀请对象)共用。有效值为 sharedprivate
Transaction / PropertyDataSet / RoomData / RoomFeatures / Outdoor 0..1 enum 如果此房间是没有固定墙、管道和空调的户外住宿,请提供此元素。例如,酒店客房不是户外住宿,而房客入住帐篷的露营地和房客自带房车的房车营地是户外住宿。
Transaction / PropertyDataSet / RoomData / RoomFeatures / MobileAccessible 0..1 enum 如果此会议室配备无障碍设施,请提供此元素。
Transaction / PropertyDataSet / RoomData / RoomFeatures / Smoking 0..1 enum 此客房是无烟室还是吸烟室。有效值为 non_smokingsmoking
Transaction / PropertyDataSet / RoomData / RoomFeatures / BathAndToilet 0..1 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>
Transaction / PropertyDataSet / RoomData / RoomFeatures / OpenAirBath 0..1 enum 如果此房间有私人露天浴池,请提供此元素。
Transaction / PropertyDataSet / RoomData / RoomFeatures / AirConditioning 0..1 enum 在这个房间有空调时提供此元素。
Transaction / PropertyDataSet / RoomData / RoomFeatures / Balcony 0..1 enum 如果此房间有阳台或阳台,请提供此元素。
Transaction / PropertyDataSet / RoomData / RoomFeatures / Views 0..1 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/>

Transaction / PropertyDataSet / PackageData 0..n PackageData

用于容纳描述房价特点的元素以及实际房间说明中未包含的术语的容器。

注意:必须至少提供 <RoomData><PackageData> 中的一个。

Transaction / PropertyDataSet / PackageData / PackageID 1 string 这些消息中的 PackageID 对应于 OTA_HotelRateAmountNotifRQ 和 OTA_HotelAvailNotifRQ 消息中的 RatePlanCode
Transaction / PropertyDataSet / PackageData / Name 1 Name 一种或多种语言的软件包名称的容器。
Transaction / PropertyDataSet / PackageData / Name / Text 1..n Text 以一种语言指定软件包名称。
Transaction / PropertyDataSet / PackageData / Name / Text / @text 1..n string 采用 language 属性所指定语言的软件包名称。
Transaction / PropertyDataSet / PackageData / Description 1 Description 包含一个或多个语言的软件包说明的容器。
Transaction / PropertyDataSet / PackageData / Description / Text 1..n Text 以一种语言指定软件包的说明。
Transaction / PropertyDataSet / PackageData / Description / Text / @text 1..n string 采用 language 属性所指定语言的软件包说明。
Transaction / PropertyDataSet / PackageData / Description / Text / @language 1..n string 由两个字母组成的语言代码
Transaction / PropertyDataSet / PackageData / AllowableRoomIDs 0..1 AllowableRoomIDs <AllowableRoomID> 元素的容器。

如果指定了 <AllowableRoomIDs>,则父 <PackageData> 元素中的 <PackageID> 标识的费率方案只能与 <AllowableRoomID> 元素定义的客房类型结合使用。

如果未指定 <AllowableRoomIDs>,则由父 <PackageData> 元素中的 <PackageID> 标识的费率方案可与任何房间类型结合使用。

请使用 <AllowablePackageIDs><AllowableRoomIDs>,但不能同时使用这两者。

Transaction / PropertyDataSet / PackageData / AllowableRoomIDs / AllowableRoomID 1..n AllowableRoomID 指定可与此费率方案结合使用的客房类型的 RoomID。房间类型在 <RoomData> 元素中定义。
Transaction / PropertyDataSet / PackageData / Refundable 0..1 Refundable 允许将房价列为全退款或可取消。如果未提供,则不会显示有关退款的信息。

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

如果未设置任何属性,则费率不会显示为可退款。

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

  • 如果未设置 availablerefundable_until_days,则费率不会显示为可退款。
  • 如果 available0false,则系统会忽略其他属性。即使设置了其他某个或两个属性,费率也不会显示为可退款。
Transaction / PropertyDataSet / PackageData / Refundable / @available 1 boolean (必需)设置为 1true,以指明相应费率是否允许全额退款;否则,应设置为 0false
Transaction / PropertyDataSet / PackageData / Refundable / @refundable_until_days 0..1 integer (如果 availabletrue,则为必需)指定入住前提前多少天可以申请全额退款。refundable_until_days 的值必须是 0 到 330(含 0 和 330)之间的整数。
Transaction / PropertyDataSet / PackageData / Refundable / @refundable_until_time 0.. Time (如果 availabletrue,则强烈建议提供)指定在一天中的最晚时间(以酒店的当地时间为准)可以执行全额退款申请。此参数可与 refundable_until_days 结合使用,例如指定“退票可在入住前两天下午 4 点之前享受”。如果未设置 refundable_until_time,则该值默认为午夜。
Transaction / PropertyDataSet / PackageData / BreakfastIncluded 0..1 boolean 指定此客房类型是否含早餐。 有效值为 0(或 false)和 1(或 true)。

最好使用 <Meals>,而不是 <BreakfastIncluded>

Transaction / PropertyDataSet / PackageData / CheckinTime 0..1 Time 入住酒店的当地时间最早的入住时间。 时间必须小于 24:00。
Transaction / PropertyDataSet / PackageData / CheckoutTime 0..1 Time 酒店的当地时间可能的最晚退房时间。
Transaction / PropertyDataSet / PackageData / InternetIncluded 0..1 boolean 指定客房是否包含免费互联网接入,而其他客房不包含此类便利设施。请勿在所有客房都提供免费上网服务的酒店中设置此元素。此元素不适用于客房内没有的室内有线互联网或无线互联网。有效值为 0(或 false)和 1(或 true)。
Transaction / PropertyDataSet / PackageData / Meals 0..1 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 属性。

Transaction / PropertyDataSet / PackageData / ParkingIncluded 0..1 boolean 客房是否提供免费停车位,以及该酒店的停车位是否属于付费服务。对于提供免费停车位的酒店,请勿为此元素指定值。有效值为 0(或 false)和 1(或 true)。默认值为 false
Transaction / PropertyDataSet / PackageData / PhotoURL 0..1 Object (与 <RoomData> 中的 <PhotoURL> 相同,但适用于软件包(例如餐照片)。

示例

Room 和软件包数据

下面是一个基本示例,展示了如何在交易(房源数据)消息中定义房源的客房和套餐数据。overlay 属性用于确保在任何意外数据已存在的情况下,系统会删除所有现有数据并将其替换为此消息中的数据:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2020-05-18T16:20:00-04:00"
             id="12345678"
             partner="partner_key">
  <PropertyDataSet action="overlay">
    <Property>Property_1</Property>
    <RoomData>
      <RoomID>RoomID_1</RoomID>
      <Name>
        <Text text="King" language="en"/>
      </Name>
      <Description>
        <Text text="Room with a king bed" language="en"/>
      </Description>
      <Capacity>2</Capacity>
      <PhotoURL>
        <URL>http://www.foo.com/static/bar/image.jpg</URL>
        <Caption>
          <Text text="Room with a king bed" language="en"/>
        </Caption>
      </PhotoURL>
    </RoomData>
    <RoomData>
      <RoomID>RoomID_2</RoomID>
      <Name>
        <Text text="Double" language="en"/>
      </Name>
      <!-- Additional RoomData child elements omitted. -->
    </RoomData>
    <PackageData>
      <PackageID>PackageID_1</PackageID>
      <Name>
        <Text text="Standard" language="en"/>
      </Name>
      <Description>
        <Text text="Standard rate" language="en"/>
      </Description>
      <Refundable available="true" refundable_until_days="7" refundable_until_time="18:00:00"/>
      <BreakfastIncluded>0</BreakfastIncluded>
    </PackageData>
    <PackageData>
      <PackageID>PackageID_2</PackageID>
      <Name>
        <Text text="Free Breakfast" language="en"/>
      </Name>
      <Description>
        <Text text="Free breakfast rate" language="en"/>
      </Description>
      <Refundable available="true" refundable_until_days="7" refundable_until_time="18:00:00"/>
      <BreakfastIncluded>1</BreakfastIncluded>
    </PackageData>
  </PropertyDataSet>
</Transaction>

添加客房类型

下例展示了如何将房间类型和套餐添加到现有的 <Transaction> 数据:

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2020-07-18T16:20:00-04:00"
             id="12345678"
             partner="partner_key">
  <PropertyDataSet action="delta">
    <Property>Property_1</Property>
    <RoomData>
      <RoomID>RoomID_3</RoomID>
      <Name>
        <Text text="Queen" language="en"/>
      </Name>
      <!-- Additional RoomData child elements omitted. -->
    </RoomData>
    <PackageData>
      <PackageID>PackageID_3</PackageID>
      <Name>
        <Text text="Non-Refundable" language="en"/>
      </Name>
      <!-- Additional PackageData child elements omitted. -->
      <Refundable available="false"/>
    </PackageData>
  </PropertyDataSet>
</Transaction>

移除房型

以下示例说明了如何移除现有客房类型和套餐。在这种情况下,如果“客房和套餐数据”和“添加房间类型”中的消息之前已发送给 Google,在 Google 收到显示的消息后,KingDouble 房型将不再存在。请注意,移除套餐数据会影响交易(房源数据)、OTA_HotelRateAmountNotifRQ 和 OTA_HotelAvailNotifRQ 消息(通过引用相同的 PackageID 值)所定义的整体费率方案,因此可能需要使用其他消息类型进行相应更新,以反映此处不再定义 PackageID_2PackageID_3

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2020-08-18T16:20:00-04:00"
             id="12345678"
             partner="partner_key">
  <PropertyDataSet action="overlay">
    <Property>Property_1</Property>
    <RoomData>
      <RoomID>RoomID_1</RoomID>
      <Name>
        <Text text="Queen" language="en"/>
      </Name>
      <!-- Additional RoomData child elements omitted. -->
      <Capacity>2</Capacity>
      <PhotoURL>
        <URL>http://www.foo.com/static/bar/image.jpg</URL>
        <Caption>
          <Text text="Room with a queen bed" language="en"/>
        </Caption>
      </PhotoURL>
    </RoomData>
    <PackageData>
      <PackageID>PackageID_1</PackageID>
      <Name>
        <Text text="Refundable" language="en"/>
      </Name>
      <!-- Additional PackageData child elements omitted. -->
      <Refundable available="true" refundable_until_days="7" refundable_until_time="18:00:00"/>
      <BreakfastIncluded>0</BreakfastIncluded>
    </PackageData>
  </PropertyDataSet>
</Transaction>


限制费率方案

以下示例展示了如何使用 <AllowablePackageIDs> 元素限制某个客房类型允许的费率方案。在此示例中,Queen 房间类型 (RoomID_2) 只能与标识为 PackageID_1 的套餐和费率方案结合使用。

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2020-12-18T16:20:00-04:00"
             id="12345678"
             partner="partner_key">
  <PropertyDataSet action="overlay">
    <Property>Property_1</Property>
    <RoomData>
      <RoomID>RoomID_1</RoomID>
      <Name>
        <Text text="King" language="en"/>
      </Name>
      <!-- Additional RoomData child elements omitted. -->
    </RoomData>
    <RoomData>
      <RoomID>RoomID_2</RoomID>
      <Name>
        <Text text="Queen" language="en"/>
      </Name>
      <AllowablePackageIDs>
        <AllowablePackageID>PackageID_1</AllowablePackageID>
      </AllowablePackageIDs>
      <!-- Additional RoomData child elements omitted. -->
    </RoomData>
    <PackageData>
      <PackageID>PackageID_1</PackageID>
      <Name>
        <Text text="Standard" language="en"/>
      </Name>
      <!-- Additional PackageData child elements omitted. -->
      <Refundable available="true" refundable_until_days="7" refundable_until_time="18:00:00"/>
      <BreakfastIncluded>0</BreakfastIncluded>
    </PackageData>
    <PackageData>
      <PackageID>PackageID_2</PackageID>
      <Name>
        <Text text="Free Breakfast" language="en"/>
      </Name>
      <!-- Additional PackageData child elements omitted. -->
      <Refundable available="true" refundable_until_days="7" refundable_until_time="18:00:00"/>
      <BreakfastIncluded>1</BreakfastIncluded>
    </PackageData>
  </PropertyDataSet>
</Transaction>

限制会议室容纳人数

以下示例展示了如何使用 <Capacity><AdultCapacity><ChildCapacity> 元素设置房间容纳人数限制。

<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2020-12-18T16:20:00-04:00"
             id="12345678"
             partner="partner_key">
  <PropertyDataSet action="overlay">
    <Property>Property_1</Property>
    <RoomData>
      <RoomID>RoomID_1</RoomID>
      <Name>
        <Text text="Double" language="en"/>
      </Name>
      <Capacity>4</Capacity>
      <AdultCapacity>4</AdultCapacity>
      <ChildCapacity>3</ChildCapacity>
      <!-- Additional RoomData child elements omitted. -->
    </RoomData>
  </PropertyDataSet>
</Transaction>

双人房类型 (RoomID_1) 最多可入住 4 位房客。此外,该应用最多可供 4 名成人和 3 名儿童使用。必须满足全部三个容量要求,才能预订此会议室。此配置代表典型的房间,房间内有两张床,每张床可容纳两人。儿童可容纳人数比总容纳人数少 1,因为会议室必须至少有一名成人在场。

包含<RoomFeatures>和餐食的扩展示例

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>

两张双人床

以下是带有两张 double 床的 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>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>

日式西餐厅配床

下例展示了一个配有 king 尺寸床的 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>
        <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>


餐食

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

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

响应

语法

TransactionResponse (Property Data) 消息使用以下语法:

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

元素和属性

TransactionResponse (Property Data) 消息具有以下元素和属性:

Element / @Attribute 出现次数 类型 说明
TransactionResponse 1 Complex element 表示收到的事务请求消息成功或问题的根元素。
TransactionResponse / @timestamp 1 DateTime 此消息的创建日期和时间。
TransactionResponse / @id 1 string 关联的交易消息中的唯一标识符。
TransactionResponse / @partner 1 string 此消息的合作伙伴账号。
TransactionResponse / Success 0..1 Success 表示事务消息已成功处理,没有警告、错误或失败。

每条消息中存在 <Success><Issues>

TransactionResponse / Issues 0..1 Issues 用于存储处理事务消息时遇到的一个或多个问题的容器。

每条消息中存在 <Success><Issues>

TransactionResponse / Issues / Issue 1..n Issue 对处理事务消息时遇到的警告、错误或失败的说明。如需详细了解这些问题,请参阅 Feed 状态错误消息
TransactionResponse / Issues / Issue / @code 1 integer 问题的标识符。
TransactionResponse / Issues / Issue / @status 1 enum

遇到的问题类型。

有效值为 warningerrorfailure

示例

成功

以下是对成功处理的 Transaction 消息的响应。

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

问题

以下是对由于错误而未处理的 Transaction 消息的响应。

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