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 Method#

POST

uri: /reservation/prebook

Content-Type: application/json


Request parameter description#

RequestHeader#

Common Request Header [reference]

RequestBody#

ParameterTypeRequiredMaximum lengthExampleDescription
hotelIdStringY3212 * * 567Hotel ID
checkinTypeStringY16DAYCheck-in type, case sensitive, value Enumeration Dictionary
reservationsList<PreBookReservationInfo>Y-room list information, only single hotel and single product reservation are supported for the time being, only one collection is required
paymentTypeStringY16Enum value:
Enumeration Dictionary
paymentCardPaymentCardN-Guaranteed Credit Card Information

PreBookReservationInfo#

ParameterTypeRequiredMaximum lengthExampleDescription
roomTypeCodeStringY64DR1Room Code
rateCodeStringY64Base-NTRrateCode
checkinDateY-2021-10-01Check-in date in yyyy-MM-dd format
checkoutDateY-2021-10-02Check-out date, format yyyy-MM-dd, price does not include date of departure, Hourly rate room leaves the same day as checkin
amountAfterTaxList<BigDecimal>Y-[ 100, 130]Price including tax, same as amountBeforeTax rules
amountBeforeTaxList<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
currencyCodeStringY8CNYThe currency corresponding to the price, refer to the international standard: ISO-4217
roomCountIntegerY-2Number of rooms, up to 3
adultCountIntegerY-1Number of adults per room, the limit depends on hotel details
childCountIntegerN-2Number of children per room, the limit depends on hotel details
childAgesList<Integer>N-list of length 2

PaymentCard#

ParameterTypeRequiredMaximum lengthExampleDescription
cardTypeStringY16VCCCard Type: MA MC VI VCC
cardHolderNameStringY64Name of cardholder
cardNumberStringY32Card number
expireDateStringY32Expiration time (month 2 digits, year 2 digits), format: MMYY

Response parameter description#

Common Response Parameters [reference]

content#

ParameterTypeRequiredMaximum lengthExampleDescription
hotelIdStringY3212 * * 567
preBookTokenStringN64Return only when pre-book success, bring with the token when make a real book reservation
reservationsAriList<ReservationAri>Y-

ReservationAri#

ParameterTypeRequiredMaximum lengthExampleDescription
checkinStringY-2021-10-01Check-in date in yyyy-MM-dd format
checkoutStringY-2021-10-02Check-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
roomTypeCodeStringY64DR1Room Code
rateCodeStringY64Base-NTRPrice Code
currencyCodeStringY8CNYCurrency of the price
mealPlanTypeStringY8Food & Beverage Type
mealPlanCountsList<Integer>Y-Number of meals per day
inventoriesList<Integer>Y-From checkin to checkout, excluding endDate
ratesList<RateInfo>Ydoes not contain endDate, daily rate information
restrictionRestrictionInfoYRestriction Information
guaranteePoliciesList<GuaranteePolicy >Yincludes endDate, guarantee policy, subject to the rules of scheduled check-in date
cancelPoliciesList<CancelPolicy >YContains endDate, cancellation policy, subject to scheduled check-in rules

GuaranteePolicy#

ParameterTypeRequiredMaximum lengthExampleDescription
codeStringY16guarantee code, Enumeration Dictionary

CancelPolicy#

ParameterTypeRequiredMaximum lengthExampleDescription
codeStringY16Cancel policy code, Enumeration Dictionary

RateInfo#

ParameterTypeRequiredMaximum lengthExampleDescription
rackRateList<BigDecimal>N-[ 110, 130]BAR Rate, Best Available Rate Prcing
amountBeforeTaxList<BigDecimal>N-[ 100, 120]Price excluding tax
amountAfterTaxList<BigDecimal>Y-[ 100, 130]Price including tax
maxAdultCountIntegerY-1For 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
maxChildCountIntegerN-2Maximum number of children, null for unlimited
childAgesList<Integer>n-list of length 2

RestrictionInfo#

Reference example: Sales Terms Example

ParameterTypeRequiredMaximum lengthExampleDescription
closeList<Boolean>Y-Open/Close stay restrictions, true: close, false: open
minStayArrivalList<Integer>Y-Minimum Length of Stay on Arrival stay restrictions
maxStayArrivalList<Integer>Y-Maximum Length of Stay on Arrival stay restrictions
minStayThroughList<Integer>Y-Minimum Length of Stay Through stay restrictions
maxStayThroughList<Integer>Y-Maximum Length of Stay Through stay restrictions
minAdvanceDayList<Integer>Y-Minimum number of Advance booking days on Arrival stay restrictions
maxAdvanceDayList<Integer>Y-Maximum number of Advance booking days on Arrival stay restrictions
ctaList<Boolean>y-Close to Arrival on arrival day, true: Active, false: Inactive
ctdList<Boolean>Y-Close to Departure on departure day, true: Active, false: Inactive
FplosList<String>Y-Full pattern length of stay, the restrictions are stored up to 31 bits per day, null or empty string indicates no limit

