BookingUSB-酒店接口
编辑于: 2024-10-16 15:07
目录
介绍
渠道使用此API获取酒店集团的酒店列表和酒店产品
- 酒店列表(/hotels/{supplierId}):渠道使用此API获取酒店列表以及可售卖状态。如返回酒店状态为 Deactived 则表示酒店集团已下线此酒店或不可售卖。
- 酒店产品(/Hotel/{supplierId}/{hotelId}):渠道使用此API获取酒店产品以及每个产品的可售卖状态。Deactived 表示不可售卖。
酒店列表
渠道使用此API获取酒店列表,然后根据酒店状态(Actived/Deactived)在自己的系统中上线或下线酒店。建议定时调用此接口询问及更新变化(每天至少同步一次)
GET /hotels/{supplierId}?distributorId={distributorId} HTTP/1.1 URL: {endpoint}/hotels/{supplierId}?distributorId={distributorId} Authorization:Bearer 53ac07777cdffac2d53000002d698728ce964432d7167596bc005c5fc Accept-Encoding: gzip Content-Encoding: gzip Content-Type: application/json;charset=utf-8
请求参数
名称 | 描述 | 必传字段 | 类型 | 示例 |
---|---|---|---|---|
supplierId | 酒店集团 ID | Yes | string | HILTON |
distributorId | 渠道 ID | Yes | string | TUI |
响应示例
- 成功响应(HTTP状态200)
[ { "hotelId": "GATHI", "hotelName": "This is a test hotel", "supplierId": "HILTON", "status": "Actived" } ]
- 错误响应(HTTP状态401)
{ "error": "Key not authorized" }
- 错误响应(HTTP状态500)
{
"errorCode": "InvalidField",
"errorMessage": "Invalid Message"
}
响应规范
属性 | 类型 | 必传字段? | 描述 | 示例 |
---|---|---|---|---|
hotelId | string | Yes | 酒店代码 | GATHI |
hotelName | string | No | 酒店名称 | Hilton hotel resorts |
supplierId | string | Yes | 酒店集团 ID | HILTON |
status | enum | Yes | 酒店状态 枚举:[Actived,Deactived] | Actived |
酒店产品
渠道使用此API获取酒店产品以及每个产品的可售卖状态。建议定时调用此接口询问及更新变(每天至少同步一次)
GET /hotel/{supplierId}/{hotelId}?distributorId={distributorId} HTTP/1.1 URL: {endpoint}/hotel/{supplierId}/{hotelId}?distributorId={distributorId} Authorization:Bearer 53ac07777cdffac2d53000002d698728ce964432d7167596bc005c5fc Accept-Encoding: gzip Content-Encoding: gzip Content-Type: application/json;charset=utf-8
请求参数
名称 | 描述 | 必传字段? | 类型 | 示例 |
---|---|---|---|---|
supplierId | 酒店集团 ID | Yes | string | HILTON |
hotelId | 酒店代码 | Yes | string | GATHI |
distributorId | 渠道 ID | Yes | string | TUI |
响应示例
- 成功响应(HTTP状态200)
{ "hotelId": "ABCDE", "hotelName": "This is a test hotel", "supplierId": "HILTON", "status": "Actived", "chainCode": "Hilton", "brandCode": "Hampton", "longitude": "41.40338", "latitude": "2.17403", "city": "string", "country": "string", "state": "string", "address": [ "AddressLine1", "AddressLine2", "AddressLine3", "AddressLine4", "AddressLine5" ], "phone": { "countryAccessCode": "string", "areaCityCode": "string", "phoneNumber": "string" }, "settings": { "key1": "value1", "key2": "value2" }, "extensions": { "key1": "value1", "key2": "value2" }, "ariType": "Daily", "timezone": "America/Los_Angeles", "rateType": "AmountBeforeTax", "maxChildAge": 17, "childRateType": "ByAge", "products": [ { "roomId": "10000101", "rateId": "123456", "stayType": "OverNightRoom", "status": "Actived", "roomName": "Double Room", "roomDescription": "Soak in city views in our Deluxe room, which features a well-appointed ensuite bathroom and up-to-date entertainment offerings.", "rateName": "Bar Rate", "rateDescription": "Begin your day with a hearty meal.", "occupancy": { "maxAdult": 3, "maxChild": 2, "maxOccupancy": 3 }, "paymentType": "PayNow", "guarantee": { "guaranteeType": "CCG" }, "cancelPolicies": [ { "dateRange": { "startDate": "2018-01-01", "endDate": "2018-01-04" }, "cancelPolicy": { "code": "AD100P_100P", "description": "Non Refundable", "cancelPenalties": [ { "noShow": true, "cancellable": true, "cancelDeadline": { "offsetTimeDropType": "BeforeArrival", "offsetTimeUnit": "D", "offsetTimeValue": 0, "deadline": "string" }, "penaltyCharge": { "chargeBase": "FullStay", "nights": 0, "amount": 0, "percent": 0 } } ] } } ], "fees": [ { "dateRange": { "startDate": "2018-01-01", "endDate": "2018-01-04" }, "fee": { "name": "Service Charge", "type": "Exclusive", "amount": 10, "amountType": "Percent", "chargeType": "PerRoomPerNight", "paymentType": "PayNow", "effectivePerson": 0 } } ], "bookingChannels": [ "channel", "channel" ], "sourceMarkets": [ "region", "region" ], "productAddons": [ { "type": "DisneyTicket", "required": true, "candidateCodes": [ "code", "code" ] } ] } ] }
- 错误响应(HTTP状态401)
{ "error": "Key not authorized" }
- 错误响应(HTTP状态500)
{ "errorCode": "InvalidField", "errorMessage": "Invalid Message" }
响应规范
属性 | 类型 | 必传字段? | 描述 | 示例 |
---|---|---|---|---|
hotelId | string | Yes | 酒店代码 | GATHI |
hotelName | string | No | 酒店名称 | This is a test hotel |
supplierId | string | Yes | 酒店集团 ID | HILTON |
status | enum | Yes | 枚举:[Actived,Deactived] 酒店状态 | Actived |
chainCode | string | No | 连锁代码可以标识酒店连锁或管理集团,例如Hyatt、Hilton。酒店连锁代码由酒店集团决定,如果酒店是单体酒店,仅通过hotelId字段即可识别,则酒店连锁代码是可选的。 | Marriott |
brandCode | string | No | 品牌代码可以识别连锁店内的品牌,例如Courtyard、Hampton Inn。如果酒店是单体酒店,则是可选字段。 | Waldorf |
longitude | string | No | 酒店经纬度信息 | 41.40338 |
latitude | string | No | 酒店经纬度信息 | 2.17403 |
city | string | No | / | / |
country | string | No | / | / |
state | string | No | / | / |
address | array | No | 最多支持五个地址 | [ "AddressLine1", "AddressLine2", "AddressLine3", "AddressLine4", "AddressLine5" ] |
phone | object | No | / | / |
@countryAccessCode | string | Yes | / | / |
@areaCityCode | string | No | / | / |
@phoneNumber | string | Yes | / | / |
settings | object | No | 用于额外属性或设置等 | { |
extensions | object | No | 它是可选字段,与万豪对接的渠道可通过此字段接收万豪的 集群代码(Cluster Code)及与之对应的价格计划代码。 | { "key1": "value1", "key2": "value2" } |
ariType | enum | Yes | 枚举:[Daily,LOS] 指示ARI API使用的ARI模型 | Daily |
timezone | string | Yes | 酒店时区 | America/Los_Angeles |
rateType | enum | Yes | 枚举:[AmountBeforeTax、AmountAfterTax、Both] 指示酒店集团提供的价格类型
| AmountBeforeTax |
maxChildAge | integer | No | 如果childRateType为ByAge,则 maxChildAge 为必填字段。 | / |
childRateType | enum | No | 枚举:[Normal, ByAge, Free, AsAdult] 儿童价类型
| ByAge |
products | array | Yes | / | / |
@roomId | string | Yes | 房型代码 | King |
@rateId | string | Yes | 价格计划代码 | BAR |
@stayType | enum | No | 枚举:[OverNightRoom,DayUseRoom] 标识此产品是专门用于日用房还是常规过夜使用。默认类型为OverNightRoom | OverNightRoom |
@status | enum | Yes | 枚举:[Actived,Deactived] | Actived |
@roomName | string | No | 房型名称 | King Room |
@roomDescription | string | No | / | Soak in city views in our Deluxe room, which features a well-appointed ensuite bathroom and up-to-date entertainment offerings. |
@rateName | string | No | 价格计划名称 | Best Available Rate |
@rateDescription | string | No | / | Begin your day with a hearty meal |
products/occupancy |
| Yes | / | / |
@maxAdult | integer | Yes | 最大入住成人数 | 3 |
@maxChild | integer | Yes | 最大入住儿童数 | 2 |
@maxOccupancy | integer | Yes | 最大入住人数 | 3 |
@paymentType | enum | No | 枚举:[PayLater,PayNow] 预付(PayNow)、前台现付(PayLater) | PayNow |
products/guarantee | / | No | / | / |
@guaranteeType | string | Yes | 此房价的保证信息。 担保类型,参考担保类型列表 | CCG |
products/cancelPolicies | / | No | / | / |
cancelPolicies/dateRange | object | No | 日期范围 | / |
@startDate | string | Yes | 开始日期,格式为yyyy-MM-dd | 2018-01-01 |
@endDate | string | Yes | 结束日期,格式为yyyy-MM-dd | 2018-01-04 |
cancelPolicies/cancelPolicy | object | No | / | / |
@code | string | Yes | 取消政策代码 最大长度:128 | AD100P_100P |
@description | string | No | 取消政策的描述 最大长度:1024 | Non Refundable |
cancelPolicy/cancelPenalties | / | Yes | 取消政策详情 | / |
@noShow | boolean | Yes | 如果为true,则意味着罚金适用于“未入住”,cancellable 和 cancelDeadline 两个节点将不会出现。 | / |
@cancellable | boolean | No | 标示是否允许取消。如果为false,则不可取消。如果为true,cancelDeadline 节点将出现。 | / |
cancelPenalties / cancelDeadline | / | / | / | / |
@offsetTimeDropType | enum | No | 标示取消政策以入住日期或预订日期为依据。目前只支持入住日期类型 枚举:[BeforeArrival] | / |
@offsetTimeUnit | enum | No | 枚举:[D,H] | / |
@offsetTimeValue | number | No | 时间数 | / |
@deadline | string | No | 取消截止时间,一般为酒店所在地时间,如下午4点前或下午6点前 | / |
cancelPenalties/ penaltyCharge | / | Yes | / | / |
@chargeBase | enum | No | 如果是FullStay,则为百分比或金额;如果是NightBase,则需要通过 nights 节点提供间夜数。 枚举:[FullStay,NightBase] | / |
@nights | number | No | 罚款是基于入住晚数,如一晚 | / |
@amount | number | No | 罚款是固定费用,如30.00美元 | / |
@percent | number | No | 罚款是基于百分比,如15.5 为 15.5% | / |
products/fees | / | No | / | / |
fees/dateRange | / | No | 日期范围 | / |
@startDate | string | Yes | 开始日期,格式为yyyy-MM-dd | 2018-01-01 |
@endDate | string | Yes | 结束日期,格式为yyyy-MM-dd | 2018-01-04 |
fees/fee | object | No | / | / |
@name | string | Yes | 费用或税款的名称 | Service Charge |
@type | enum | Yes | 税费是否包含在税前价中 枚举:[Inclusive,Exclusive] | Exclusive |
@amount | number | Yes | 税费金额 | 10 |
@amountType | enum | Yes | 税费收取规则,是固定金额收取,还是按房费比例收取 枚举:[Fix,Percent] | Percent |
@chargeType | enum | Yes | 枚举:[PerRoomPerNight,PerPersonPerNight、PerRoomPerStay、PerPersonPerStay] | PerRoomPerNight |
@paymentType | enum | No | 预付(PayNow)、前台现付(PayLater) 枚举:[PayLater,PayNow] | PayNow |
@effectivePerson | number | No | 从第几名成人开始收取额外费用,通常从第3名成人开始收取。值为 3 表示从第3名成年人起将收取额外费用 | / |
products/bookingChannels | array[string] | No | 渠道ID/子渠道ID | ["channel1", "channel2"] |
products/sourceMarkets | array[string] | No | / | ["region1", "region2"] |
products/productAddons | array[object] | No | / | |
@type | string | Yes | 产品 Addon 类型 | DisneyTicket |
@required | boolean | Yes | / | true |
productAddons/candidateCodes | array[string] | Yes | / | ["code1", "code2"] |
此回答是否有所帮助? 是 否
Send feedback