交易 (資源資料)

要求

語法

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 帳戶設定頁面中列出的「合作夥伴鍵」值。

注意:如果您有為多個帳戶提供動態饋給的後端,這個值必須與同一個帳戶 <OTA_HotelRateAmountNotifRQ><OTA_HotelAvailNotifRQ> 訊息的 <RequestorID> 元素中指定的 ID 屬性值相符。

Transaction / PropertyDataSet 1.. PropertyDataSet 用來定義單一房源的房型和套裝組合的容器。
Transaction / PropertyDataSet / @action 0..1 enum

要套用至房價定義的更新類型。

有效值如下:

  • overlay : 會取代屬性先前定義的所有 <RoomData><PackageData>。目前訊息中只有 <RoomData><PackageData> 有效。
  • delta : 會新增先前未定義的 <RoomData><PackageData>,或修改現有的 <RoomData><PackageData>

此屬性為選用屬性,如果未指定,則預設為 delta

Transaction / PropertyDataSet / Property 1 string 房源的專屬 ID。這個值必須與飯店清單動態饋給中 <listing> 元素中使用 <id> 指定的飯店 ID 相符。Hotel Center 也會列出飯店 ID。
Transaction / PropertyDataSet / RoomData 0..n RoomData

說明聊天室。

注意:至少必須有一個 <RoomData><PackageData>

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> 元素的容器。

如果指定 <AllowablePackageIDs>,父項 <RoomData> 元素中 <RoomID> 所識別的房型類型只能與 <AllowablePackageID> 元素定義的費率方案結合。

如果未指定 <AllowablePackageIDs>,父項 <RoomData> 元素中由 <RoomID> 識別的房型類型可與任何費率方案搭配使用。

<AllowablePackageIDs><AllowableRoomIDs> 請擇一使用,不能兩者同時使用。

Transaction / PropertyDataSet / RoomData / AllowablePackageIDs / AllowablePackageID 1..n AllowablePackageID 指定可與此房型結合的房價方案 PackageID。費率方案是由套裝方案、費率和供應情形組合而成。PackageID 對應至 OTA_HotelRateAmountNotifRQ 和 OTA_HotelAvailNotifRQ 訊息中的 RatePlanCode
Transaction / PropertyDataSet / RoomData / Capacity 0..1 integer 房間可實際容納的成人和兒童人數上限。這個值應大於或等於您透過費率傳送的任何 NumberOfGuests 值。

<Capacity> 的值必須是介於 199 之間的正整數 (包含 199)。如需範例,請參閱這裡

注意:如果未設定 <Capacity>,系統會將允許入住人數視為無限制。如果未設定這個欄位,但已定義 ExtraGuestChargesAdditionalGuestAmounts,系統就能為任何人數產生價格。如果已定義 ExtraGuestChargesAdditionalGuestAmounts,建議您設定 <Capacity>,確保系統不會顯示無效的入住人數選項價格。

Transaction / PropertyDataSet / RoomData / AdultCapacity 0..1 integer 房間實際可容納的成人人數上限。這個值應大於或等於您透過費率傳送的任何 NumberOfGuests 值。

<AdultCapacity> 的值必須是介於 199 之間的正整數 (包含 199)。如需範例,請參閱這裡

Transaction / PropertyDataSet / RoomData / ChildCapacity 0..1 integer 房間可實際容納的兒童人數上限。

<ChildCapacity> 的值必須是介於 1 和 99 之間的正整數 (含 1 和 99)。如需範例,請參閱這裡

Transaction / PropertyDataSet / RoomData / OccupancySettings 0..1 OccupancySettings 可限制或修改房間內人數限制的設定。

<OccupancySettings> 元素可接受下列子元素:

  • <MinOccupancy>:房間可入住的最低房客人數。舉例來說,如果將這個屬性設為 2,就無法為單人入住預訂這個房間。

    <MinOccupancy> 的值必須是介於 1 和 99 之間的正整數 (包含 1 和 99)。

  • <MinAge>:所有入住房間的房客年齡下限。舉例來說,如果將這項屬性設為 18,則只有所有房客年滿 18 歲的團體才能預訂這個房間。

    <MinAge> 的值必須是介於 0 和 99 之間的正整數 (含兩者)。