ResponseCode#

Exception CodeException TypeDescription
1000Success
5101Checkin and checkout does not match the rulescheck-in and check-out date does not conform to the rules
5102End date is invalidcheck-out date is invalid
5103Start date is invalidCheck-in date is invalid
5104Invalid hotel IdHotel Id does not exist
5105Hotel is closedHotel closed
5106Invalid currency codeUnsupported currency
5107Too far in advanceToo many days booked in advance
5108Price incorrect for roomPrice check failed
5109No rooms available for requested datesNot enough rooms on reservation date
5110Invalid number of rooms, exceeded max number of room count
5111Invalid number of adults, exceeded max number of adult count
5112Invalid rate code for requested hotelThe requested hotel does not have this room price code
5113Invalid room type for requested hotelThe requested hotel does not have this room type
5114Payment type invalidPayment type error
5115Credit card number is invalidUnsupported credit cards
5116Reservation requires credit card dataCredit card information is required to book
5117Invalid guarantee policy codeFailed to verify the guarantee policy. For more information, see Response Description: responseDes
5118Invalid cancel policy codeFailed to verify the cancellation policy. For more information, see Response Description: responseDes
5119Invalid product for requested hotelHotel Product Verification Failed
5120Restriction verification failedThe verification of sales terms failed. For specific information, please refer to the response description: responseDes
5121Parent-child room check failedParent-child room check failed, not supported
5122Reservation status invalidReservation status error. For specific information, please refer to response description: responseDes
OthersGlobal Exception CodeGlobal Exception [Reference]

Message example#

Case1: Single Product Verification#

Request Example#

{
"hotelId": "12**567 ",
"checkinType": "DAY ",
"paymentType": "OPN ",
"reservations ": [
{
"checkin": "2021-07-08 ",
"checkout": "2021-07-10 ",
"roomCount": 1
"maxAdultCount": 2
"amountAfterTax ": [
560,
560
],
"rackRate ": [
559,
549
],
"amountBeforeTax ": [
559,
549
],
"currencyCode": "CNY ",
"rateCode": "B15A14NBF ",
"roomTypeCode": "SQ1"
}
]
}

Example of successful verification#

{
"code": 1000,
"content ": {
"hotelId": "12**567 ",
"preBookToken": "7132E7B17A219A4CCAAF86CD0D9EF1F1 ",
"reservationsAri ": [
{
"checkin": "2021-10-06 ",
"checkout": "2021-10-08 ",
"roomTypeCode": "K1B ",
"rateCode": "Base-ODC401 ",
"currencyCode": "CNY ",
"rates ": [
{
"adultCount": 2
"amountAfterTax ": [
328,
328
],
"amountBeforeTax ": [
309,
309
],
"childCount": 0
}
],
"inventories ": [
0,
2
],
"mealPlanType": "BB ",
"mealPlanCounts ": [
1,
1
],
"guaranteePolicies ": [
{
"code": "PL"
},
{
"code": "PN"
}
],
"cancelPolicies ": [
{
"code": "AD0_0"
},
{
"code": "AD100_6PM0D1N_1N"
}
],
"restriction ": {
"close ": [
false
false
],
"cta ": [
false
false
],
"ctd ": [
false
false
],
"maxAdvanceDay ": [
999,
999
],
"maxStayArrival ": [
999,
999
],
"maxStayThrough ": [
0,
0
],
"minAdvanceDay ": [
3,
3
],
"minStayArrival ": [
5,
5
],
"minStayThrough ": [
0,
0
],
"fplos ": [
"0000000",
"1110111"
]
}
}
]
}
}

Verification Failure Example#

{
"code": 5108
"message": "Price incorrect for room ",
"content ": {
"hotelId": "12**567 ",
"reservationsAri ": [
{
"checkin": "2021-10-06 ",
"checkout": "2021-10-08 ",
"roomTypeCode": "K1B ",
"rateCode": "Base-ODC401 ",
"currencyCode": "CNY ",
"rates ": [
{
"adultCount": 2
"amountAfterTax ": [
328,
328
],
"amountBeforeTax ": [
309,
309
],
"childCount": 0
}
],
"inventories ": [
0,
2
],
"mealPlanType": "BB ",
"mealPlanCounts ": [
1,
1
],
"guaranteePolicies ": [
{
"code": "PL"
},
{
"code": "PN"
}
],
"cancelPolicies ": [
{
"code": "AD0_0"
},
{
"code": "AD100_6PM0D1N_1N"
}
],
"restriction ": {
"close ": [
false
false
],
"cta ": [
false
false
],
"ctd ": [
false
false
],
"maxAdvanceDay ": [
999,
999
],
"maxStayArrival ": [
999,
999
],
"maxStayThrough ": [
0,
0
],
"minAdvanceDay ": [
3,
3
],
"minStayArrival ": [
5,
5
],
"minStayThrough ": [
0,
0
],
"fplos ": [
"0000000",
"1110111"
]
}
}
]
}
}