酒店预订
Classes
Methods
-
<static> book(header [, params], body)
-
post预订Parameters:
Name Type Argument Description headermodule:request.YHeader Http request header
paramsobject <optional>
Http request query string parameters
Properties
Name Type Argument Default Description modestring <optional>
sync 模式。由于预订可能需要耗费较长时间,为了提升用户体验可以通过异步机制来分批获取订单和预订结果
sync同步响应所有数据async异步获取预订结果
bodyobject Http request body
Properties
Name Type Argument Description preferredmodule:common.Preferred <optional>
首选设置
usermodule:common.User <optional>
预订人
bookingmodule:hotel.HotelBooking 酒店预订信息
paymentPayment <optional>
支付信息
- Since:
-
- 1.0.0
Returns:
- Type
- bookResponse
-
<static> rateCalendar(header, body)
-
post获取价格方案日历,每日价格。Parameters:
Name Type Description headermodule:request.YHeader Http request header
bodyobject Http request body
Properties
Name Type Argument Description preferredmodule:common.Preferred <optional>
首选设置
staymodule:common.Stay 入住信息
hotelmodule:hotel.Hotel 酒店
ratemodule:hotel.HotelRate 价格方案
- Since:
-
- 1.0.0
Returns:
- Type
- rateCalendarResponse
-
<static> rateRule(header, body)
-
post获取价格方案及规则。获取更准确的价格明细,务必在用户下单前向用户展示。- E.g. 部分酒店住三付二(第一天 1200,第二天 1200,第三天免费),在 rates 接口可能会获得 800, 800, 800 的价格明细,在 rateRule 接口可以获得准确的 1200, 1200, 0 价格明细
Parameters:
Name Type Description headermodule:request.YHeader Http request header
bodyobject Http request body
Properties
Name Type Argument Description preferredmodule:common.Preferred <optional>
首选设置
staymodule:common.Stay 入住信息
hotelmodule:hotel.Hotel 酒店
ratemodule:hotel.HotelRate 价格方案
- Since:
-
- 1.0.0
Returns:
- Type
- rateRuleResponse
-
<static> rates(header [, params], body)
-
post获取酒店详细房型及价格方案Parameters:
Name Type Argument Description headermodule:request.YHeader Http request header
paramsobject <optional>
Http request query string parameters
Properties
Name Type Argument Default Description modestring <optional>
sync 模式。由于获取所有 rates 可能需要耗费较长时间,为了提升用户体验可以通过异步机制来分批获取首页 rates 和所有 rates
sync同步响应所有数据asyncPaging推荐,异步获取所有 rates。同步响应首页 rates 和 asyncJobId,通过 asyncJobId 异步获取次页 rates,逐页获取直至 asyncJobId 为空
bodyobject Http request body
Properties
Name Type Argument Description preferredmodule:common.Preferred <optional>
首选设置
staymodule:common.Stay 入住信息
hotelmodule:hotel.Hotel 酒店
- Since:
-
- 1.0.0
Returns:
- Type
- ratesResponse
-
<static> search(header [, params], body)
-
post搜索酒店及价格Parameters:
Name Type Argument Description headermodule:request.YHeader Http request header
paramsobject <optional>
Http request query string parameters
Properties
Name Type Argument Default Description modestring <optional>
sync 模式。由于获取价格可能需要耗费较长时间,为了提升用户体验可以通过异步机制来分批获取基础数据和价格
sync同步响应所有数据async推荐,异步获取价格。同步响应基础数据(不含 minStayPrice)和 asyncJobId,通过 asyncJobId 异步获取 minStayPrice
bodyobject Http request body
Properties
Name Type Argument Default Description preferredmodule:common.Preferred <optional>
首选设置
staymodule:common.Stay 入住信息
filtermodule:hotel.HotelFilter 筛选条件
sortstring <optional>
byRecommendation 排序方式
byRecommendation按系统推荐排序byMinStayPrice按最低价格升序。由于价格是实时向供应商查询,该排序会导致查询性能明显下降byMinStayPriceDescending按最低价格倒序。由于价格是实时向供应商查询,该排序会导致查询性能明显下降byDistance按距离远近排序,仅在传入 filter.geospatial 时有效bySearch按搜索关键字匹配度排序,传入 filter.search 时有效
pagingmodule:common.Paging <optional>
页码信息
- Since:
-
- 1.0.0
- See:
Returns:
- Type
- searchResponse
Type Definitions
-
bookResponse
-
Type:
- object
- Since:
-
- 1.0.0
Properties:
Name Type Argument Description errmodule:common.Error <optional>
错误信息
orderOrder 订单
-
rateCalendarResponse
-
Type:
- object
- Since:
-
- 1.0.0
Properties:
Name Type Argument Description errmodule:common.Error <optional>
错误信息
ratesArray.<module:hotel.HotelRate> 价格方案
-
rateRuleResponse
-
Type:
- object
- Since:
-
- 1.0.0
Properties:
Name Type Argument Description errmodule:common.Error <optional>
错误信息
ratemodule:hotel.HotelRate 价格方案,仅包含 price, priceDetail 节点。此时的数据相较 rates 接口返回的数据更准确。
rateRulemodule:hotel.HotelRateRule 价格方案规则
-
ratesResponse
-
Type:
- object
- Since:
-
- 1.0.0
Properties:
Name Type Argument Description errmodule:common.Error <optional>
错误信息
roomsArray.<module:hotel.HotelRoom> 房型
asyncJobIdstring <optional>
异步任务 id。为空时表示没有更多 rates 需要通过异步获取
-
searchResponse
-
Type:
- object
- Since:
-
- 1.0.0
Properties:
Name Type Argument Description errmodule:common.Error <optional>
错误信息
pagingmodule:common.Paging 页码信息
hotelsArray.<module:hotel.Hotel> 酒店
asyncJobIdstring <optional>
异步任务 id