<OccupancySettings>
  <MinOccupancy>2</MinOccupancy>
  <MinAge>16</MinAge>
</OccupancySettings>

但不必納入所有子系元素。

Transaction / PropertyDataSet / RoomData / PhotoURL 0..n PhotoURL 指定房間或房型套裝組合相片的網址和選用圖說。您可以為房間或房間套裝組指定多個 <PhotoURL>

這個元素可接受下列子元素:

  • <URL>:指定相片的位置。位置應為公開 (未受防火牆保護),且應包含通訊協定 (http://)。
  • <Caption>:定義相片的說明文字。這個元素會採用單一子元素 <Text>,其中包含兩個必要屬性 TextlanguageText 屬性是字幕,language 屬性則指定兩個字母的語言代碼,例如 en
<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

表示日式飯店房間的風格。

有效值如下:

  • western:西式客房,內有床。
  • japanese:日式客房,附日式床墊。
  • japanese_western:日式西式客房,提供西式床具和日式床墊。
Transaction / PropertyDataSet / RoomData / RoomFeatures / Beds 0..1 Object 包含房間內的所有 <Bed>。請注意,日本式床墊不應計入其中。

每個 <Bed> 都具有下列屬性:

  • size (選用):有效值為 singlesemi_doubledoublequeenking
每個 <Bed> 都包含下列子元素:
  • <Width> (選用):指定床寬。必須包含屬性 unit,其值為 cm,以及屬性 number,其值為床的寬度,以整數公分為單位。
  • <Length> (選用):指定床長。必須包含屬性 unit,其值為 cm,以及屬性 number,其值為床的長度,以整數公分為單位。
範例:
<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 這個房間是否與其他房客共用,例如房東或其他訪客。有效值為 sharedprivate
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_smokingsmoking
Transaction / PropertyDataSet / RoomData / RoomFeatures / BathAndToilet 0..1 Object 內含房間內浴室和廁所的相關資訊。

屬性如下:

  • relation (選用):指出浴室和馬桶彼此間的擺放方式。有效值為 together,例如浴室和廁所在同一個房間;separate,浴室和廁所各有專屬空間。如果房間沒有浴室和廁所,請勿設定這項屬性。

這個元素可選擇包含下列子元素:

  • <Bath> (選用):這個元素的存在表示房間有浴室。

    屬性包括:

    • bathtub (選用):表示浴室內有浴缸。有效值為 0 (或 false) 和 1 (或 true)。
    • shower (選用):表示浴室有淋浴間。有效值為 0 (或 false) 和 1 (或 true)。
  • <Toilet> (選用):這個元素的存在表示這個房間有馬桶。

    屬性包括:

    • electronic_bidet (選用):表示廁所有微電腦馬桶。有效值為 0 (或 false) 和 1 (或 true)。
    • mobility_accessible (選用):表示廁所為身障友善空間。有效值為 0 (或 false) 和 1 (或 true)。

範例:

<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 有效選項包括:

<AirportView/>
<BayView/>
<BeachView>/>
<CastleView/>
<CityView/>
<CountrysideView/>
<CourtyardView/>
<DuneView/>
<ForestView/>
<GardenView/>
<GolfCourseView/>
<HarborView/>
<LagoonView/>
<LakeView/>
<MarinaView/>
<MountainView/>
<NatureView/>
<OceanView/>
<ParkView/>
<PartialOceanView/>
<PisteView/>
<PoolView/>
<PyramidView/>
<RiverView/>
<StreetView/>

Transaction / PropertyDataSet / PackageData 0..n PackageData

用於描述費率功能和條款 (不屬於實體房間說明的部分) 的元素容器。

注意:至少必須有一個 <RoomData><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> 元素的容器。

如果指定 <AllowableRoomIDs>,父項 <PackageData> 元素中由 <PackageID> 識別的費率方案只能與 <AllowableRoomID> 元素定義的房型結合。

如果未指定 <AllowableRoomIDs>,則由父項 <PackageData> 元素中的 <PackageID> 識別的費率方案可與任何房型搭配使用。

<AllowablePackageIDs><AllowableRoomIDs> 請擇一使用,不能兩者同時使用。

Transaction / PropertyDataSet / PackageData / AllowableRoomIDs / AllowableRoomID 1..n AllowableRoomID 指定可與此費率方案搭配使用的房型 RoomID。房型會在 <RoomData> 元素中定義。
Transaction / PropertyDataSet / PackageData / Refundable 0..1 Refundable 讓房價顯示為可全額退款或可取消。如果未提供,系統就不會顯示退款相關資訊。

注意:建議您設定所有屬性。如果未設定一或多個屬性,系統就會產生動態饋給狀態警告訊息。

如果未設定任何屬性,系統不會將費率顯示為可退款。

設定屬性時,請注意下列事項:

  • 如果未設定 availablerefundable_until_days,系統就不會將費率顯示為可退款。
  • 如果 available0false,系統會忽略其他屬性。即使設定了一個或兩個其他屬性,系統也不會將費率顯示為可退款。
Transaction / PropertyDataSet / PackageData / Refundable / @available 1 boolean (必要) 將其設為 1true,表示費率是否允許全額退款;否則,請將其設為 0false
Transaction / PropertyDataSet / PackageData / Refundable / @refundable_until_days 0..1 integer (如果 availabletrue,則為必填項目) 指定在入住前幾天可申請全額退款的時間。refundable_until_days 的值必須是介於 0 至 330 之間的整數 (含兩者)。
Transaction / PropertyDataSet / PackageData / Refundable / @refundable_until_time 0.. Time (如果 availabletrue,強烈建議使用) 指定能夠全額退款的最晚日期和時間 (以飯店所在地時間為準)。您可以搭配使用 refundable_until_days 來指定退款條件,例如「退款期限為入住前兩天的下午 4 點」。如果未設定 refundable_until_time,則預設值為午夜。
Transaction / PropertyDataSet / PackageData / BreakfastIncluded 0..1 boolean 指定這個房型是否含早餐。有效值為 0 (或 false) 和 1 (或 true)。

建議您使用 <Meals> 而非 <BreakfastIncluded>

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 包含此套餐內含餐點的資訊。

<Meals> 元素會採用兩個選用子元素 <Breakfast><Dinner>,這些元素具有下列屬性:

  • included (必填):如果房價包含早餐/晚餐,請設為 1 (或 true);否則請設為 0false
  • in_room (選用):如果住客可選擇在入住的房間內享用早餐/晚餐,請將此屬性設為 1 (或 true);否則請設為 0 (或 false)。
  • in_private_space (選用):如果住客可在避免與其他住客接觸的空間 (不包括住宿房間) 享用早餐/晚餐,請將此屬性設為 1 (或 true);否則設為 0 (或 false)。
  • buffet (選用):如果早餐/晚餐是自助餐,請設為 1 (或 true);否則設為 0 (或 false)。

選用屬性僅會在 included 為 true 時使用。

如要讓膳食篩選器 (no mealsbreakfast onlydinner onlybreakfast and dinner) 運作,<Breakfast><Dinner> 都必須提供 included 屬性。

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>
      <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 收到上述訊息後,KingDouble 房型就會消失。請注意,移除套裝行程資料會影響整體費率方案,如同在「交易 (房源資料)」、「OTA_HotelRateAmountNotifRQ」和「OTA_HotelAvailNotifRQ」訊息中定義的 (透過參照相同的 PackageID 值),因此可能需要使用其他訊息類型進行相應更新,以反映 PackageID_2PackageID_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 表示交易訊息已順利處理,且未發生警告、錯誤或失敗。

每則訊息都會提供 <Success><Issues>

TransactionResponse / Issues 0..1 Issues 處理交易訊息時遇到一或多個問題的容器。

每則訊息都會提供 <Success><Issues>

TransactionResponse / Issues / Issue 1..n Issue 處理交易訊息時發生的警告、錯誤或失敗的說明。如要進一步瞭解這些問題,請參閱「動態饋給狀態錯誤訊息」。
TransactionResponse / Issues / Issue / @code 1 integer 問題的 ID。
TransactionResponse / Issues / Issue / @status 1 enum

遇到的問題類型。

有效值為 warningerrorfailure

範例

成功

以下是成功處理的交易訊息回應。

<?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>