Pre-Book
The pre-book will verify the pricing, inventory, restriction and the type of payment. If the verification fails, the correct price, sales terms and remaining room quantity will be returned. If the verification fails, only the response code([1000](# response code)) will be returned. If pre-book success, making a real book reservation still may not be successful. The reservation will be confirmed according to the real-time ARI
Try to stand alone in addition to placing orders: It is conducive to monitoring the timeliness of synchronization of hotel product and price inventory data, and continuously paying attention to the success rate of this interface is helpful to improve the experience of users on the distributor side.
#
Request MethodPOST
uri: /reservation/prebook
Content-Type: application/json
#
Request parameter description#
RequestHeaderCommon Request Header [reference]
#
RequestBodyParameter | Type | Required | Maximum length | Example | Description |
---|---|---|---|---|---|
hotelId | String | Y | 32 | 12 * * 567 | Hotel ID |
checkinType | String | Y | 16 | DAY | Check-in type, case sensitive, value Enumeration Dictionary |
reservations | List<PreBookReservationInfo> | Y | - | room list information, only single hotel and single product reservation are supported for the time being, only one collection is required | |
paymentType | String | Y | 16 | Enum value: Enumeration Dictionary | |
paymentCard | PaymentCard | N | - | Guaranteed Credit Card Information |
#
PreBookReservationInfoParameter | Type | Required | Maximum length | Example | Description |
---|---|---|---|---|---|
roomTypeCode | String | Y | 64 | DR1 | Room Code |
rateCode | String | Y | 64 | Base-NTR | rateCode |
checkin | Date | Y | - | 2021-10-01 | Check-in date in yyyy-MM-dd format |
checkout | Date | Y | - | 2021-10-02 | Check-out date, format yyyy-MM-dd, price does not include date of departure, Hourly rate room leaves the same day as checkin |
amountAfterTax | List<BigDecimal> | Y | - | [ 100, 130] | Price including tax, same as amountBeforeTax rules |
amountBeforeTax | List<BigDecimal> | N | - | [ 100, 120] | excluding tax price, arranged day by day according to stayRange.checkin to stayRange.checkout, excluding checkout eg: [101.00,102.00] means that the price on the day of checkin is 101, and the price on the checkin +1 day is 102 |
currencyCode | String | Y | 8 | CNY | The currency corresponding to the price, refer to the international standard: ISO-4217 |
roomCount | Integer | Y | - | 2 | Number of rooms, up to 3 |
adultCount | Integer | Y | - | 1 | Number of adults per room, the limit depends on hotel details |
childCount | Integer | N | - | 2 | Number of children per room, the limit depends on hotel details |
childAges | List<Integer> | N | - | list of length 2 |
#
PaymentCardParameter | Type | Required | Maximum length | Example | Description |
---|---|---|---|---|---|
cardType | String | Y | 16 | VCC | Card Type: MA MC VI VCC |
cardHolderName | String | Y | 64 | Name of cardholder | |
cardNumber | String | Y | 32 | Card number | |
expireDate | String | Y | 32 | Expiration time (month 2 digits, year 2 digits), format: MMYY |
#
Response parameter descriptionCommon Response Parameters [reference]
#
contentParameter | Type | Required | Maximum length | Example | Description |
---|---|---|---|---|---|
hotelId | String | Y | 32 | 12 * * 567 | |
preBookToken | String | N | 64 | Return only when pre-book success, bring with the token when make a real book reservation | |
reservationsAri | List<ReservationAri> | Y | - |
#
ReservationAriParameter | Type | Required | Maximum length | Example | Description |
---|---|---|---|---|---|
checkin | String | Y | - | 2021-10-01 | Check-in date in yyyy-MM-dd format |
checkout | String | Y | - | 2021-10-02 | Check-out date, format: yyyy-MM-dd, price does not include date of departure, Hourly rate room leaves the same day as checkin. The days of one reservation is up to 60 days |
roomTypeCode | String | Y | 64 | DR1 | Room Code |
rateCode | String | Y | 64 | Base-NTR | Price Code |
currencyCode | String | Y | 8 | CNY | Currency of the price |
mealPlanType | String | Y | 8 | Food & Beverage Type | |
mealPlanCounts | List<Integer> | Y | - | Number of meals per day | |
inventories | List<Integer> | Y | - | From checkin to checkout, excluding endDate | |
rates | List<RateInfo> | Y | does not contain endDate, daily rate information | ||
restriction | RestrictionInfo | Y | Restriction Information | ||
guaranteePolicies | List<GuaranteePolicy > | Y | includes endDate, guarantee policy, subject to the rules of scheduled check-in date | ||
cancelPolicies | List<CancelPolicy > | Y | Contains endDate, cancellation policy, subject to scheduled check-in rules |
#
GuaranteePolicyParameter | Type | Required | Maximum length | Example | Description |
---|---|---|---|---|---|
code | String | Y | 16 | guarantee code, Enumeration Dictionary |
#
CancelPolicyParameter | Type | Required | Maximum length | Example | Description |
---|---|---|---|---|---|
code | String | Y | 16 | Cancel policy code, Enumeration Dictionary |
#
RateInfoParameter | Type | Required | Maximum length | Example | Description |
---|---|---|---|---|---|
rackRate | List<BigDecimal> | N | - | [ 110, 130] | BAR Rate, Best Available Rate Prcing |
amountBeforeTax | List<BigDecimal> | N | - | [ 100, 120] | Price excluding tax |
amountAfterTax | List<BigDecimal> | Y | - | [ 100, 130] | Price including tax |
maxAdultCount | Integer | Y | - | 1 | For the maximum number of people, if only the return maxAdultCount is 3, the price of 1 2 people is the same as that of 3; if the return maxAdultCount is 1 2 3, the price of the corresponding number of people is taken |
maxChildCount | Integer | N | - | 2 | Maximum number of children, null for unlimited |
childAges | List<Integer> | n | - | list of length 2 |
#
RestrictionInfoReference example: Sales Terms Example
Parameter | Type | Required | Maximum length | Example | Description |
---|---|---|---|---|---|
close | List<Boolean> | Y | - | Open/Close stay restrictions, true: close, false: open | |
minStayArrival | List<Integer> | Y | - | Minimum Length of Stay on Arrival stay restrictions | |
maxStayArrival | List<Integer> | Y | - | Maximum Length of Stay on Arrival stay restrictions | |
minStayThrough | List<Integer> | Y | - | Minimum Length of Stay Through stay restrictions | |
maxStayThrough | List<Integer> | Y | - | Maximum Length of Stay Through stay restrictions | |
minAdvanceDay | List<Integer> | Y | - | Minimum number of Advance booking days on Arrival stay restrictions | |
maxAdvanceDay | List<Integer> | Y | - | Maximum number of Advance booking days on Arrival stay restrictions | |
cta | List<Boolean> | y | - | Close to Arrival on arrival day, true: Active, false: Inactive | |
ctd | List<Boolean> | Y | - | Close to Departure on departure day, true: Active, false: Inactive | |
Fplos | List<String> | Y | - | Full pattern length of stay, the restrictions are stored up to 31 bits per day, null or empty string indicates no limit |
#
ResponseCodeException Code | Exception Type | Description |
---|---|---|
1000 | Success | |
5101 | Checkin and checkout does not match the rules | check-in and check-out date does not conform to the rules |
5102 | End date is invalid | check-out date is invalid |
5103 | Start date is invalid | Check-in date is invalid |
5104 | Invalid hotel Id | Hotel Id does not exist |
5105 | Hotel is closed | Hotel closed |
5106 | Invalid currency code | Unsupported currency |
5107 | Too far in advance | Too many days booked in advance |
5108 | Price incorrect for room | Price check failed |
5109 | No rooms available for requested dates | Not enough rooms on reservation date |
5110 | Invalid number of rooms, exceeded max number of room count | |
5111 | Invalid number of adults, exceeded max number of adult count | |
5112 | Invalid rate code for requested hotel | The requested hotel does not have this room price code |
5113 | Invalid room type for requested hotel | The requested hotel does not have this room type |
5114 | Payment type invalid | Payment type error |
5115 | Credit card number is invalid | Unsupported credit cards |
5116 | Reservation requires credit card data | Credit card information is required to book |
5117 | Invalid guarantee policy code | Failed to verify the guarantee policy. For more information, see Response Description: responseDes |
5118 | Invalid cancel policy code | Failed to verify the cancellation policy. For more information, see Response Description: responseDes |
5119 | Invalid product for requested hotel | Hotel Product Verification Failed |
5120 | Restriction verification failed | The verification of sales terms failed. For specific information, please refer to the response description: responseDes |
5121 | Parent-child room check failed | Parent-child room check failed, not supported |
5122 | Reservation status invalid | Reservation status error. For specific information, please refer to response description: responseDes |
Others | Global Exception Code | Global Exception [Reference] |