要求
語法
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 相符。Hotel Center 也會列出飯店 ID。 | 
| 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>