BookingUSB-产品Addon APIs
编辑于: 2023-05-24 15:33
TABLE OF CONTENTS
介绍
渠道使用产品 Addon API 获取 addon 详情,并通过可用性 API 查询特定 addon 的实时价格
- 产品 addon 详情(/productAddon/{supplierId}/{hotelId}/{type}/{code})
- 产品 addon 可用性(/productAddon/Availability)
产品 addon 详情
渠道调用此API获取特定酒店的产品 addon 详细信息
GET /productAddon/{supplierId}/{hotelId}/{type}/{code}?distributorId={distributorId} HTTP/1.1 URL: {endpoint}/productAddon/{supplierId}/{hotelId}/{type}/{code}?distributorId={distributorId} Authorization:Bearer 53ac07777cdffac2d53000002d698728ce964432d7167596bc005c5fc Accept-Encoding: gzip Content-Encoding: gzip Content-Type: application/json;charset=utf-8
请求参数
名称 | 描述 | 必传字段? | 类型 | 示例 |
---|---|---|---|---|
supplierId | 酒店集团 ID | Yes | string | DISNEY |
hotelId | 酒店代码 | Yes | string | 06 |
type | 产品 addon 类型 | Yes | string | DisneyTicket |
code | 产品 addon 代码 | Yes | string | / |
distributorId | 渠道 ID | Yes | string | / |
响应示例
- 成功响应(HTTP状态200)
{ "supplierId": "DISNEY", "hotelId": "GATHI", "productAddon": { "code": "code", "name": "name", "type": "DisneyTicket", "policies": [ "policy", "policy" ], "restrictions": { "officeIds": [ "officeId", "officeId" ], "discountGroups": [ "group", "group" ], "ageQualifyingTypes": [ { "type": "Adult", "minAge": 18, "maxAge": 99 } ], "saleDateRange": { "startDate": "2022-01-01", "endDate": "2022-01-04" }, "usageDateRange": { "startDate": "2022-01-01", "endDate": "2022-01-04" }, "durationDays": 3, "usageBufferDays": 3 }, "rates": [ { "dateRange": { "startDate": "2022-01-01", "endDate": "2022-01-04" }, "rate": { "ageQualifyingType": { "type": "Adult", "minAge": 18, "maxAge": 99 }, "currency": "USD", "amountBeforeTax": 123.23, "amountAfterTax": 134.34 } } ] } }
- 错误响应(HTTP状态403)
{ "error": "Key not authorized" }
- 错误响应(HTTP状态500)
{ "errorCode": "InvalidField", "errorMessage": "Invalid Message" }
响应规范
属性 | 类型 | 必传字段? | 描述 | 示例 |
---|---|---|---|---|
supplierId | string | Yes | 酒店集团 ID | DISNEY |
hotelId | string | Yes | 酒店代码 | 06 |
productAddon | object | No | / | / |
@code | string | Yes | 产品 addon 代码 | / |
@name | string | Yes | 产品 addon 名称 | / |
@type | string | Yes | 产品 addon 类型 | DisneyTicket |
productAddon/policies | array[string] | No | / | / |
productAddon/restrictions | object | No | / | / |
restrictions/officeIds | array[string] | No | ||
restrictions/discountGroups | array[string] | No | / | / |
restrictions/ageQualifyingTypes | array[object] | No | / | / |
@type | enum | Yes | 枚举: [Adult, Child] | Adult |
@minAge | integer | Yes | / | 18 |
@maxAge | integer | Yes | / | 99 |
restrictions/saleDateRange | object | Yes | / | / |
@startDate | string | Yes | 格式: yyyy-MM-dd | 2022-01-01 |
@endDate | string | Yes | 格式: yyyy-MM-dd | 2022-01-04 |
restrictions/usageDateRange | object | Yes | / | / |
@startDate | string | Yes | 格式: yyyy-MM-dd | 2022-01-01 |
@endDate | string | Yes | 格式: yyyy-MM-dd | 2022-01-04 |
restrictions/durationDays | integer | Yes | / | 3 |
restrictions/usageBufferDays | integer | Yes | / | 3 |
productAddon/rates | array[object] | No | / | / |
rates/dateRange | object | Yes | 日期范围 | / |
@startDate | string | Yes | 开始日期, 格式: yyyy-MM-dd | 2022-01-01 |
@endDate | string | Yes | 结束日期, 格式: yyyy-MM-dd | 2022-01-04 |
rates/rate | array[object] | Yes | / | / |
rate/ageQualifyingType | object | No | / | / |
@type | enum | Yes | 枚举: [Adult, Child] | Adult |
@minAge | integer | Yes | / | 18 |
@maxAge | integer | Yes | / | 99 |
rate/currency | string | Yes | / | USD |
rate/amountBeforeTax | number | No | / | 123.23 |
rate/amountAfterTax | number | No | / | 134.34 |
产品 addon 可用性
渠道调用此 API 获取指定 addon 的可用性, 请求将被发送到酒店集团的系统,以获得实时结果。
POST /productAddon/availability HTTP/1.1 URL: {endpoint}/productAddon/availability Authorization:Bearer 53ac07777cdffac2d53000002d698728ce964432d7167596bc005c5fc Accept-Encoding: gzip Content-Encoding: gzip Content-Type: application/json;charset=utf-8
请求示例
{ "header": { "supplierId": "DISNEY", "distributorId": "SUNCOAST", "version": "v4", "token": "18393849028490234" }, "bookingChannel": "string", "officeId": "string", "hotelId": "06", "date": "2022-01-01", "productAddonType": "DisneyTicket", "productAddonCandidates": [ { "code": "string", "quantity": 1 } ] }
请求规范
属性 | 类型 | 必传字段? | 描述 | 示例 |
---|---|---|---|---|
header | object | Yes | / | / |
@supplierId | string | Yes | 最大长度:32 酒店集团 ID | DISNEY |
@distributorId | string | Yes | 最大长度:32 渠道 ID | SUNCOAST |
@version | string | Yes | 最大长度:20 API版本 | v4 |
@token | string | Yes | 最大长度:64 用于标识请求和响应的唯一ID,通常应为UUID | 18393849028490234 |
bookingChannel | string | No | 子渠道, 迪士尼对接时,当渠道有且只有一个子渠道ID时,此字段为可选字段。否则为必填字段。 | / |
officeId | string | No | 注意:迪士尼对接,请求产品 addon 可用性时,为必填字段。非迪斯尼对接,则视情况而定 | / |
hotelId | string | Yes | 酒店代码 | 06 |
date | string | Yes | 格式为 yyyy-MM-dd | 2022-01-01 |
productAddonType | string | Yes | 产品 addon 类型 | DisneyTicket |
productAddonCandidates | array[object] | Yes | / | / |
@code | string | Yes | 产品 addon 代码 | / |
@quantity | integer | Yes | / | 1 |
响应示例
- 成功响应(HTTP状态200)
{ "header": { "supplierId": "DISNEY", "distributorId": "SUNCOAST", "version": "v4", "token": "18393849028490234" }, "bookingChannel": "string", "officeId": "string", "hotelId": "06", "date": "2022-01-01", "productAddonType": "DisneyTicket", "productAddons": [ { "code": "string", "rates": [ { "ageQualifyingType": { "type": "Adult", "minAge": 18, "maxAge": 99 }, "currency": "USD", "amountBeforeTax": 123.23, "amountAfterTax": 134.34 } ] } ] }
- 错误响应(HTTP状态401)
{ "error": "Key not authorized" }
- 错误响应(HTTP状态500)
{ "errorCode": "InvalidField", "errorMessage": "Invalid Message" }
名称 | 描述 | 必传字段? | 类型 | 示例 |
---|---|---|---|---|
header | object | Yes | / | / |
@supplierId | string | Yes | 最大长度:32 酒店集团 ID | DISNEY |
@distributorId | string | Yes | 最大长度:32 渠道 ID | SUNCOAST |
@version | string | Yes | 最大长度:20 API版本 | v4 |
@token | string | Yes | 最大长度:64 用于标识请求和响应的唯一 ID,通常应为UUID | 18393849028490234 |
bookingChannel | string | No | 子渠道 ID | / |
officeId | string | No | / | / |
hotelId | string | Yes | 酒店代码 | 06 |
date | string | No | 格式为:yyyy-MM-dd | 2022-01-01 |
productAddonType | string | No | 产品 addon 类型 | DisneyTicket |
productAddons | array[object] | No | / | / |
@code | string | Yes | 产品 addon 代码 | DisneyTicket |
productAddons/rates | array[object] | Yes | / | / |
rates/ageQualifyingType | object | No | / | / |
@type | enum | Yes | 枚举: [Adult, Child] | Adult |
@minAge | integer | Yes | / | 18 |
@maxAge | integer | Yes | / | 99 |
rates/currency | string | Yes | / | USD |
rates/amountBeforeTax | number | No | / | 123.23 |
rates/amountAfterTax | number | No | / | 134.34 |
此回答是否有所帮助? 是 否
Send feedback