本頁提供以 XML 為基礎的交易訊息參考資料。
<Transaction>
交易訊息的根元素為 <Transaction>
。這個容器會存放房型和套裝行程的說明資訊,以及房型和套裝行程的價格和空房資訊。
<Transaction>
元素會顯示在交易訊息 XML 階層的下列位置:
+<Transaction>
+<PropertyDataSet>
// Room and package metadata + <Property> +<RoomData>
+<PackageData>
+<Result>
// Pricing and availability +<Rates>
+<RoomBundle>
+ ...
使用 <Transaction>
做為根元素的訊息至少需要一個子元素。交易訊息可以包含任意數量的子項元素,只要訊息總大小不超過 100 MB 即可。
語法
<Transaction>
元素使用下列語法:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="timestamp" id="transaction_ID">
<!-- Defines data about a room or package (Room Bundle) -->
<PropertyDataSet>
...
</PropertyDataSet>
<!-- Updates/sets prices and availability for rooms and Room Bundles -->
<!-- (Also removes itineraries from inventory) -->
<Result>
...
</Result>
</Transaction>
屬性
<Transaction>
元素的屬性如下:
屬性 | 是否必要? | 類型 | 說明 |
---|---|---|---|
id | Required | string | 每則交易訊息的專屬 ID。 |
partner | Optional | string | 交易訊息所屬的合作夥伴帳戶。如果後端為多個合作夥伴帳戶提供價格動態饋給,通常會使用這個方法。這個字串值是 Hotel Center「帳戶設定」頁面中列出的「合作夥伴金鑰」值。 |
timestamp | Required | DateTime | 傳送交易訊息的時間。 系統會處理過去 24 小時內傳送的訊息,並捨棄其他訊息。 系統會依 |
子元素
<Transaction>
元素包含下列子項元素:
子項元素 | 是否必要? | 類型 | 說明 |
---|---|---|---|
<PropertyDataSet> | Optional* | <PropertyDataSet> |
說明特定房型和房型套裝組合。您通常會在個別的交易訊息中使用這個元素,定義房型組合的共用值,並縮減交易訊息的大小。 |
<Result> | Optional* | <Result> |
房型行程的價格資料,或定義房型套裝組合和房源其他房型的 |
* 至少必須有一個 <PropertyDataSet> 或 <Result> 。 |
範例
客房資料
以下範例會在交易訊息中定義房型資料:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
<PropertyDataSet>
<Property>1234</Property>
<RoomData>
<RoomID>5440OF</RoomID>
<Name>
<Text text="Single King Bed Room" language="en"/>
<Text text="Simple Lit de Roi" language="fr"/>
</Name>
<Description>
<Text text="One king bed with pillowtop mattresses, 300-thread-count linens,
and down comforters (bedspreads). City view. 300 square feet. Desk with
rolling chair. Multi-line phone with voice mail. Cable/satellite TV with
complimentary HBO and pay movies." language="en"/>
<Text text="Un très grand lit avec matelas à plateau-coussin, ..." language="fr"/>
</Description>
<PhotoURL>
<Caption>
<Text text="Bathroom View" language="en"/>
<Text text="La salle de baines" language="fr"/>
</Caption>
<URL>http://www.foo.com/static/bar/image1234.jpg</URL>
</PhotoURL>
<Capacity>4</Capacity>
</RoomData>
</PropertyDataSet>
</Transaction>
價格資料
以下範例會在「交易」訊息中定義價格資料:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-23T16:20:00-04:00" id="42">
<Result>
<Property>060773</Property>
<RoomID>RoomType101</RoomID>
<PackageID>Package101</PackageID>
<Checkin>2018-06-10</Checkin>
<Nights>2</Nights>
<Baserate currency="USD">278.33</Baserate>
<Tax currency="USD">25.12</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<AllowablePointsOfSale>
<PointOfSale id="site1"/>
</AllowablePointsOfSale>
</Result>
<Result>
<Property>052213</Property>
<RoomID>RoomType101</RoomID>
<PackageID>Package101</PackageID>
<Checkin>2018-06-10</Checkin>
<Nights>2</Nights>
<Baserate currency="USD">299.98</Baserate>
<Tax currency="USD">26.42</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<AllowablePointsOfSale>
<PointOfSale id="otto"/>
<PointOfSale id="simon"/>
</AllowablePointsOfSale>
<MilesIncluded>
<NumberOfMiles>1200</NumberOfMiles>
<Provider>
<Text language="en" text="United Airlines"/>
</Provider>
<LoyaltyCampaignID>my_campaign</LoyaltyCampaignID>
</MilesIncluded>
</Result>
</Transaction>
每晚房價
以下範例定義 2023 年 6 月 7 日起 1 至 7 晚的房價資料:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-08-24T16:20:00-04:00" id="42">
<Result>
<Property>1234</Property>
<Checkin>2018-06-07</Checkin>
<Nights>1</Nights>
<Baserate currency="USD">209.99</Baserate>
<Tax currency="USD">25.12</Tax>
<OtherFees currency="USD">2.00</OtherFees>
</Result>
<Result>
<Property>1234</Property>
<Checkin>2018-06-07</Checkin>
<Nights>2</Nights>
<Baserate currency="USD">419.98</Baserate>
<Tax currency="USD">25.12</Tax>
<OtherFees currency="USD">2.00</OtherFees>
</Result>
<Result>
<Property>1234</Property>
<Checkin>2018-06-07</Checkin>
<Nights>3</Nights>
<Baserate currency="USD">614.97</Baserate>
<Tax currency="USD">21.12</Tax>
<OtherFees currency="USD">2.00</OtherFees>
</Result>
<Result>
<Property>1234</Property>
<Checkin>2018-06-07</Checkin>
<Nights>4</Nights>
<Baserate currency="USD">819.96</Baserate>
<Tax currency="USD">21.12</Tax>
<OtherFees currency="USD">2.00</OtherFees>
</Result>
<Result>
<Property>1234</Property>
<Checkin>2018-06-07</Checkin>
<Nights>5</Nights>
<Baserate currency="USD">999.95</Baserate>
<Tax currency="USD">21.12</Tax>
<OtherFees currency="USD">2.00</OtherFees>
</Result>
<Result>
<Property>1234</Property>
<Checkin>2018-06-07</Checkin>
<Nights>6</Nights>
<Baserate currency="USD">1193.94</Baserate>
<Tax currency="USD">21.12</Tax>
<OtherFees currency="USD">2.00</OtherFees>
</Result>
<Result>
<Property>1234</Property>
<Checkin>2018-06-07</Checkin>
<Nights>7</Nights>
<Baserate currency="USD">1259.93</Baserate>
<Tax currency="USD">21.12</Tax>
<OtherFees currency="USD">2.00</OtherFees>
</Result>
</Transaction>
基本費率和條件式費率
以下範例顯示包含基本費率和條件費率的交易訊息:
<?xml version="1.0" encoding="UTF-8" ?>
<Transaction timestamp="2023-05-18T16:20:00-04:00" id="42">
<Result>
<Property>1234</Property>
<Checkin>2023-04-10</Checkin>
<Nights>1</Nights>
<Baserate currency="USD">200.00</Baserate>
<Tax currency="USD">20.00</Tax>
<OtherFees currency="USD">1.00</OtherFees>
<Rates>
<!-- The rate_rule_id is required when using conditional rates -->
<Rate rate_rule_id="mobile">
<!-- Override base rate and taxes for conditional rates -->
<Baserate currency="USD">180.00</Baserate>
<Tax currency="USD">18.00</Tax>
</Rate>
</Rates>
</Result>
</Transaction>
移除商品目錄
以下範例會從飯店的房源中移除多個房源 (多個不同日期的 1 晚住宿):
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2023-05-23T16:20:00-04:00" id="42">
<Result>
<Property>1123581321</Property>
<Checkin>2023-05-23</Checkin>
<Nights>1</Nights>
<Unavailable>
<NoVacancy/>
</Unavailable>
<Tax currency="USD">0</Tax>
<OtherFees currency="USD">0</OtherFees>
</Result>
<Result>
<Property>1123581321</Property>
<Checkin>2023-05-24</Checkin>
<Nights>1</Nights>
<Unavailable>
<NoVacancy/>
</Unavailable>
<Tax currency="USD">0</Tax>
<OtherFees currency="USD">0</OtherFees>
</Result>
<!---Sending <Baserate> is optional with <Unavailable> -->
<Result>
<Property>1123581321</Property>
<Checkin>2023-05-25</Checkin>
<Nights>1</Nights>
<Baserate currency="USD">-1</Baserate>
<Unavailable>
<NoVacancy/>
</Unavailable>
<Tax currency="USD">0</Tax>
<OtherFees currency="USD">0</OtherFees>
</Result>
</Transaction>
<PropertyDataSet>
訊息中客房和套裝行程 (或房型套裝組合) 資訊的容器。<Transaction>
飯店設定的值會覆寫合作夥伴設定的值。
Google 會儲存這項資訊,因此您不必在每次傳送價格更新時定義這項資訊。
<PropertyDataSet>
元素會顯示在交易訊息 XML 階層的下列位置:
+<Transaction>
+<PropertyDataSet>
// Room and package metadata + <Property> +<RoomData>
+<PackageData>
+<Result>
// Pricing and availability +<Rates>
+<RoomBundle>
+ ...
詳情請參閱「Room Bundle 中繼資料」。
語法
<PropertyDataSet>
元素使用下列語法:
<?xml version="1.0" encoding="UTF-8"?> <Transaction ... > <PropertyDataSet> <!-- (Required) ID that matches the Hotel List Feed --> <Property>hotel_ID</Property> <!-- (Optional) Defines metadata about a room --> <RoomData> ... </RoomData> <!-- (Optional) Defines package metadata to be paired with rooms (Room Bundles) --> <PackageData> ... </PackageData> </PropertyDataSet> ... </Transaction>
屬性
<PropertyDataSet>
元素沒有屬性。
子元素
<PropertyDataSet>
元素包含下列子項元素:
子項元素 | 是否必要? | 類型 | 說明 |
---|---|---|---|
<PackageData> | Optional* | <PackageData> |
說明房型套裝組合。這類資料與合作夥伴和飯店相關聯,但與行程無關。這個元素與 <RoomData> 類似,但描述的設施和條款不屬於實體房源說明。在價格更新中參照套裝組合 ID。 詳情請參閱會議室組合包中繼資料。 |
<Property> | Required | string | 相關資料適用的飯店 ID。這個元素的值必須是與飯店清單動態饋給中<id> 相符的字串。 |
<RoomData> | Optional* | <RoomData> |
說明房間。這項資料與合作夥伴和飯店相關聯,但與行程無關。 您會在價格更新中參照房源 ID。 |
* 至少必須有一個 <PackageData> 或 <RoomData> 。 |
範例
客房和套裝行程資料
以下範例顯示 <PropertyDataSet>
中的房型和套裝組合資料:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
<PropertyDataSet>
<Property>180054</Property>
<RoomData>
<RoomID>060773</RoomID>
<Name>
<Text text="Single Bed Room" language="en"/>
<Text text="Chambre single" language="fr"/>
</Name>
<Description>
<Text text="Non-smoking" language="en"/>
<Text text="Pas de fumiers" language="fr"/>
</Description>
<PhotoURL>
<Caption>
<Text text="Living area" language="en"/>
<Text text="Le chambre" language="fr"/>
</Caption>
<URL>http://www.foo.com/static/bar/image1234.jpg</URL>
</PhotoURL>
</RoomData>
<PackageData>
<PackageID>P54321</PackageID>
<Name>
<Text text="Breakfast Included" language="en"/>
<Text text="Avec le petit déjeuner" language="fr"/>
</Name>
<Description>
<Text text="Includes a delightful array of jams and jellies." language="en"/>
<Text text="Comprend une délicieuse gamme de confitures et gelées." language="fr"/>
</Description>
<BreakfastIncluded>1</BreakfastIncluded>
</PackageData>
</PropertyDataSet>
</Transaction>
傳送這個房型和房型套裝組合的價格和空房情形時,請在價格訊息中參照房型和套裝行程 ID。這樣一來,您就能大幅縮減訊息大小,並減少因資料重複而可能發生的錯誤。詳情請參閱會議室套裝組合中繼資料。
<RoomData>
定義與行程無關的房型中繼資料,並延伸至房型套裝組合 (因為房型套裝組合是房型加上額外設施)。使用 <RoomData>
減少價格動態饋給中描述性資料的重複內容。
<RoomData>
元素會顯示在交易訊息 XML 階層的下列位置:
+<Transaction>
+<PropertyDataSet>
// Room and package metadata + <Property> +<RoomData>
+<PackageData>
+<Result>
// Pricing and availability +<Rates>
+<RoomBundle>
+ ...
<RoomData>
元素包含與合作夥伴和飯店相關的資訊,但不包含行程。適用於所有非行程資料。
<RoomData>
元素與 <PackageData>
類似,但描述的是實體房間,而非套裝方案的設施和條款。您會一併使用 <RoomData>
和 <PackageData>
,提供房型套裝組合的詳細資料。如果個別房源不屬於套裝行程,請只使用 <RoomData>
。
您可以為同一個房間或房間組合定義 <RoomData>
和 <PackageData>
元素。當 Google 在搜尋結果中顯示該房型或套裝行程時,會一併顯示兩者的說明,並以連字號分隔。
詳情請參閱「Room Bundle 中繼資料」。
語法
<RoomData>
元素使用下列語法:
<?xml version="1.0" encoding="UTF-8"?> <Transaction ... > <PropertyDataSet> ... <RoomData> <RoomID>room_ID</RoomID> <Name> <Text text="room_name" language="language_code"/> ... </Name> <Description> <Text text="room_description" language="language_code"/> ... </Description> <Capacity>max_number_of_occupants</Capacity> <Occupancy>max_number_of_intended_occupants</Occupancy> <OccupancyDetails> <!-- optional info about the types of guests, whether adults, children, or seniors --></OccupancyDetails> <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> ... </RoomFeatures> </RoomData> ... </PropertyDataSet> </Transaction>
屬性
<RoomData>
元素沒有屬性。
子元素
<RoomData>
元素包含下列子項元素:
子項元素 | 是否必要? | 類型 | 說明 |
---|---|---|---|
<Capacity> | Optional | integer | 客房實際可容納的房客人數上限。客房的容納人數大於或等於入住人數。
指定的值必須大於或等於
|
<Description> | Optional | Object | 房間的詳細說明。這個元素應包含其他元素或 <Name> 元素未說明的資訊。指定房間說明時,請勿全部使用大寫字母。
針對廣告或免費預訂連結可能顯示的每種語言,使用個別的 以下範例顯示法文和英文版本的房型說明: <Description> <Text text="Two queen-sized beds" language="en"/> <Text text="Deux lits de la reine" language="fr"/> </Description> |
<Name> | Required | string | 房型類別名稱。這個值應與飯店到達網頁 (舊稱銷售點) 上顯示的資訊一致。請勿將這個元素的值設為全大寫。
這個元素會採用單一子元素
針對廣告或免費預訂連結可能顯示的每種語言,使用個別的 以下範例顯示房型名稱的法文和英文版本: <Name> <Text text="Standard Double Room" language="en"/> <Text text="Le chambre double" language="fr"/> </Name> |
<Occupancy> | Optional | integer | 客房適用的房客人數上限。
舉例來說,大型套房可能實際可容納 6 位房客 (容量 = 6),但僅供最多 4 位房客入住。 這個值必須小於或等於
|
<OccupancySettings> | Optional | Object | 可限制或修改會議室入住人數規定的設定。
<OccupancySettings> <MinOccupancy>2</MinOccupancy> <MinAge>16</MinAge> </OccupancySettings> 不必納入所有子元素。 |
<PhotoURL> | Optional | Object | 指定房型或房型套裝組合的相片網址和說明 (選填)。您可以為會議室或會議室套裝組合指定多個 <PhotoURL>
。每個相片網址都必須位於各自的 <PhotoURL> 中。這個元素會採用下列子項元素:
範例: <PhotoURL> <URL>https://www.example.com/static/bar/image1234.jpg</URL> <Caption> <Text text="A bright and breezy way to enjoy your mornin' cuppa tea." language="en"/> <Text text="Une façon lumineuse et aérée pour profiter de votre journée tasse de thé." language="fr"/> </Caption> </PhotoURL> <PhotoURL> <URL>https://www.foo.com/static/bar/image5678.jpg</URL> <Caption> <Text text="Or, perhaps you prefer coffee." language="en"/> <Text text="Ou peut-être préférez-vous le café." language="fr"/> </Caption> </PhotoURL> |
<RoomFeatures> | Optional | <RoomFeatures> |
內含會議室功能的相關資訊。 |
<RoomID> | Required | string | 客房的專屬 ID。使用這個 ID,將房型資料與價格更新中的 <Result> 區塊相符。如需更多資訊,請參閱會議室組合中繼資料。(您也可以在定義房型資料時,使用這個 ID 參照單一交易訊息中的通用房型定義)。 |
範例
客房資料
以下範例定義了房間資料:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
<PropertyDataSet>
<Property>1234</Property>
<RoomData>
<RoomID>5440OF</RoomID>
<Name>
<Text text="Single King Bed Room" language="en"/>
<Text text="Simple Lit de Roi" language="fr"/>
</Name>
<Description>
<Text text="One king bed with pillowtop mattresses, 300-thread-count linens,
and down comforters (bedspreads). City view. 300 square feet. Desk with
rolling chair. Multi-line phone with voice mail. Cable/satellite TV with
complimentary HBO and pay movies." language="en"/>
<Text text="Un très grand lit avec matelas à plateau-coussin, ..." language="fr"/>
</Description>
<PhotoURL>
<Caption>
<Text text="Bathroom View" language="en"/>
<Text text="La salle de baines" language="fr"/>
</Caption>
<URL>http://www.foo.com/static/bar/image1234.jpg</URL>
</PhotoURL>
<Capacity>4</Capacity>
</RoomData>
</PropertyDataSet>
</Transaction>
房型和套裝行程中繼資料
以下範例定義了房間和套件中繼資料:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
<PropertyDataSet>
<Property>180054</Property>
<RoomData>
<RoomID>060773</RoomID>
<Name>
<Text text="Single Bed Room" language="en"/>
<Text text="Chambre single" language="fr"/>
</Name>
<Description>
<Text text="Non-smoking" language="en"/>
<Text text="Pas de fumiers" language="fr"/>
</Description>
<PhotoURL>
<Caption>
<Text text="Living area" language="en"/>
<Text text="Le chambre" language="fr"/>
</Caption>
<URL>http://www.foo.com/static/bar/image1234.jpg</URL>
</PhotoURL>
</RoomData>
<PackageData>
<PackageID>P54321</PackageID>
<Name>
<Text text="Breakfast Included" language="en"/>
<Text text="Avec le petit déjeuner" language="fr"/>
</Name>
<Description>
<Text text="Includes a delightful array of jams and jellies." language="en"/>
<Text text="Comprend une délicieuse gamme de confitures et gelées." language="fr"/>
</Description>
<BreakfastIncluded>1</BreakfastIncluded>
</PackageData>
</PropertyDataSet>
</Transaction>
多個房型套裝組合
以下範例會為多個 Room Bundle 定義房間和套件中繼資料:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
<!-- A transaction message with room types result. -->
<PropertyDataSet>
<Property>12345</Property>
<RoomData>
<RoomID>single</RoomID>
<Name>
<Text text="Single room" language="en"/>
<Text text="Chambre simple" language="fr"/>
</Name>
<Description>
<Text text="A single room" language="en"/>
<Text text="Le chambre simple" language="fr"/>
</Description>
<PhotoURL>
<Caption>
<Text text="Living area" language="en"/>
<Text text="Le chambre" language="fr"/>
</Caption>
<URL>http://www.foo.com/static/bar/image1234.jpg</URL>
</PhotoURL>
<PhotoURL>
<URL>http://www.foo.com/static/bar/image1235.jpg</URL>
</PhotoURL>
<Capacity>2</Capacity>
</RoomData>
<RoomData>
<RoomID>double</RoomID>
<Name>
<Text text="Double room" language="en"/>
<Text text="Chambre double" language="fr"/>
</Name>
<Occupancy>1</Occupancy>
</RoomData>
<PackageData>
<PackageID>refundbreakfast</PackageID>
<Name>
<Text text="Refundable Room with Breakfast" language="en"/>
<Text text="Chambre remboursable avec le petit déjeuner" language="fr"/>
</Name>
<Description>
<Text text="Continental Breakfast" language="en"/>
<Text text="Petit déjeuner continental" language="fr"/>
</Description>
<ChargeCurrency>hotel</ChargeCurrency>
<Refundable available="1" refundable_until_days="3"/>
<BreakfastIncluded>1</BreakfastIncluded>
</PackageData>
<PackageData>
<PackageID>prepaid</PackageID>
<Name>
<Text text="Nonrefundable" language="en"/>
<Text text="Non remboursable" language="fr"/>
</Name>
<Description>
<Text text="Blah blah blad" language="en"/>
<Text text="Le blah blah blad" language="fr"/>
</Description>
<Occupancy>2</Occupancy>
<ChargeCurrency>web</ChargeCurrency>
<Refundable available="0"/>
</PackageData>
</PropertyDataSet>
</Transaction>
<RoomFeatures>
定義房間內的功能。
<RoomFeatures>
元素會顯示在交易訊息 XML 階層的下列位置:
+<Transaction>
+<PropertyDataSet>
// Room and package metadata + <Property> +<RoomData>
+<RoomFeatures>
語法
<RoomFeatures>
元素使用下列語法:
<?xml version="1.0" encoding="UTF-8"?> <Transaction ... > <PropertyDataSet ... > ... <RoomData> <RoomFeatures> <JapaneseHotelRoomStyle>[western|japanese|japanese_western]</JapaneseHotelRoomStyle> <Beds> <Bed size="[single|semi_double|double|queen|king]"> <Width unit="cm" number="width"/> <Length unit="cm" number="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> ... </PropertyDataSet> </Transactions>
屬性
<RoomFeatures>
元素沒有屬性。
子元素
<RoomFeatures>
元素包含下列子項元素:
子項元素 | 是否必要? | 類型 | 說明 |
---|---|---|---|
<JapaneseHotelRoomStyle> | Optional | enum | 表示日式飯店客房的風格。 有效值如下:
|
<Beds> | Optional | Object | 包含與房間數量相同的 <Bed> 。請注意,這裡不應計入日式床墊。每個
<Bed> 都具有下列子元素:
<Beds> <Bed size="double"> <Width unit="cm" number="140"/> <Length unit="cm" number="195"/> </Bed> <Bed/> <!-- Size unknown --> </Beds> |
<Suite> | Optional | empty | 如果房間是套房,請提供這個元素。 |
<Capsule> | Optional | empty | 如果這個房間是膠囊旅館,請提供這個元素。 |
<Roomsharing> | Optional | enum | 這個房間是否與其他房客共用,例如屋主或其他房客。有效值為 shared 和 private 。 |
<Outdoor> | Optional | empty | 如果房間是沒有固定牆壁、水管和氣候控制的戶外住宿,請提供這項元素。舉例來說,飯店客房並非戶外住宿,但房客在露營區搭帳篷,以及房客自備露營車的露營車公園,都屬於戶外住宿。 |
<MobilityAccessible> | Optional | empty | 如果會議室適合行動不便者使用,請提供這個元素。 |
<Smoking> | Optional | enum | 這個房間是否為禁菸房或吸菸房。有效值為 non_smoking 和 smoking 。 |
<BathAndToilet> | Optional | Object | 內含房間的浴室和廁所相關資訊。
屬性為:
這個元素可選擇採用下列子元素:
範例: <BathAndToilet relation="separate"> <Bath bathtub="1" shower="1"/> <Toilet electronic_bidet="1" mobility_accessible="1"/> </BathAndToilet> |
<OpenAirBath> | Optional | empty | 如果客房設有私人露天浴池,請提供這項元素。 |
<AirConditioning> | Optional | empty | 如果房間設有空調,請提供這個元素。 |
<Balcony> | Optional | empty | 如果房間設有陽台或涼台,請提供這個元素。 |
<Views> | Optional | Object | 有效選項包括:
|
範例
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
rooms 中沒有床位數量資訊,請按照以下範例操作:
<?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>
<PackageData>
定義房源的房型套裝組合行程獨立中繼資料。 這個元素包含與合作夥伴和飯店相關的資訊,但不包含行程資訊。目的是定義所有非行程資料一次,並從行程資料參照。
<PackageData>
元素會顯示在交易訊息 XML 階層的下列位置:
+<Transaction>
+<PropertyDataSet>
// Room and package metadata + <Property> +<RoomData>
+<PackageData>
+<Result>
// Pricing and availability +<Rates>
+<RoomBundle>
+ ...
<PackageData>
元素與 <RoomData>
類似,但會說明不屬於實體房間描述的費率功能和條款。您可一併使用 <RoomData>
和 <PackageData>
,提供房型組合和費率功能的詳細資料。如果是套裝組合以外的個別房型,請只使用 <RoomData>
。
您可以為同一間會議室或會議室組合定義 <RoomData>
和 <PackageData>
元素。當 Google 在搜尋結果中顯示該房型或套裝行程時,會一併顯示兩者的說明,並以連字號分隔。
如果更新資源的單一 <PackageData>
元素,就必須更新資源的所有 <PackageData>
和 <RoomData>
元素。每個 <PropertyDataSet>
都視為資源的所有資料,並會覆寫任何現有資料。
詳情請參閱「Room Bundle 中繼資料」。
語法
<PackageData>
元素使用下列語法:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction ... >
<PropertyDataSet ... >
<PackageData>
<PackageID>package_ID</PackageID>
<Name>
<Text text="package_name" language="language_code"/>
...
</Name>
<Description>
<Text text="package_description" language="language_code"/>
...
</Description>
<Refundable available="[false|true]" refundable_until_days="number_of_days"
refundable_until_time="time"/>
<ChargeCurrency>[deposit|hotel|installments|web]</ChargeCurrency>
<Occupancy>max_number_of_intended_occupants</Occupancy>
<OccupancyDetails><!-- optional info about the types of guests,
whether adults or children --></OccupancyDetails>
<!-- 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>
<MembershipBenefitsIncluded>
<ProgramName>
<Text language="en" text="Special Rewards">
</ProgramName>
<ProgramLevel>
<Text language="en" text="Platinum">
</ProgramLevel>
</MembershipBenefitsIncluded>
<OnPropertyCredit>
<Amount currency="USD">123.45</Amount>
</OnPropertyCredit>
</PackageData>
<!-- a PackageID with a MilesIncluded
rate feature -->
<PackageData>
<PackageID>room_with_miles</PackageID>
<Name>
<Text text="Room with Bundled Miles" language="en">
</Name>
<ChargeCurrency>hotel </ChargeCurrency>
<MilesIncluded>
<NumberOfMiles>integer</NumberOfMiles>
<Provider>
<Text language="en" text="provider-name">
</Provider>
<!-- Add Loyalty point information -->
<LoyaltyCampaignID>campaign_ID</LoyaltyCampaignID>
</MilesIncluded>
</PackageData>
...
...
</PropertyDataSet>
...
</Transaction>
屬性
<PackageData>
元素沒有屬性。
子元素
<PackageData>
元素包含下列子項元素:
子項元素 | 是否必要? | 類型 | 說明 |
---|---|---|---|
<BreakfastIncluded> | Optional | boolean | 指定這個套裝組合的房價是否包含早餐。
有效值為 0 (或 false ) 和 1
(或 true )。
建議您使用 |
<ChargeCurrency> | Optional | enum | 使用者支付預訂費用的時間和地點。這個元素使用的語法與 <Result> 中的 <ChargeCurrency> 相同。預設值為 |
<CheckinTime> | Optional | Time | 最早可入住時間。 時間必須小於飯店當地時間 24:00。 |
<CheckoutTime> | Optional | Time | 最晚退房時間 (以飯店所在地時間為準)。 |
<Description> | Optional | Object | 套裝組合的詳細說明。這個元素應包含其他元素或 <Name> 元素未說明的資訊。指定房間說明時,請勿全部使用大寫字母。
<Description> <Text text="Two breakfast buffet certificates for each night of stay." language="en"/> <Text text="Deux certificats petit-déjeuner buffet pour chaque nuit de séjour." language="fr"/> </Description> |
<InternetIncluded> | Optional | boolean | 如果套裝行程包含免費網路存取,其他套裝行程則不包含這項設施。如果飯店為所有客房提供免費網路,請勿為客房組合設定這個元素。這項元素不適用於客房內無法使用的有線或無線網路。有效值為 0 (或 false ) 和 1 (或 true )。 |
<Meals> | Optional | Object | 內含這個套裝組合的餐點資訊。
只有在 如要使用餐點篩選器 ( |
<Name> | Required | string | 套件名稱。這個值應與飯店到達網頁上顯示的內容一致。請勿將這個元素的值設為全大寫字母。
這個元素會採用單一子元素 <Name> <Text text="Bed and Breakfast" language="en"/> <Text text="Lit et petit déjeuné" language="fr"/> </Name> |
<Occupancy> | Optional | integer | 房型套裝組合適用的房客人數上限。
舉例來說,大型套房可能實際可容納 6 位房客,但僅供最多 4 位房客入住。
這個值必須小於或等於
如果您在 注意: <Occupancy> 可能會隨附 <OccupancyDetails> ,用於指定訪客類型 (成人或兒童)。如要瞭解語法和子項元素的說明,請參閱 <OccupancyDetails> 。 |
<PackageID> | Required | string | 套件的專屬 ID。使用這個 ID,將 Room Bundle 資料與價格更新中的 (您也可以使用這個 ID,在定義內嵌房型套裝組合資料時,參照單一交易訊息中使用的通用房型套裝組合定義)。 |
<ParkingIncluded> | Optional | boolean | 如果停車位原本是這間飯店的付費服務,但房型組合包含免費停車位,如果飯店提供免費停車位,請勿為這個元素指定值。 有效值為 |
<PhotoURL> | Optional | Object | (與 <RoomData> 中的 <PhotoURL> 相同,
但適用於套件 (例如餐點相片)。)
|
<Refundable> | Optional | Object | 可將房價列為全額退款或提供免費取消。如果未提供,系統就不會顯示退款資訊。
<PackageData> 層級的退款政策會覆寫 <Result> 層級的退款政策。<Rates> 層級的退款政策會覆寫 <PackageData> 層級的退款政策。你也可以透過其他選項向使用者強調可退款價格,而不直接修改交易訊息結構定義。進一步瞭解這些選項
可退款房價政策。
以下範例顯示已設定所有屬性的 <Refundable available="1" refundable_until_days="7" refundable_until_time="18:00:00"/> 注意:建議您設定所有屬性。如果未設定一或多個屬性,系統就會產生動態饋給狀態警告訊息。 如未設定任何屬性,費率就不會顯示為可退款。屬性包括:
設定屬性時,請注意下列事項:
|
<MembershipBenefits |
Optional | boolean | 房價包含住宿期間的頂級會員福利。包含下列參數:
|
<CarRentalIncluded> | Optional | boolean | 房價包含住宿期間免費租車服務。 |
<MilesIncluded> | Optional | boolean | 房價包含飛行常客里程數。參數包括:
注意: |
<OnPropertyCredit> | Optional | boolean | 房價包含飯店內消費抵免額 (餐飲、度假村、SPA 等)。參數:
|
<AirportTransportationIncluded> | Optional | Object | 房價包含往返附近機場的免費交通服務。選用的 direction 屬性會指定交通運輸的方向性。有效值包括:
from :提供從機場到住宿的交通服務。如果未指定方向,則這是預設值。
to :飯店提供機場接送服務。round_trip :提供往返機場的交通服務。
|
範例
單一房型套裝組合
以下範例定義單一房型組合,入住人數為 2 人 (一位成人和一位兒童),並包含早餐:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
<PropertyDataSet>
<Property>1234</Property>
<PackageData>
<Occupancy>2</Occupancy>
<OccupancyDetails>
<NumAdults>1</NumAdults>
<Children>
<Child age="17"/>
</Children>
</OccupancyDetails>
<PackageID>P54321</PackageID>
<Name>
<Text text="Breakfast Included" language="en"/>
<Text text="Avec le petit déjeuner" language="fr"/>
</Name>
<Description>
<Text text="Two certificates for continental
breakfast will be provided." language="en"/>
<Text text="Deux certificats pour le petit déjeuner
continental seront fournis." language="fr"/>
</Description>
<BreakfastIncluded>1</BreakfastIncluded>
</PackageData>
</PropertyDataSet>
</Transaction>
房間和套件中繼資料
以下範例定義了房間和套件中繼資料:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
<PropertyDataSet>
<Property>180054</Property>
<RoomData>
<RoomID>060773</RoomID>
<Name>
<Text text="Single Bed Room" language="en"/>
<Text text="Chambre single" language="fr"/>
</Name>
<Description>
<Text text="Non-smoking" language="en"/>
<Text text="Pas de fumiers" language="fr"/>
</Description>
<PhotoURL>
<Caption>
<Text text="Living area" language="en"/>
<Text text="Le chambre" language="fr"/>
</Caption>
<URL>http://www.foo.com/static/bar/image1234.jpg</URL>
</PhotoURL>
</RoomData>
<PackageData>
<PackageID>P54321</PackageID>
<Name>
<Text text="Breakfast Included" language="en"/>
<Text text="Avec le petit déjeuner" language="fr"/>
</Name>
<Description>
<Text text="Includes a delightful array of jams and jellies." language="en"/>
<Text text="Comprend une délicieuse gamme de confitures et gelées." language="fr"/>
</Description>
<BreakfastIncluded>1</BreakfastIncluded>
</PackageData>
</PropertyDataSet>
</Transaction>
多個房型套裝組合
以下範例會為多個 Room Bundle 定義房間和套件中繼資料:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
<!-- A transaction message with room types result. -->
<PropertyDataSet>
<Property>12345</Property>
<RoomData>
<RoomID>single</RoomID>
<Name>
<Text text="Single room" language="en"/>
<Text text="Chambre simple" language="fr"/>
</Name>
<Description>
<Text text="A single room" language="en"/>
<Text text="Le chambre simple" language="fr"/>
</Description>
<PhotoURL>
<Caption>
<Text text="Living area" language="en"/>
<Text text="Le chambre" language="fr"/>
</Caption>
<URL>http://www.foo.com/static/bar/image1234.jpg</URL>
</PhotoURL>
<PhotoURL>
<URL>http://www.foo.com/static/bar/image1235.jpg</URL>
</PhotoURL>
<Capacity>2</Capacity>
</RoomData>
<RoomData>
<RoomID>double</RoomID>
<Name>
<Text text="Double room" language="en"/>
<Text text="Chambre double" language="fr"/>
</Name>
<Occupancy>1</Occupancy>
</RoomData>
<PackageData>
<PackageID>refundbreakfast</PackageID>
<Name>
<Text text="Refundable Room with Breakfast" language="en"/>
<Text text="Chambre remboursable avec le petit déjeuner" language="fr"/>
</Name>
<Description>
<Text text="Continental Breakfast" language="en"/>
<Text text="Petit déjeuner continental" language="fr"/>
</Description>
<ChargeCurrency>hotel</ChargeCurrency>
<Refundable available="1" refundable_until_days="3"/>
<BreakfastIncluded>1</BreakfastIncluded>
</PackageData>
<PackageData>
<PackageID>prepaid</PackageID>
<Name>
<Text text="Nonrefundable" language="en"/>
<Text text="Non remboursable" language="fr"/>
</Name>
<Description>
<Text text="Blah blah blad" language="en"/>
<Text text="Le blah blah blad" language="fr"/>
</Description>
<Occupancy>2</Occupancy>
<ChargeCurrency>web</ChargeCurrency>
<Refundable available="0"/>
</PackageData>
</PropertyDataSet>
</Transaction>
房型套裝組合 (含房價)
以下範例定義含有房價功能的 Room 組合的房型和套裝組合中繼資料:
<Transaction timestamp="2010-04-24T20:44:56-04:00" id="TXNID">
<PropertyDataSet>
<Property>12345</Property>
<RoomData>
...
</RoomData>
<!-- definitions of PackageData types including rate features -->
<PackageData>
<PackageID>room_with_addl_benefits</PackageID>
<Name>
<Text text="Acme Hotels 2017 Promotion Package" language="en"/>
</Name>
<ChargeCurrency>hotel</ChargeCurrency>
<BreakfastIncluded>1</BreakfastIncluded>
<MembershipBenefitsIncluded>
<ProgramName>
<Text language="en" text="Marriott Rewards"/>
</ProgramName>
<ProgramLevel>
<Text language="en" text="Platinum"/>
</ProgramLevel>
</MembershipBenefitsIncluded>
<OnPropertyCredit>
<Amount currency="USD">123.45</Amount>
</OnPropertyCredit>
</PackageData>
<PackageData>
<PackageID>room_with_miles</PackageID>
<Name>
<Text text="Room with Bundled Miles" language="en"/>
</Name>
<ChargeCurrency>hotel</ChargeCurrency>
<MilesIncluded>
<NumberOfMiles>1000</NumberOfMiles>
<LoyaltyCampaignID>my_campaign</LoyaltyCampaignID>
</MilesIncluded>
<AirportTransportationIncluded direction="from"/>
</PackageData>
</PropertyDataSet>
<!-- The actual list of prices -->
<Result>
…
</Result>
</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>
<Result>
<Transaction>
訊息中的價格和供應情形更新容器。
<Result>
元素會顯示在交易訊息 XML 階層的下列位置:
+<Transaction>
+<PropertyDataSet>
// Room and package metadata + <Property> +<RoomData>
+<PackageData>
+<Result>
// Pricing and availability +<Rates>
+<RoomBundle>
+ ...
使用 <Result>
設定或更新房價,並定義可用的房源。這個元素中定義的項目通常會參照 <PackageData>
和 <RoomData>
中定義的行程獨立中繼資料,例如房間或套裝方案的說明或設施組合。
您通常會非常頻繁地傳送交易訊息,並更新價格。 具體做法和頻率取決於放送模式。
如要移除行程,請在交易訊息中使用 <Result>
,詳情請參閱「移除房源」。如要進一步瞭解如何使用交易訊息更新價格和供應情形,請參閱「新增及更新房源資訊」。
單一交易訊息可包含任意數量的 <Result>
元素,只要訊息大小不超過 100 MB 即可。
語法
<Result>
元素使用下列語法:
<?xml version="1.0" encoding="UTF-8"?> <Transaction ... > <Result> <!-- Required --> <Property>hotel_ID</Property> <!-- Required --> <Checkin>YYYY-MM-DD</Checkin> <!-- Required --> <Nights>number_of_nights</Nights> <Baserate currency="currency_code">price</Baserate> <!-- Only required when <Baserate> contains a real price --> <Tax currency="currency_code">tax_amount</Tax> <!-- Only required when <Baserate> contains a real price --> <OtherFees currency="currency_code">fee_amount</OtherFees> <Refundable available="[false|true]" refundable_until_days="number_of_days" refundable_until_time="time"/> <RoomID>room_ID</RoomID> <PackageID>package_ID</PackageID> <ExpirationTime>expiration_time</ExpirationTime> <ChargeCurrency>[deposit|hotel|installments|web]</ChargeCurrency> <Occupancy>max_number_of_intended_occupants</Occupancy> <!-- For Baserate, occupancy value must be greater than or equal to 2. If a value is not provided for occupancy, it defaults to 2. --> <!-- Child occupancy rates should only be sent through Live pricing with context and not through Pull or Changed pricing --> <OccupancyDetails>occupancy_info</OccupancyDetails> <Rates>...</Rates> <RoomBundle>...</RoomBundle> <AllowablePointsOfSale> <PointOfSale id="landing_page_identifier"/> ... </AllowablePointsOfSale> <MilesIncluded> <NumberOfMiles>integer</NumberOfMiles> <Provider> <Text language="en" text="provider-name"> </Provider> <!-- Add Loyalty point information --> <LoyaltyCampaignID>campaign_ID</LoyaltyCampaignID> </MilesIncluded> </Result> ... </Transaction>
屬性
<Result>
元素的屬性如下:
屬性 | 是否必要? | 類型 | 說明 |
---|---|---|---|
mergeable | Optional | boolean | 根據預設,特定飯店和行程組合的新價格會覆寫 Google 快取中任何先前的 (未過期) 價格。「可合併」屬性可讓您將額外價格儲存至 Google 的快取,而不會刪除先前的價格資訊。無論交易訊息回應為何,含有指定條件的即時價格查詢回應一律會將這個屬性設為 true 。 |
子元素
<Result>
元素包含下列子項元素:
子項元素 | 是否必要? | 類型 | 說明 |
---|---|---|---|
<AllowablePointsOfSale> | Optional | Object | 一或多個符合飯店資格的到達網頁。到達網頁是指可處理預訂程序的網站。如要明確納入特定到達網頁 (並排除其他到達網頁),請在到達網頁檔案中,新增一或多個與 <PointOfSale> 元素 id 屬性相符的 <AllowablePointsOfSale> 元素。如未加入這個元素,系統會將到達網頁檔案中定義的所有到達網頁,視為可用於預訂房源。詳情請參閱到達網頁檔案語法。 |
<Baserate> | Optional | float | 住宿期間的房價。這個元素的值應反映下列事項:
如果行程無法使用會議室,應省略 如要移除會議室套裝組合,請按照「移除會議室套裝組合」一文中的操作說明進行。
<Baserate currency="USD">1200.40</Baserate>
|
<ChargeCurrency> | Optional | enum | 使用者支付預訂費用的時間和地點。這個元素可用於「飯店價格」或「房型套裝組合」的 <Result> 元素中,做為交易訊息的 <PackageData> 區塊。有效值如下:
預設值為 |
<Checkin> | Required | Date | 行程的入住日期,格式為 Date。<Nights> 元素和 <Checkin> 元素的組合構成行程。 |
Optional | string | 已淘汰:定義自訂欄位,可用於傳遞與飯店相關聯的其他資料。您最多可以傳遞五個自訂值,元素名稱如下:
重要事項:如要使用 |
|
<ExpirationTime> | Optional | DateTime | 價格失效的日期和時間 (至少 3 小時)。 如果對定價結構不重要,建議不要提供到期時間戳記。 Google 不會提供過期價格,且任何價格過期的行程都會符合 即時價格查詢資格。 |
<MilesIncluded> | Optional | boolean | 房價包含飛行常客里程數。參數包括:
注意: |
<Nights> | Required | integer | 行程晚數。<Nights> 元素的值必須是正整數。<Nights> 和 <Checkin> 的組合構成行程。 |
<OtherFees> | Optional | float | 除了基本房價和稅金之外,還會影響房價的費用。<OtherFees> 元素會採用單一必要屬性 currency ,定義費用的三字母貨幣代碼。例如:USD 。如果 |
<Occupancy> | Optional | integer | 指定此費率允許的入住人數上限。
如果 <Occupancy> 直接顯示在 <Result> 下方,則必須指定 2 以上。<Occupancy> 可能會隨附 <OccupancyDetails> ,用於指定房客類型 (成人或兒童)。如未指定房客類型,系統會假設為成人。如要瞭解子項元素的語法和說明,請參閱 <OccupancyDetails> 。如未提供 <Occupancy> 元素,入住人數預設為 2 。重點:兒童入住率只能透過含指定條件的即時價格傳送,不得透過提取或價格變更功能傳送。 注意:如要啟用這項功能,傳送非雙人入住價格,請與支援團隊聯絡。 |
<PackageID> | Optional | string | 檔案包的專屬 ID,用於對應至預先定義的檔案包資料。
也用於填入 PACKAGE-ID 到達網頁變數。
詳情請參閱房間套件中繼資料。 您必須在 |
<Property> | Required | string | 受相關資料 (價格、行程、房型套裝組合或中繼資料) 影響的飯店 ID。這個元素的值必須是字串。這個元素的值必須與你在飯店清單動態饋給中定義的房源 <id> 相符。 |
<Rates> | Optional | <Rates> |
一或多個 <Rate> 區塊的容器。每個 <Rate> 都會為房型/行程組合定義不同的價格。<Rates> 如果同一間房/行程組合有多種費率,或不允許在 注意:在 |
<Refundable> | Optional | Object | 可將房價列為全額退款或提供免費取消。如果未提供,系統就不會顯示退款資訊。
<PackageData> 層級的退款政策會覆寫 <Result> 層級的退款政策。<Rates> 層級的退款政策會覆寫 <PackageData> 層級的退款政策。你也可以透過其他選項向使用者強調可退款價格,而不直接修改交易訊息結構定義。進一步瞭解可退款房價政策。
以下範例顯示已設定所有屬性的 <Refundable available="1" refundable_until_days="7" refundable_until_time="18:00:00"/> 注意:建議您設定所有屬性。如果未設定一或多個屬性,系統就會產生動態饋給狀態警告訊息。 如未設定任何屬性,費率就不會顯示為可退款。屬性包括:
設定屬性時,請注意下列事項:
|
<RoomBundle> | Optional | <RoomBundle> |
容器,內含房間的實體描述價格資訊、任何設施包裝,以及特定飯店和行程的購買政策詳細資料。 一般來說,請使用這個元素定義基本房型的價格,以及同一房源內不同房型的價格。雖然可以內嵌定義房型組合說明,但您應使用個別的交易訊息定義該資訊。Google 會儲存中繼資料,方便您在日後更新價格時參考,不必重複輸入。 |
<RoomID> | Optional | string | 客房的專屬 ID,用於對應至預先定義的客房資料。也用於填入 PARTNER-ROOM-ID 到達網頁變數。詳情請參閱房間套件中繼資料。 您必須在 |
<Tax> | Optional | float | 系統會根據房間的最終價格計算稅金。
<Tax> 元素會採用單一必要屬性 currency ,定義稅金的三字母貨幣代碼。例如:USD 。如果 <Baserate> 大於零,則必須使用 <Tax> 元素。如果 |
<Unavailable> | Optional | Object | 表示無法預訂該行程。做為容器,提供行程無法使用的詳細原因。<Unavailable> 標記下方可能巢狀包含一或多個下列無法供應原因:
|
範例
多項屬性範例
以下範例定義了兩個房源的行程和價格:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-23T16:20:00-04:00" id="42">
<Result>
<Property>060773</Property>
<RoomID>RoomType101</RoomID>
<PackageID>Package101</PackageID>
<Checkin>2018-06-10</Checkin>
<Nights>2</Nights>
<Baserate currency="USD">278.33</Baserate>
<Tax currency="USD">25.12</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<AllowablePointsOfSale>
<PointOfSale id="site1"/>
</AllowablePointsOfSale>
</Result>
<Result>
<Property>052213</Property>
<RoomID>RoomType101</RoomID>
<PackageID>Package101</PackageID>
<Checkin>2018-06-10</Checkin>
<Nights>2</Nights>
<Baserate currency="USD">299.98</Baserate>
<Tax currency="USD">26.42</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<AllowablePointsOfSale>
<PointOfSale id="otto"/>
<PointOfSale id="simon"/>
</AllowablePointsOfSale>
<MilesIncluded>
<NumberOfMiles>1200</NumberOfMiles>
<Provider>
<Text language="en" text="United Airlines"/>
</Provider>
<LoyaltyCampaignID>my_campaign</LoyaltyCampaignID>
</MilesIncluded>
</Result>
</Transaction>
本範例未顯示房間的詳細資料,例如說明、圖片和說明文字、房間名稱和入住人數上限。
您可以在 Google 儲存的個別交易訊息中定義一次該資訊。之後,您就可以在所有後續的價格和商品目錄更新中參照該 ID。詳情請參閱「Room Bundle 中繼資料」。
多費率範例
以下範例定義單一行程和房源,並為不同入住人數設定多種費率。<Rates>
元素可用於提供特定房源的多種費率價格。以下範例也適用於度假民宿 (VR) 房源:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2020-07-23T16:20:00-04:00" id="42">
<Result>
<Property>1234</Property>
<Checkin>2021-01-13</Checkin>
<Nights>9</Nights>
<Baserate currency="USD">3196.1</Baserate>
<Tax currency="USD">559.49</Tax>
<OtherFees currency="USD">543.34</OtherFees>
<Occupancy>2</Occupancy>
<Rates>
<Rate>
<Baserate currency="USD">3196.1</Baserate>
<Tax currency="USD">559.49</Tax>
<OtherFees currency="USD">543.34</OtherFees>
<Occupancy>1</Occupancy>
</Rate>
<Rate>
<Baserate currency="USD">3196.1</Baserate>
<Tax currency="USD">559.49</Tax>
<OtherFees currency="USD">543.34</OtherFees>
<Occupancy>3</Occupancy>
</Rate>
<Rate>
<Baserate currency="USD">3196.1</Baserate>
<Tax currency="USD">559.49</Tax>
<OtherFees currency="USD">543.34</OtherFees>
<Occupancy>4</Occupancy>
</Rate>
<Rate>
<Baserate currency="USD">3196.1</Baserate>
<Tax currency="USD">559.49</Tax>
<OtherFees currency="USD">543.34</OtherFees>
<Occupancy>5</Occupancy>
</Rate>
<Rate>
<Baserate currency="USD">3196.1</Baserate>
<Tax currency="USD">559.49</Tax>
<OtherFees currency="USD">543.34</OtherFees>
<Occupancy>6</Occupancy>
</Rate>
</Rates>
</Result>
</Transaction>
無法使用的範例
以下範例定義了一個行程,但無法從下游管道擷取其空房資訊;第二個行程的入住天數低於最短入住天數,且已在指定日期預訂;第三個行程的房源在抵達日期關閉,但會在入住期間開放:
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-23T16:20:00-04:00" id="42">
<Result>
<Property>060773</Property>
<Checkin>2018-06-10</Checkin>
<Nights>2</Nights>
<Unavailable>
<NotFetched/>
</Unavailable>
</Result>
<Result>
<Property>073313</Property>
<Checkin>2018-06-10</Checkin>
<Nights>2</Nights>
<Unavailable>
<NoVacancy/>
<MinNightStay value=3/>
</Unavailable>
</Result>
<Result>
<Property>052213</Property>
<Checkin>2018-06-10</Checkin>
<Nights>10</Nights>
<Unavailable>
<PropertyClosed first_open="2018-06-15" first_closed="2018-06-10"/>
</Unavailable>
</Result>
</Transaction>
<Rates>
一或多個 <Rate>
區塊的容器。每個 <Rate>
都定義了房型或行程組合的不同價格。<Rates>
只有在同一間房或行程組合有多種費率時,才使用 <Rates>
元素。舉例來說,您可以為條件式費率、不公開費率或房型組合套裝中的條件式費率定義多種費率。
<Rates>
元素會顯示在交易訊息 XML 階層的下列位置:
+<Transaction>
+<PropertyDataSet>
// Room and package metadata + <Property> +<RoomData>
+<PackageData>
+<Result>
// Pricing and availability +<Rates>
+<RoomBundle>
(Can also contain<Rates>
) + ...
<Rate>
中設定的值會覆寫父項 <Result>
或 <RoomBundle>
元素中與價格相關的值。如果未在 <Rate>
中設定,則會沿用父項元素的值。只有 <AllowablePointsofSale> 會繼承至 <RoomBundle>
元素。
語法
<Rates>
元素使用下列語法:
<?xml version="1.0" encoding="UTF-8"?> <Transaction ... > <Result> <Rates> <Rate rate_rule_id="rate_rule_id"> <Baserate currency="currency_code">price</Baserate> <Tax currency="currency_code">tax_amount</Tax> <OtherFees currency="currency_code">fee_amount</OtherFees> <ExpirationTime>expiration_time</ExpirationTime> <Refundable available="[false|true]" refundable_until_days="number_of_days" refundable_until_time="time"/> <ChargeCurrency>[deposit|hotel|installments|web]</ChargeCurrency> <AllowablePointsOfSale> <PointOfSale id="landing_page_identifier"/> </AllowablePointsOfSale> <Occupancy>max_number_of_intended_occupants</Occupancy> <OccupancyDetails> <!-- optional info about the types of guests, whether adults or children --></OccupancyDetails> ... <MilesIncluded> <NumberOfMiles>integer</NumberOfMiles> <Provider> <Text language="en" text="provider-name"> </Provider> <LoyaltyCampaignID>campaign_ID</LoyaltyCampaignID> </MilesIncluded> ... </Rate> ... </Rates> </Result> ... </Transaction>
屬性
<Rates>
元素的屬性如下:
屬性 | 是否必要? | 說明 |
---|---|---|
rate_rule_id | Optional | 如果是 條件式費率,這個 ID 會將費率與費率規範定義檔案中的定義相符。這個欄位的字元長度上限為 40 個半形字元。 |
子元素
<Rates>
元素包含下列子項元素:
子項元素 | 是否必要? | 類型 | 說明 |
---|---|---|---|
<AllowablePointsOfSale> | Optional | Object | 一或多個符合飯店資格的到達網頁。這個元素使用的語法與 <Result> 上的 <AllowablePointsOfSale> 相同。 |
<Baserate> | Required | float | 住宿期間的房價。這個元素使用的語法與 <Result> 上的 <Baserate> 相同。注意: |
<ChargeCurrency> | Optional | enum | 使用者支付預訂費用的時間和地點。這個元素使用的語法與 <Result> 中的 <ChargeCurrency> 相同。 |
Optional | string | 已淘汰:自訂欄位,可用於將與飯店相關的其他資料傳遞至到達網頁。這個元素使用的語法與 <Result> 中的 <Custom[1‑5]> 相同。每個自訂欄位的長度上限為 200 個半形字元。詳情請參閱
到達網頁檔案。如果在 <Result> 元素中提供 <Custom> 元素,則這些元素不會在 <RoomBundle> 元素中繼承,且應為每個 <RoomBundle> 分別定義,或視需要納入 <PackageData> 中。重要事項:如要使用 |
|
<ExpirationTime> | Optional | DateTime | 系統判定費率過期的日期和時間。這個元素使用的語法與 <Result> 中的 <ExpirationTime> 相同。 |
<MilesIncluded> | Optional | boolean | 房價包含飛行常客里程數。參數包括:
注意: |
<Occupancy> | Optional | integer | 指定這項費率允許入住的人數上限。如未指定,系統會假設與父項費率相同。 |
<OtherFees> | Required | float | 除了基本房價和稅金以外,還會影響房價的費用。這個元素使用的語法與 <Result> 中的 <OtherFees> 相同。如果 |
<Refundable> | Optional | Object | 可將房價列為全額退款或提供免費取消。如果未提供,系統就不會顯示退款資訊。
<PackageData> 層級的退款政策會覆寫 <Result> 層級的退款政策。<Rates> 層級的退款政策會覆寫 <PackageData> 層級的退款政策。你也可以透過其他選項向使用者強調可退款價格,而不直接修改交易訊息結構定義。進一步瞭解這些選項
可退款房價政策。
以下範例顯示已設定所有屬性的 <Refundable available="1" refundable_until_days="7" refundable_until_time="18:00:00"/> 注意:建議您設定所有屬性。如果未設定一或多個屬性,系統就會產生動態饋給狀態警告訊息。 如未設定任何屬性,費率就不會顯示為可退款。屬性包括:
設定屬性時,請注意下列事項:
|
<Tax> | Required | float | 系統會根據房間的最終價格計算稅金。這個元素使用的語法與 <Result> 中的 <Tax> 相同。 |
範例
基本費率和條件式費率
以下範例顯示包含基本費率和條件費率的交易訊息:
<?xml version="1.0" encoding="UTF-8" ?>
<Transaction timestamp="2023-05-18T16:20:00-04:00" id="42">
<Result>
<Property>1234</Property>
<Checkin>2023-04-10</Checkin>
<Nights>1</Nights>
<Baserate currency="USD">200.00</Baserate>
<Tax currency="USD">20.00</Tax>
<OtherFees currency="USD">1.00</OtherFees>
<Rates>
<!-- The rate_rule_id is required when using conditional rates -->
<Rate rate_rule_id="mobile">
<!-- Override base rate and taxes for conditional rates -->
<Baserate currency="USD">180.00</Baserate>
<Tax currency="USD">18.00</Tax>
</Rate>
</Rates>
</Result>
</Transaction>
多個條件式費率
以下範例會在 <RoomBundle>
中定義基本費率和多個條件費率:
<?xml version="1.0" encoding="UTF-8" ?>
<Transaction timestamp="2023-05-18T16:20:00-04:00" id="42">
<Result>
<Property>1234</Property>
<Checkin>2023-04-10</Checkin>
<Nights>2</Nights>
<!-- When Google receives new room bundle information for an itinerary, all
previous room bundle pricing is dropped from Google's cache. Thus, if you
want to delete a specific room bundle from Google's cache, you may do so
by simply not providing that specific room bundle in subsequent transaction
messages. -->
<RoomBundle>
...
<!-- RoomID is required, PackageID is recommended. -->
<RoomID>5</RoomID>
<PackageID>ABC</PackageID>
<!-- Baserate is required. -->
<Baserate currency="USD">275.00</Baserate>
<Tax currency="USD">27.50</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<!-- RatePlanID is optional and represents the unique identifier for a
room and package data combination. We strongly recommend using RatePlanID
as a variable to build your dynamic landing page (formerly Point of Sale)
URL. For details, see Using Variables and Conditions. -->
<RatePlanID>5-ABC</RatePlanID>
<!-- Occupancy is mandatory for RoomBundle elements. -->
<!-- Elements below will get inherited to nested rate elements. -->
<Occupancy>2</Occupancy>
<OccupancyDetails>
<NumAdults>2</NumAdults>
</OccupancyDetails>
<InternetIncluded>1</InternetIncluded>
<!-- Rate rule "mobile" overrides chargeCurrency, "us_or_gb" doesn't. -->
<ChargeCurrency>web</ChargeCurrency>
<Rates>
<Rate rate_rule_id="mobile">
<Baserate currency="USD">258.33</Baserate>
<Tax currency="USD">25.83</Tax>
<OtherFees currency="USD">1.00</OtherFees>
<!-- The value below overrides ChargeCurrency from roombundle. -->
<ChargeCurrency>hotel</ChargeCurrency>
</Rate>
<Rate rate_rule_id="us_or_gb">
<Baserate currency="USD">268.33</Baserate>
<Tax currency="USD">26.83</Tax>
<OtherFees currency="USD">1.00</OtherFees>
</Rate>
</Rates>
</RoomBundle>
</Result>
</Transaction>
<RoomBundle>
在 <Transaction>
訊息中,將 Room Bundles 的價格和供應情形定義為 <Result>
的子項。為每個套裝行程或行程組合定義個別元素。如要定義 Room Bundles 的套件和條款,請使用 <RoomData>
。
<RoomBundle>
元素會顯示在交易訊息 XML 階層的下列位置:
+<Transaction>
+<PropertyDataSet>
// Room and package metadata + <Property> +<RoomData>
+<PackageData>
+<Result>
// Pricing and availability +<Rates>
+<RoomBundle>
+ ...
詳情請參閱「使用會議室組合包」。
語法
<RoomBundle>
元素使用下列語法:
<?xml version="1.0" encoding="UTF-8"?> <Transaction ... > <Result> ... <RoomBundle> <!-- Required unless specified inline under<RoomData>
--> <RoomID>room_ID</RoomID> <!-- Required<PackageData>
--> <PackageID>package_ID</PackageID> <!-- Add Loyalty point information --> <MilesIncluded> <NumberOfMiles>integer</NumberOfMiles> <Provider> <Text language="en" text="provider-name"> </Provider> <LoyaltyCampaignID>campaign_ID</LoyaltyCampaignID>> </MilesIncluded> <!-- Required --> <Baserate currency="currency_code">price</Baserate> <!-- Required --> <Tax currency="currency_code">taxes</Tax> <!-- Required --> <OtherFees currency="currency_code">other_fees</OtherFees> <Refundable available="[false|true]" refundable_until_days="number_of_days" refundable_until_time="time"/> <!-- Required --> <ChargeCurrency>[deposit|hotel|installments|web]</ChargeCurrency> <Occupancy>max_number_of_intended_occupants</Occupancy> <OccupancyDetails> <!-- optional info about the types of guests, whether adults or children --></OccupancyDetails> <BreakfastIncluded>boolean_value</BreakfastIncluded> <InternetIncluded>boolean_value</InternetIncluded> <ParkingIncluded>boolean_value</ParkingIncluded> <RatePlanID>rate_plan_ID</RatePlanID> <Rates>...</Rates> </RoomBundle> ... </Result> </Transaction>
屬性
<RoomBundle>
元素沒有屬性。
子元素
<RoomBundle>
元素包含下列子項元素:
子項元素 | 是否必要? | 類型 | 說明 |
---|---|---|---|
<Baserate> | Required | float | 定義住宿的房型套裝組合價格。這個元素使用的語法與 <Result> 中的 <Baserate> 相同,但有以下例外狀況:
|
<BreakfastIncluded> | Optional | boolean | 說明這個房型組合是否包含早餐。 |
<ChargeCurrency> | Optional | enum | 使用者支付預訂費用的時間和地點。這個元素使用的語法與 <Result> 中的 <ChargeCurrency> 相同。預設值為 |
Optional | string | 已淘汰:自訂欄位,用於將額外資料傳送至 Room 套裝組合的到達網頁。這些元素使用的語法與 <Result> 中的 <Custom[1-5]> 相同。每個自訂欄位的字元長度上限為 200 個半形字元。詳情請參閱到達網頁檔案。
只有在交易訊息中傳送價格時,才會列出自訂變數。如果在 <Result> 元素中提供 <Custom> 元素,則這些元素不會在 <RoomBundle> 元素中繼承,且應為每個 <RoomBundle> 分別定義,或視需要納入 <PackageData> 中。重要事項:如要使用 |
|
<InternetIncluded> | Optional | boolean | 如果 Room Bundle 包含免費網路,其他套裝組合則不含這項設施。如果飯店為所有客房提供免費網路,請勿為客房組合設定這個元素。這項元素不適用於客房內有線網路或客房內無法使用的無線網路。 |
<MilesIncluded> | Optional | boolean | 房價包含飛行常客里程數。參數包括:
注意: |
<Occupancy> | Required | integer | 指定這項費率允許入住的人數上限。舉例來說,大型套房可能可容納 6 位房客,但「蜜月套裝方案」僅限 2 位房客入住。 這個值必須小於或等於 在到達網頁網址中定義入住人數時,請使用
注意事項:
|
<OtherFees> | Required | float | 除了基本房價和稅金之外,還會影響房價的費用。<OtherFees> 元素會採用單一必要屬性 currency ,定義費用的三字母貨幣代碼。例如,使用
USD 代表美元。 |
<PackageID> | Optional (recommended) | string | 檔案包資料的專屬 ID。使用這個 ID,將 Room Bundle 資料與 <PackageData> 中傳送的資料進行比對。詳情請參閱房間套裝組合中繼資料。(您也可以使用這個 ID,在定義房型套裝組合資料時,參照單一交易訊息中使用的通用房型套裝組合定義)。 |
<ParkingIncluded> | Optional | boolean | 如果停車位原本是這間飯店的付費服務,但房型組合包含免費停車位,如果飯店提供免費停車位,請勿為這個元素指定值。 有效值為 |
<RatePlanID> | Optional | string | 費率方案 ID 代表房型和套裝組合的專屬 ID。舉例來說,假設 <RoomID> 值為 5,而 <PackageID> 值為 ABC,則 <RatePlanID> 的值可以是 5-ABC。強烈建議使用 RatePlanID 做為變數,建構動態到達網頁 (舊稱銷售點) 網址。詳情請參閱「使用變數和條件」。 |
<Rates> | Optional | <Rates> |
覆寫這個房型組合預設值的費率。這個元素使用的語法與 <Result> 中的 <Rates> 相同。 |
<Refundable> | Optional | Object | 可將房價列為全額退款或提供免費取消。如果未提供,系統就不會顯示退款資訊。
<PackageData> 層級的退款政策會覆寫 <Result> 層級的退款政策。<Rates> 層級的退款政策會覆寫 <PackageData> 層級的退款政策。你也可以透過其他選項向使用者強調可退款價格,而不直接修改交易訊息結構定義。進一步瞭解這些選項
可退款房價政策。
以下範例顯示已設定所有屬性的 <Refundable available="1" refundable_until_days="7" refundable_until_time="18:00:00"/> 注意:建議您設定所有屬性。如果未設定一或多個屬性,系統就會產生動態饋給狀態警告訊息。 如未設定任何屬性,費率就不會顯示為可退款。屬性包括:
設定屬性時,請注意下列事項:
|
<RoomID> | Required | string | 客房資料的專屬 ID。使用這個 ID,將 Room Bundle 資料與您在 <RoomData> 中傳送的資料進行比對。詳情請參閱「
Room Bundle 中繼資料」。(您也可以使用這個 ID,在單一交易訊息中參照通用房型定義,同時內嵌定義房型資料)。 |
<Tax> | Required | float | 系統會根據房間的最終價格計算稅金。
<Tax> 元素會採用單一必要屬性 currency ,定義稅金的三字母貨幣代碼。例如,美元的貨幣代碼為 USD 。 |
範例
單人入住套裝組合
以下範例定義的回應包含單一入住套裝組合。使用者在入住人數選擇器中選取 1
時,Google 會顯示最低的適用價格,不論入住人數為何。
如果沒有單人入住價格,Google 會顯示最低的雙人入住價格。請注意,如果行程已快取雙人入住或更多人數的價格,系統就不會即時查詢單人入住價格。
這個範例會使用 <RoomID>
和 <PackageID>
元素,參照預先定義的房型和套件中繼資料。使用 <RoomData>
和 <PackageData>
元素定義該資訊。
<!-- Efficient method of defining Room Bundles-->
<!----- Occupancy of 1 example ----->
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="12345678">
<!-- Part1: Define RoomData and PackageData in PropertyDataSet -->
<!-- Note: Once defined it does not have to be repeated for future
Transaction Messages.
PropertyDataSets can also be defined and sent in their own
Transaction Message separately from pricing. Google can be
configured to pull just PropertyDataSets once per day
(or on a predefined frequency). -->
<PropertyDataSet>
<Property>180054</Property>
<!-- Can be reused by multiple Room Bundles -->
<RoomData>
<RoomID>060773</RoomID>
<Name>
<Text text="Single Queen Room - Non-Smoking" language="en"/>
<Text text="Chambre de la Roi Premium - Pas de Fumeurs" language="fr"/>
</Name>
<!-- Room can accommodate up to 4, but package data specifies occupancy
between 1 to 4 -->
<Capacity>4</Capacity>
</RoomData>
<RoomData>
<RoomID>436233</RoomID>
<Name>
<Text text="Premium King Room - Non-Smoking" language="en"/>
<Text text="Chambre de le Roi Premium - Pas de Fumeurs" language="fr"/>
</Name>
<Capacity>4</Capacity>
</RoomData>
<!-- Can be reused by multiple Room Bundles -->
<PackageData>
<PackageID>P11111</PackageID>
<Occupancy>1</Occupancy>
<ChargeCurrency>web</ChargeCurrency>
<Refundable available="1" refundable_until_days="7"
refundable_until_time="18:00:00"/>
<ParkingIncluded>1</ParkingIncluded>
<InternetIncluded>1</InternetIncluded>
</PackageData>
<PackageData>
<PackageID>P54321</PackageID>
<Occupancy>2</Occupancy>
<ChargeCurrency>web</ChargeCurrency>
<Refundable available="1" refundable_until_days="7"
refundable_until_time="18:00:00"/>
<ParkingIncluded>1</ParkingIncluded>
<InternetIncluded>1</InternetIncluded>
</PackageData>
<PackageData>
<PackageID>P12345</PackageID>
<Occupancy>4</Occupancy>
<ChargeCurrency>web</ChargeCurrency>
<Refundable available="1" refundable_until_days="1"
refundable_until_time="18:00:00"/>
<ParkingIncluded>1</ParkingIncluded>
<InternetIncluded>1</InternetIncluded>
</PackageData>
</PropertyDataSet>
<!-- Efficient method of defining Room Bundles -->
<!-- Part 2: Reference RoomData and PackageData through ID -->
<Result>
<!-- Single occupancy pricing will be specified in a room bundle below -->
<Property>180054</Property>
<Checkin>2017-10-07</Checkin>
<Nights>2</Nights>
<!-- Base Room Bundle -->
<RoomBundle>
<RoomID>060773</RoomID>
<PackageID>P54321</PackageID>
<Baserate currency="USD">199.99</Baserate>
<Tax currency="USD">25.12</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<RatePlanID>060773-P54321</RatePlanID>
</RoomBundle>
<RoomBundle>
<RoomID>060773</RoomID>
<PackageID>P11111</PackageID>
<!-- Price for 1 ("occupancy") is the lowest price and will be
displayed -->
<Baserate currency="USD">174.99</Baserate>
<Tax currency="USD">22.08</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<RatePlanID>060773-P11111</RatePlanID>
</RoomBundle>
<!-- Premium Room Bundle -->
<RoomBundle>
<RoomID>436233</RoomID>
<PackageID>P12345</PackageID>
<!-- Price for 4 ("occupancy"), any eligible room bundle with 1 or more
occupancy will be displayed-->
<Baserate currency="USD">298.88</Baserate>
<Tax currency="USD">42.12</Tax>
<OtherFees currency="USD">10.00</OtherFees>
<RatePlanID>436233-P12345</RatePlanID>
</RoomBundle>
<!-- ..Continue providing all available RoomBundle rates under matched
property for 1 or more occupancies..-->
</Result>
</Transaction>
兩間以上的入住房間
以下範例定義的回應包含兩項以上的入住資訊。
這個範例會使用 <RoomID>
和 <PackageID>
元素,參照預先定義的房型和套件中繼資料。使用 <RoomData>
和 <PackageData>
元素定義該資訊。
<!-- Efficient method of defining Room Bundles-->
<!----- Occupancy of 3 example ----->
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="12345678">
<!-- Efficient method of defining Room Bundles-->
<!-- Part1: Define RoomData and PackageData in PropertyDataSet -->
<PropertyDataSet>
<Property>180054</Property>
<!-- Can be reused by multiple Room Bundles -->
<RoomData>
<RoomID>060773</RoomID>
<Name>
<Text text="Single Queen Room - Non-Smoking" language="en"/>
<Text text="Chambre de la Roi Premium - Pas de Fumeurs" language="fr"/>
</Name>
<!-- Room can accommodate up to 4, but package data specifies occupancy
between 1 to 4 -->
<Capacity>4</Capacity>
</RoomData>
<RoomData>
<RoomID>436233</RoomID>
<Name>
<Text text="Premium King Room - Non-Smoking" language="en"/>
<Text text="Chambre de le Roi Premium - Pas de Fumeurs" language="fr"/>
</Name>
<Capacity>4</Capacity>
</RoomData>
<!-- Can be reused by multiple Room Bundles -->
<PackageData>
<PackageID>P33333</PackageID>
<Occupancy>3</Occupancy>
<ChargeCurrency>web</ChargeCurrency>
<Refundable available="1" refundable_until_days="7"
refundable_until_time="18:00:00"/>
<ParkingIncluded>1</ParkingIncluded>
<InternetIncluded>1</InternetIncluded>
</PackageData>
<PackageData>
<PackageID>P12345</PackageID>
<Occupancy>4</Occupancy>
<ChargeCurrency>web</ChargeCurrency>
<Refundable available="1" refundable_until_days="1"
refundable_until_time="18:00:00"/>
<ParkingIncluded>1</ParkingIncluded>
<InternetIncluded>1</InternetIncluded>
</PackageData>
</PropertyDataSet>
<Result>
<Property>180054</Property>
<Checkin>2017-10-07</Checkin>
<Nights>2</Nights>
<!-- Efficient method of defining Room Bundles -->
<!-- Part 2: Reference RoomData and PackageData through ID -->
<!-- Base Room Bundle -->
<RoomBundle>
<!-- Baserate above and attributes must match atleast one room bundle
below -->
<RoomID>060773</RoomID>
<PackageID>P33333</PackageID>
<Baserate currency="USD">499.99</Baserate>
<Tax currency="USD">55.12</Tax>
<OtherFees currency="USD">22.00</OtherFees>
</RoomBundle>
<!-- Premium Room Bundle -->
<RoomBundle>
<RoomID>436233</RoomID>
<PackageID>P12345</PackageID>
<!-- Lowest price for 3 ("occupancy"), shown below, will be displayed -->
<Baserate currency="USD">598.88</Baserate>
<Tax currency="USD">62.12</Tax>
<OtherFees currency="USD">30.00</OtherFees>
</RoomBundle>
<!-- ..Continue providing all available RoomBundle rates under matched
property for 2 or more occupancies..-->
</Result>
</Transaction>
多個房型套裝組合
以下範例會為多個房型組合設定入住人數,藉此示範可能的青年旅館房價。
<?xml version="1.0" encoding="UTF-8"?>
<Transaction ... >
<Result>
...
<!-- Suite Room Bundle -->
<RoomBundle>
<RoomID>suite1</RoomID>
<PackageID>standard</PackageID>
<Occupancy>2</Occupancy>
<!-- Price for room -->
<Baserate currency="USD">80.00</Baserate>
<Tax currency="USD">5.12</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<RoomData>
<Name>
<Text text="Suite for 2" language="en"/>
</Name>
</RoomData>
</RoomBundle>
<!-- Small Dorm Room Bundle -->
<RoomBundle>
<RoomID>small_dorm</RoomID>
<PackageID>economy</PackageID>
<Occupancy>1</Occupancy>
<!-- Price per bed -->
<Baserate currency="USD">35.00</Baserate>
<Tax currency="USD">3.50</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<RoomData>
<Name>
<Text text="1 bed in small dorm" language="en"/>
</Name>
</RoomData>
</RoomBundle>
<!-- Large Dorm Room Bundle -->
<RoomBundle>
<RoomID>large_dorm</RoomID>
<PackageID>economy</PackageID>
<Occupancy>1</Occupancy>
<!-- Price per bed -->
<Baserate currency="USD">20.00</Baserate>
<Tax currency="USD">2.50</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<RoomData>
<Name>
<Text text="1 bed in large dorm" language="en"/>
</Name>
</RoomData>
</RoomBundle>
...
</Result>
</Transaction>
多個條件式費率
以下範例會在 <RoomBundle>
中定義基本費率和多個條件費率:
<?xml version="1.0" encoding="UTF-8" ?>
<Transaction timestamp="2023-05-18T16:20:00-04:00" id="42">
<Result>
<Property>1234</Property>
<Checkin>2023-04-10</Checkin>
<Nights>2</Nights>
<!-- When Google receives new room bundle information for an itinerary, all
previous room bundle pricing is dropped from Google's cache. Thus, if you
want to delete a specific room bundle from Google's cache, you may do so
by simply not providing that specific room bundle in subsequent transaction
messages. -->
<RoomBundle>
...
<!-- RoomID is required, PackageID is recommended. -->
<RoomID>5</RoomID>
<PackageID>ABC</PackageID>
<!-- Baserate is required. -->
<Baserate currency="USD">275.00</Baserate>
<Tax currency="USD">27.50</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<!-- RatePlanID is optional and represents the unique identifier for a
room and package data combination. We strongly recommend using RatePlanID
as a variable to build your dynamic landing page (formerly Point of Sale)
URL. For details, see Using Variables and Conditions. -->
<RatePlanID>5-ABC</RatePlanID>
<!-- Occupancy is mandatory for RoomBundle elements. -->
<!-- Elements below will get inherited to nested rate elements. -->
<Occupancy>2</Occupancy>
<OccupancyDetails>
<NumAdults>2</NumAdults>
</OccupancyDetails>
<InternetIncluded>1</InternetIncluded>
<!-- Rate rule "mobile" overrides chargeCurrency, "us_or_gb" doesn't. -->
<ChargeCurrency>web</ChargeCurrency>
<Rates>
<Rate rate_rule_id="mobile">
<Baserate currency="USD">258.33</Baserate>
<Tax currency="USD">25.83</Tax>
<OtherFees currency="USD">1.00</OtherFees>
<!-- The value below overrides ChargeCurrency from roombundle. -->
<ChargeCurrency>hotel</ChargeCurrency>
</Rate>
<Rate rate_rule_id="us_or_gb">
<Baserate currency="USD">268.33</Baserate>
<Tax currency="USD">26.83</Tax>
<OtherFees currency="USD">1.00</OtherFees>
</Rate>
</Rates>
</RoomBundle>
</Result>
</Transaction>
<OccupancyDetails>
交易訊息中的 <Occupancy>
會指定客房或套裝行程的房客人數上限。<OccupancyDetails>
可包含其他資訊,例如房客人數和類型 (成人或兒童)。
如果 <Occupancy>
和 <OccupancyDetails>
出現在 <Result>
或 <RoomBundle>
的 <Rates>
元素中,表示房價受到入住人數詳細資料的限制。
如果在 <RoomBundle>
中加入 <OccupancyDetails>
,以及巢狀 <Rate>
元素,就無法在 <Rate>
中傳送基本 <Occupancy>
;建議改用下列其中一個選項:
- 從
<Rate>
省略入住人數:在此情況下,<Rate>
會直接從<RoomBundle>
繼承<OccupancyDetails>
。
或
- 重複的
<OccupancyDetails>
:在本例中,請在<RoomBundle>
和巢狀<Rate>
元素中,傳送額外的相同<OccupancyDetails>
語法
<OccupancyDetails>
一律會出現在 <Occupancy>
之後。
請注意下列語法:
<?xml version="1.0" encoding="UTF-8"?> <Transaction ... > <Result> ... <Occupancy>max_number_of_intended_occupants</Occupancy> <OccupancyDetails> <NumAdults>number_of_adults</NumAdults> <Children> <Child age=age_of_one_child_guest/> <Child age=age_of_one_child_guest/> </Children> </OccupancyDetails> </Result> </Transaction>
子元素
<OccupancyDetails>
元素包含下列子項元素:
子項元素 | 是否必要? | 類型 | 說明 |
---|---|---|---|
<NumAdults> | Required | integer | 成人房客人數。最小值:1,最大值:20。 |
<Children> | Optional | Object | 一或多個 <Child> 元素的容器。 |
<Child age> | Optional | integer | 這個孩子的年齡上限,例如 <Child age="17"> 。 |
範例
以下範例顯示 <OccupancyDetails>
可能出現在 <Results>
、<RoomBundle>
或 <Rates>
子項元素中。
結果回應
在下列範例中,系統會回應即時價格查詢,針對一間房源定義一個行程及其價格,使用者則指定了房客人數和類型。這裡會以 <Result>
傳回 <OccupancyDetails>
,也就是 2 位成人和 1 位兒童。
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-23T16:20:00-04:00" id="42">
<Result>
<Property>060773</Property>
<RoomID>RoomType101</RoomID>
<PackageID>Package101</PackageID>
<Checkin>2018-06-10</Checkin>
<Nights>2</Nights>
<Baserate currency="USD">278.33</Baserate>
<Tax currency="USD">25.12</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<AllowablePointsOfSale>
<PointOfSale id="site1"/>
</AllowablePointsOfSale>
<Occupancy>3</Occupancy>
<OccupancyDetails>
<NumAdults>2</NumAdults>
<Children>
<Child age="17"/>
</Children>
</OccupancyDetails>
</Result>
</Transaction>
費率回應
以下範例定義了適用於 1 位成人加 1 位兒童的行程及其價格。這裡的 <OccupancyDetails>
會在 <Result>
的 <Rates>
元素中傳回。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Transaction id="Wtdj8QoQIWcAAbaTGlIAAAC4" timestamp="2018-04-18T11:27:45-04:00">
<Result>
<Property>8251</Property>
<Checkin>2018-06-20</Checkin>
<Nights>1</Nights>
<Baserate currency="USD">62.18</Baserate>
<Tax currency="USD">2.45</Tax>
<OtherFees currency="USD">0.00</OtherFees>
<Rates>
<Rate rate_rule_id="rule-951">
<Occupancy>2</Occupancy>
<OccupancyDetails>
<NumAdults>1</NumAdults>
<Children>
<Child age="17"/>
</Children>
</OccupancyDetails>
<Baserate currency="USD">42.61</Baserate>
<Tax currency="USD">5.70</Tax>
<OtherFees currency="USD">0.00</OtherFees>
<AllowablePointsOfSale>
<PointOfSale id="yourhotelpartnersite.com"/>
</AllowablePointsOfSale>
</Rate>
</Rates>
</Result>
</Transaction>
房型套裝組合
以下範例定義了兩晚的入住人數為 2 位成人和 1 位兒童,並提供可退款的價格。在此,<OccupancyDetails>
會顯示在 <RoomBundle>
內
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-23T16:20:00-04:00" id="42">
<Result>
<Property>6781291</Property>
<Checkin>2017-08-05</Checkin>
<Nights>2</Nights>
...
<RoomBundle>
<RoomID>10291</RoomID>
<RatePlanID>564739</RatePlanID>
<PackageID>564739</PackageID>
<Occupancy>3</Occupancy>
<OccupancyDetails>
<NumAdults>2</NumAdults>
<Children>
<Child age="17"/>
</Children>
</OccupancyDetails>
<ChargeCurrency>web</ChargeCurrency>
<Refundable available="true" refundable_until_days="1" refundable_until_time="23:59:00" />
<Baserate currency="USD">185.34</Baserate>
<Tax currency="USD">37.06</Tax>
<OtherFees currency="USD">2.22</OtherFees>
</RoomBundle>
</Result>
</Transaction>
多個房型套裝組合
以下範例定義多個 <RoomBundle>
費率,但僅限 2 位成人和 2 位兒童入住。在此,<OccupancyDetails>
會顯示在 <RoomBundle>
的 <Rates>
元素中。
<?xml version="1.0" encoding="UTF-8"?>
<Transaction timestamp="2017-07-18T16:20:00-04:00" id="42">
<Result>
<Property>1234</Property>
<Checkin>2018-06-10</Checkin>
<Nights>2</Nights>
<Baserate currency="USD">275.00</Baserate>
<Tax currency="USD">27.50</Tax>
<OtherFees currency="USD">0</OtherFees>
<RoomBundle>
<RoomID>5</RoomID>
<PackageID>STD</PackageID>
<Baserate currency="USD">275.00</Baserate>
<Tax currency="USD">27.50</Tax>
<OtherFees currency="USD">0</OtherFees>
<InternetIncluded>1</InternetIncluded>
<ChargeCurrency>web</ChargeCurrency>
<Occupancy>4</Occupancy>
<OccupancyDetails>
<NumAdults>2</NumAdults>
<Children>
<Child age="17"/>
<Child age="17"/>
</Children>
</OccupancyDetails>
<Rates>
<Rate rate_rule_id="mobile">
<Baserate currency="USD">258.33</Baserate>
<Tax currency="USD">25.83</Tax>
<OtherFees currency="USD">1.00</OtherFees>
<ChargeCurrency>hotel</ChargeCurrency>
</Rate>
<Rate rate_rule_id="us_or_gb">
<Baserate currency="USD">268.33</Baserate>
<Tax currency="USD">26.83</Tax>
<OtherFees currency="USD">1.00</OtherFees>
</Rate>
</Rates>
</RoomBundle>
</Result>
</Transaction>