Hotel Booking
Methods
-
<static> book(header, body)
-
POSTBookParameters:
Name Type Argument Default Description headerYHeader HTTP request header
params.modestring <optional>
async Mode. Since booking can be time-consuming, an asynchronous mechanism is available to generate orders and retrieve booking confirmation numbers in steps for better user experience.
syncSynchronously responds with all data.asyncRecommended. Synchronously responds with order data, order status is confirming. Subsequently, use webhook or order/search to asynchronously retrieve the confirmation number; order status will be upcoming.
bodyobject HTTP request body
Properties
Name Type Argument Description userUser <optional>
Booker
bookingHotelBooking Hotel booking information
paymentPayment <optional>
Payment information
merchantobject <optional>
Merchant order information
- Since:
-
- 1.0.0
Properties:
Name Type Description body.merchant.uidstring Order identifier
Returns:
- Type
- bookResponse
-
<static> rateCalendar(header, body)
-
POSTGet one-night hotel rates by check-in date. dateRange.end is exclusive. The maximum range is 90 days, or 270 days for hotelux and hoteluxjp channels.Parameters:
Name Type Description headerYHeader HTTP request header
bodyobject HTTP request body
Properties
Name Type Argument Description preferredPreferred <optional>
Preferences; currency is used for approximate price conversion
hotelHotel Hotel, identified by _id
dateRangeobject Date range to query
Properties
Name Type Description startstring First check-in date, YYYY-MM-DD
endstring Exclusive end date, YYYY-MM-DD
- Since:
-
- 1.0.0
Returns:
- Type
- HotelRateCalendarResponse
-
<static> rateRule(header, body)
-
POSTGet rate plan and rules. To obtain more accurate price details, ensure this is displayed to the user before they place an order.- E.g. For a "Stay 3, Pay for 2" offer (Day 1 1200, Day 2 1200, Day 3 Free), the rates API might return price details of 800, 800, 800, whereas the rateRule API returns the accurate 1200, 1200, 0.
Parameters:
Name Type Description headerYHeader HTTP request header
bodyobject HTTP request body
Properties
Name Type Argument Description preferredPreferred <optional>
Preferences
stayStay Stay information
hotelHotel Hotel
rateHotelRate Rate plan
- Since:
-
- 1.0.0
Returns:
- Type
- rateRuleResponse
-
<static> rates(header [, params], body)
-
POSTGet detailed hotel room types and rate plansParameters:
Name Type Argument Description headerYHeader HTTP request header
paramsobject <optional>
HTTP request query string parameters
Properties
Name Type Argument Default Description modestring <optional>
sync Mode. Since retrieving all rates can be time-consuming, an asynchronous mechanism is available to fetch first-page rates and all rates in batches for better user experience.
syncSynchronously responds with all data.asyncRecommended. Asynchronously retrieves all rates. Synchronously responds with first-page rates and asyncJobId. Use asyncJobId to retrieve all rates asynchronously.asyncPagingRecommended. Asynchronously retrieves all rates. Synchronously responds with first-page rates and asyncJobId. Use asyncJobId to retrieve subsequent pages of rates, fetching page by page until asyncJobId is null.
bodyobject HTTP request body
Properties
Name Type Argument Description preferredPreferred <optional>
Preferences
stayStay Stay information
hotelHotel Hotel
- Since:
-
- 1.0.0
Returns:
- Type
- ratesResponse
-
<static> search(header [, params], body)
-
POSTSearch for hotels and pricesParameters:
Name Type Argument Description headerYHeader HTTP request header
paramsobject <optional>
HTTP request query string parameters
Properties
Name Type Argument Default Description modestring <optional>
sync Mode. Since retrieving prices can be time-consuming, an asynchronous mechanism is available to fetch basic data and prices in batches for better user experience.
syncSynchronously responds with all data.asyncRecommended. Asynchronously retrieves prices. Synchronously responds with basic data (excluding minBasePrice and minPrice) and asyncJobId. Use asyncJobId to retrieve prices asynchronously.
bodyobject HTTP request body
Properties
Name Type Argument Default Description preferredPreferred <optional>
Preferences
userUser <optional>
Booker
stayStay Stay information
filterHotelFilter Filter criteria
- Set
filter.highCommission=trueto return only hotels whose high commission sample matches the requested stay.
sortstring <optional>
byRecommendation Sorting method
byRecommendationSort by system recommendation.byUserRecommendationSort by user history and system recommendation. Valid only when user has a value.byMinBasePriceSort by lowest single-night price (ascending). Since prices are queried from suppliers in real-time, this sorting method significantly reduces query performance.byMinBasePriceDescendingSort by lowest single-night price (descending). Since prices are queried from suppliers in real-time, this sorting method significantly reduces query performance.byDistanceSort by distance. Valid only when filter.geospatial is provided.byHotelFilterOrderPreserve the hotel order in filter.hotels. Only _id-based hotel filters are supported.bySearchSort by search keyword relevance. Valid when filter.search is provided.
pagingPaging <optional>
Pagination info
- Since:
-
- 1.0.0
- See:
Returns:
- Type
- searchResponse
Type Definitions
-
bookResponse
-
Type:
- object
invalidTravelerTraveler information is incorrect, usually because the name contains non-English characters.invalidCreditCardCredit card information is incorrect, usually due to invalid expiry date format (YYMM) or incorrect card number.invalidPriceDetailPrice is incorrect, usually due to incorrect booking.rate.priceDetail. (Validation is disabled by default; contact support to enable and set booking.rateRule.key in the book request).invalidRateRate plan is incorrect, usually because the price has changed and needs to be re-fetched. (Validation is disabled by default; contact support to enable and set booking.rateRule.key in the book request).- Since:
-
- 1.0.0
Properties:
Name Type Argument Description errError <optional>
Error message, possible messageKeys:
orderOrder Order
-
HotelRateCalendarDay
-
Type:
- object
- Since:
-
- 1.0.0
Properties:
Name Type Argument Description checkInstring Check-in date in YYYY-MM-DD format; each entry is for a one-night stay
lowestHotelRate <optional>
Lowest rate for the day, containing only code, name, nameEn, price, and priceDetail; absent when no rate is available
-
HotelRateCalendarResponse
-
Type:
- object
- Since:
-
- 1.0.0
Properties:
Name Type Argument Description errError <optional>
Error message
resultsArray.<HotelRateCalendarDay> Daily rates in date order; dates without available rates still include checkIn
-
rateRuleResponse
-
Type:
- object
- Since:
-
- 1.0.0
Properties:
Name Type Argument Description errError <optional>
Error message
rateHotelRate Rate plan, containing only price and priceDetail nodes. Data here is more accurate than that returned by the rates API.
rateRuleHotelRateRule Rate plan rules
-
ratesResponse
-
Type:
- object
-
searchResponse
-
Type:
- object