请求
语法
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>
元素和属性
交易(房源数据)消息包含以下元素和属性:
元素 / @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,则此值需要与同一帐号的 |
Transaction / PropertyDataSet | 1.. | PropertyDataSet | 用于定义单个房源的客房类型和套餐的容器。 |
Transaction / PropertyDataSet / @action | 0..1 | enum | 要应用于房价定义的更新类型。 有效值包括:
此属性是可选属性,如果未指定,则默认为 |
Transaction / PropertyDataSet / Property | 1 | string | 房源的唯一标识符。此值必须与酒店列表 Feed 的 <listing> 元素中的
<id> 指定的酒店 ID 一致。Hotel Center 中也会列出酒店 ID。 |
Transaction / PropertyDataSet / RoomData | 0..n | RoomData | 描述房间。 注意:至少需要 |
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> 元素的容器。如果指定了 如果未指定 请使用 |
Transaction / PropertyDataSet / RoomData / AllowablePackageIDs / AllowablePackageID | 1..n | AllowablePackageID | 指定可与此客房类型结合使用的费率方案的 PackageID。费率方案由套餐、费率和空房情况共同定义。PackageID 对应于 OTA_HotelRateAmountNotifRQ 和 OTA_HotelAvailNotifRQ 消息中的 RatePlanCode 。
|
Transaction / PropertyDataSet / RoomData / Capacity | 0..1 | integer | 一个房间实际容纳的成人和儿童数量上限。此值应大于或等于随费率发送的任何 NumberOfGuests 值。
注意:如果未设置 |
Transaction / PropertyDataSet / RoomData / AdultCapacity | 0..1 | integer | 一个房间实际可以容纳的成人人数上限。此值应大于或等于您通过费率发送的任何 NumberOfGuests 值。
|
Transaction / PropertyDataSet / RoomData / ChildCapacity | 0..1 | integer | 一个房间实际容纳的子项数量上限。
|
Transaction / PropertyDataSet / RoomData / OccupancySettings | 0..1 | OccupancySettings | 可用于限制或修改会议室入住人数要求的设置。
<OccupancySettings> <MinOccupancy>2</MinOccupancy> <MinAge>16</MinAge> </OccupancySettings> 并非所有子元素都需要包含在内。 |
Transaction / PropertyDataSet / RoomData / PhotoURL | 0..n | PhotoURL | 给定房间或房间包的照片的网址和可选图片说明。您可以为一个房间或 Room Bundle 指定多个 <PhotoURL> 。
该元素采用以下子元素:
<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 | 表示日式酒店客房的样式。 有效值包括:
|
Transaction / PropertyDataSet / RoomData / RoomFeatures / Beds | 0..1 | Object | 包含的 <Bed> 与聊天室中的一样多。请注意,此处不应统计日式日式床垫。
每个
<Bed> 都具有以下子元素:
<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 | 此房间是否与其他房客(例如所有者或其他房客)共享。有效值为 shared 和 private 。 |
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_smoking 和 smoking 。 |
Transaction / PropertyDataSet / RoomData / RoomFeatures / BathAndToilet | 0..1 | Object | 包含房间内浴室和卫生间的相关信息。
该属性为:
该元素可选择接受以下子元素:
例如: <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 | 有效选项包括:
|
Transaction / PropertyDataSet / PackageData | 0..n | 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> 元素的容器。如果指定了 如果未指定 请使用 |
Transaction / PropertyDataSet / PackageData / AllowableRoomIDs / AllowableRoomID | 1..n | AllowableRoomID | 指定可与此费率方案结合使用的客房类型的 RoomID。客房类型在 <RoomData> 元素中定义。
|
Transaction / PropertyDataSet / PackageData / Refundable | 0..1 | Refundable | 允许将房价列为可全额退款或可取消的房价。如果未提供,则不会显示任何退款信息。
注意:我们建议设置所有属性。如果一个或多个属性未设置,系统会生成 Feed 状态警告消息。 如果未设置任何属性,则房价不会显示为可退款。 设置属性时,请注意以下事项:
|
Transaction / PropertyDataSet / PackageData / Refundable / @available | 1 | boolean | (必需)设置为 1 或 true 以指明费率是否允许全额退款;否则设置为 0 或 false 。 |
Transaction / PropertyDataSet / PackageData / Refundable / @refundable_until_days | 0..1 | integer | (如果 available 为 true ,则为必需)指定在入住前多少天可以申请全额退款。refundable_until_days 的值必须是 0 到 330(含)之间的整数。 |
Transaction / PropertyDataSet / PackageData / Refundable / @refundable_until_time | 0.. | Time | (如果 available 为 true ,则强烈建议提供)指定接受全额退款申请的最晚时间(采用酒店的当地时间)。例如,可与 refundable_until_days 结合使用以指定“退款在入住前两天下午 4 点之前均可退款”。如果未设置 refundable_until_time ,则该值默认为午夜。 |
Transaction / PropertyDataSet / PackageData / BreakfastIncluded | 0..1 | boolean | 指定此客房类型是否含早餐。
有效值为 0 (或 false )和 1 (或 true )。
最好使用 |
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 | 包含此包裹中的餐点的相关信息。
仅当 如需让膳食过滤器( |
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 收到显示的消息,King
和 Double
房间类型将不再存在。请注意,移除套餐数据会影响交易(房源数据)、OTA_HotelRateAmountNotifRQ 和 OTA_HotelAvailNotifRQ
消息(通过引用相同的 PackageID
值)定义的总体费率方案,因此可能需要使用其他消息类型进行相应更新,以反映此处不再定义 PackageID_2
和 PackageID_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>
两张双人床
下面是一个 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>
餐食
以下示例定义了餐点、照片以及入住时间和退房时间的客房和套餐元数据:
<?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)
消息包含以下元素和属性:
元素 / @Attribute | 出现次数 | 类型 | 说明 |
---|---|---|---|
TransactionResponse | 1 | Complex element | 表示收到的事务请求消息成功或有问题的根元素。 |
TransactionResponse / @timestamp | 1 | DateTime | 此消息的创建日期和时间。 |
TransactionResponse / @id | 1 | string | 关联的交易消息中的唯一标识符。 |
TransactionResponse / @partner | 1 | string | 此消息所属的合作伙伴账号。 |
TransactionResponse / Success | 0..1 | Success | 表示事务消息已成功处理,没有警告、错误或失败。 每条消息中是否存在 |
TransactionResponse / Issues | 0..1 | Issues | 处理事务消息时遇到的一个或多个问题的容器。 每条消息中是否存在 |
TransactionResponse / Issues / Issue | 1..n | Issue | 处理 Transaction 消息时遇到的警告、错误或失败的说明。如需详细了解这些问题,请参阅 Feed 状态错误消息。 |
TransactionResponse / Issues / Issue / @code | 1 | integer | 问题的标识符。 |
TransactionResponse / Issues / Issue / @status | 1 | enum | 遇到的问题类型。 有效值为 |
示例
成功
以下是对已成功处理的 Transaction 消息的响应。
<?xml version="1.0" encoding="UTF-8"?>
<TransactionResponse timestamp="2020-05-18T16:20:00-04:00"
id="12345678"
partner="partner_key">
<Success/>
</TransactionResponse>
问题
以下是对由于错误而未处理的事务消息的响应。
<?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>