要求
語法
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 | 此要求訊息的專屬 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 相符。Hotel Center 中也會顯示飯店 ID。 |
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 相片的網址和說明文字 (選填)。您可以為會議室或 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:00 至入住前」。如未設定 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>
兩張雙人床
以下是具有兩張 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)
訊息包含下列元素和屬性:
元素 / @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>