要求
語法
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>
元素和屬性
交易 (資源資料) 訊息包含下列元素和屬性:
元素 / @屬性 | 發生次數 | 類型 | 說明 |
---|---|---|---|
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> 訊息的 <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 | 允許公告費率可全額退款或可取消。如未提供,就不會顯示退款相關資訊。
注意:建議您設定所有屬性。如未設定一或多項屬性,系統就會產生動態饋給狀態警告訊息。 如未設定任何屬性,費率就不會顯示可退款。 設定屬性時,請注意下列事項:
|
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>
移除房型
以下範例說明如何移除現有房型和套件。在這種情況下,如果「Room and package data」(會議室和套件資料) 和「Add a room type」(新增房間類型) 中的訊息先前已傳送至 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>
兩張雙人床
以下是設有兩張 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)
訊息包含下列元素和屬性:
元素 / @屬性 | 發生次數 | 類型 | 說明 |
---|---|---|---|
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>