要求
語法
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>
<!-- Add Loyalty point information -->
<MilesIncluded>
<LoyaltyCampaignID>campaign-ID</LoyaltyCampaignID>
<!-- (Optional) Use <NumberOfMiles> if the rate plan earns fixed loyalty rewards-->
<NumberOfMiles>integer</NumberOfMiles>
</MilesIncluded>
<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 | 這則要求訊息的專屬 ID。這個值會傳回至回應訊息。允許的字元包括 a-z、A-Z、0-9、_ (底線) 和 - (連字號)。 |
| Transaction / @partner | 1 | string | 這封郵件的合作夥伴帳戶。這個字串值是 Hotel Center「帳戶設定」頁面列出的「合作夥伴金鑰」值。 注意:如果後端會為多個帳戶提供動態饋給,這個值必須與相同帳戶的 |
| Transaction / PropertyDataSet | 1.. | PropertyDataSet | 用來定義單一房源的房型和套裝組合。 建議您只傳送 |
| Transaction / PropertyDataSet / @action | 0..1 | enum | 要套用至房價定義的更新類型。 有效值如下:
此屬性為選用項目,如未指定,預設為 |
| Transaction / PropertyDataSet / Property | 1 | string | 房源的專屬 ID。這個值必須與飯店清單動態饋給中 <listing> 元素內使用
<id> 指定的飯店 ID 相符。飯店 ID 也會列在 Hotel Center 中。 |
| Transaction / PropertyDataSet / RoomData | 0..n | RoomData | 說明房間。 注意:至少必須有一個 |
| Transaction / PropertyDataSet / RoomData / RoomID | 1 | RoomID | 房型的專屬 ID。這個值會使用 <OTA_HotelAvailNotifRQ>、<OTA_HotelRateAmountNotifRQ> 和 <OTA_HotelInvCountNotifRQ> 訊息中 <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 | 指定房型或房型套裝組合的相片網址和說明 (選填)。您可以為會議室或會議室組合指定多個 <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 / MilesIncluded | 0..1 | MilesIncluded | 根據費率方案或套裝組合的定義方式,在套裝組合中新增會員點數資訊。在定義費率方案的 <PackageData> 元素中,指定 <MilesIncluded> 元素。<MilesIncluded> 具有下列子元素:
|
| Transaction / PropertyDataSet / PackageData / Refundable | 0..1 | Refundable | 可將房價列為全額退費或可取消。如果未提供,系統就不會顯示退款資訊。 注意:建議您設定所有屬性。如果未設定一或多個屬性,系統就會產生動態饋給狀態警告訊息。 如未設定任何屬性,費率就不會顯示為可退款。 設定屬性時,請注意下列事項:
|
| 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> 相同,
但適用於套件 (例如餐點相片)。)
|
範例
客房和套裝行程資料
以下是基本範例,說明如何在「交易 (資源資料)」訊息中定義資源的房型和套裝行程資料。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>
<MilesIncluded>
<LoyaltyCampaignID>my_campaign</LoyaltyCampaignID>
</MilesIncluded>
<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 位兒童。必須符合所有三項容量規定,才能預訂這個會議室。這項設定代表一般客房,內有兩張床,每張床可容納兩人。兒童人數上限比總人數上限少一人,因為房內至少要有一位成人。
<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 | 相關聯交易訊息的專屬 ID。 |
| TransactionResponse / @partner | 1 | string | 這則訊息的合作夥伴帳戶。 |
| TransactionResponse / Success | 0..1 | Success | 表示系統已順利處理交易訊息,且未出現警告、錯誤或失敗。
每則訊息都包含 |
| TransactionResponse / Issues | 0..1 | Issues | 處理交易訊息時發生一或多個問題的容器。 每則訊息都包含 |
| TransactionResponse / Issues / Issue | 1..n | Issue | 處理交易訊息時發生的警告、錯誤或失敗說明。如要瞭解這些問題的詳細資訊,請參閱「動態饋給狀態錯誤訊息」。 |
| TransactionResponse / Issues / Issue / @code | 1 | integer | 問題的 ID。 |
| TransactionResponse / Issues / Issue / @status | 1 | enum | 遇到的問題類型。 有效值為 |
範例
成功
以下是成功處理交易訊息的回應。
<?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>