Book

Create hotel reservation

Request Method#

POST

uri: /reservation/book

Content-Type: application/json


Request parameter description#

RequestHeader#

Common Request Header [reference]

RequestBody#

ParameterTypeRequiredMaximum lengthExampleDescription
hotelIdStringY3212 * * 567Hotel ID
iataStringN3256 **523IATA No
checkinTypeStringY16DAYCheck-in type, case sensitive, value Enumeration Dictionary
contactPersonGuestY-Contact Information
reservationsList<ReservationInfo>Y-Room list information, only single hotel and single product reservation are supported for the time being, only one collection is required
distributorResIdStringY64Distributor reservation number, which must be unique. Interface idempotent usage: distributorId + distributorResId, permanent idempotent
paymentTypeStringY16Enum value:
Enumeration Dictionary
guestCommentStringN512no smokingGuest notes, **Unsupported character: โ€œ\
hotelCommentStringN512Guest paid, no invoicing requiredReservation note, invisible for guest
memberIdStringN32Huazhu Member ID, member information will be verified if there is a value
occupyRoomFlagIntegerN-Unsupported
actualTotalPriceBigDecimalN-ActualTotalPrice cannot be blank when couponUseinfos has value. ActualTotalPrice is the sum of daily pricing, it represents the total cost of reservation.
couponUseInfosList<CouponUseInfo>N-Coupon Information
paymentCardPaymentCardN-Guaranteed Credit Card Information
preBookTokenStringN64Certification of successful pre-order. If the cert is present, the price in book request is checked against the price at the time of the cert generation, or if there is no cert, against the real-time price.

CouponUseInfo#

ParameterTypeRequiredMaximum lengthExampleDescription
couponIdStringY32Coupon ID
actualDiscountAmountBigDecimalY-The amount of the discounted value. For example, if a guest redeems a $10 coupon in the reservation, the amount would be $10

ReservationInfo#

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. The days of one reservation is up to 60 days
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
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
guaranteePolicyCodeStringY32Guarantee policy code, Enumeration Dictionary
childCountIntegerN-2Number of children per room, number limit depending on hotel details
childAgesList<Integer>N N-list of length 2
estimatedArrivalTimeString-12:00The estimation of guest arrival time at the property when specified, the time format is HH:mm, the default time is 12:00.
resGuestGuestN-Check-in person information. if no check-in person information , it can be left blank

Guest#

ParameterTypeRequiredMaximum lengthExampleDescription
firstNameStringN163Name
lastNameStringY16ZhangLast name (whole name can be delivered using this field only when last name and first name can't be split correctly)
emailStringN32001@test.com001@test.com mailbox
phoneStringN3218917569235Phone number
countryAccessCodeStringN886Country Access Code

PaymentCard#

ParameterTypeRequiredMaximum lengthExampleDescription
cardTypeStringY16MCReference Enumeration: Card Type
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
resIdStringY64Huazhu reservation number
resCodeStringN32Huazhu confirmation number

ResponseCode#

Exception CodeException TypeDescription
1000Success
5201Checkin and checkout does not match the rulescheck-in and check-out date does not conform to the rules
5202End date is invalidcheck-out date is invalid
5203Start date is invalidCheck-in date is invalid
5204Invalid hotel IdThe hotel Id does not exist
5205Hotel is closedHotel closed
5206Invalid currency codeUnsupported currency
5207Cannot book - too far in advanceNot available, too many days in advance
5208Reservation status invalidBooking status error
5209Price incorrect for roomPrice check failed
5210No rooms available for requested datesNot enough rooms on reservation date
5211Payment type invalidPayment type error
5212Credit card number is invalidUnsupported credit cards
5213Reservation requires credit card dataCredit card information is required to book
5214Invalid number of rooms, exceeded max number of room count
5215Invalid number of adults, exceeded max number of adult count
5216Invalid rate code for requested hotelThe requested hotel does not have this room price code
5217Invalid room type for requested hotelThe requested hotel does not have this room type
5218DistributorResId already existChannel number already exists, need to change channel number
5219Field exceeded the maximum limitParameter length exceeds maximum limit
5220Parent-child room check failedParent-child room check failed, not supported
5221Repeated requestRepeat Request
5222Coupons unbound or usedCoupon not bound or used
5223Price incorrect for couponWrong coupon amount
5224Multiple nights can not use coupon
5225Coupon type not supportUnsupported coupon types
5226Coupon use required memberIdMember ID required to use coupons
5227Member info check failedMember information check failed. For detailed reasons, please refer to responseDes
5228Current hotel not support lock roomThe current hotel does not support reservation lock room
5229Invalid guarantee policy codeFailed to verify the guarantee policy. For more information, see Response Description: responseDes
5230Invalid cancel policy codeFailed to verify the cancellation policy. For more information, see Response Description: responseDes
5231ResId already existOrder already exists
5232Invalid product for requested hotelHotel Product Verification Failed
5233Restriction verification failedThe verification of sales terms failed. For specific information, please refer to the response description: responseDes
5234Member level check failedMember level check failed
5235Member register time check failedMember registration time check failed
OthersGlobal Exception CodeGlobal Exception [Reference]

Message example#

Case1: Normal order#

Request Example#

{
"hotelId": "12**567 ",
"checkinType": "DAY ",
"paymentType": "OPN ",
"distributorResId": "13248292900 ",
"contactPerson ": {
"email": "***@huazhu.com ",
"firstName ": "***",
"lastName ": "***",
"phone": "139****2343 ",
"countryAccessCode": "86"
},
"reservations ": [
{
"rateCode": "BAR1 ",
"roomTypeCode": "TR1 ",
"checkin": "2021-10-06 ",
"checkout": "2021-10-08 ",
"childAges ": [
8,
10
],
"amountBeforeTax ": [
500,
500
],
"amountAfterTax ": [
549,
549
],
"roomCount": 1
"adultCount": 2
"childCount": 2
"currencyCode": "CNY ",
"estimatedArrivalTime": "18:30 ",
"guaranteePolicyCode": "PN ",
"resGuest ": [
{
"email": "***@huazhu.com ",
"firstName ": "***",
"lastName ": "***",
"phone": "139****2343 ",
"countryAccessCode": "86"
}
]
}
],
"guestComment": "I'm a guest note",
"hotelComment": "I am the order note, the guest can not see"
}

Case2: Place an order with credit card information#

Request Example#

{
"hotelId": "12**567 ",
"checkinType": "DAY ",
"paymentType": "CCPN ",
"distributorResId": "13248292900 ",
"contactPerson ": {
"email": "***@huazhu.com ",
"firstName ": "***",
"lastName ": "***",
"phone": "139****2343 ",
"countryAccessCode": "86"
},
"reservations ": [
{
"rateCode": "BAR1 ",
"roomTypeCode": "TR1 ",
"checkin": "2021-10-06 ",
"checkout": "2021-10-08 ",
"childAges ": [
8,
10
],
"amountBeforeTax ": [
500,
500
],
"amountAfterTax ": [
549,
549
],
"roomCount": 1
"adultCount": 2
"childCount": 2
"currencyCode": "CNY ",
"estimatedArrivalTime": "18:30 ",
"guaranteePolicyCode": "PN ",
"resGuest ": [
{
"email": "***@huazhu.com ",
"firstName ": "***",
"lastName ": "***",
"phone": "139****2343 ",
"countryAccessCode": "86"
}
]
}
],
"guestComment": "I'm a guest note",
"hotelComment": "I am the order note, the guest can't see it",
"paymentCard ": {
"cardType": "MC ",
"cardHolderName": "lilei ",
"cardNumber": "5531******58757 ",
"expireDate": "1225"
}
}

Case3: Order with iata information#

Request Example#

{
"hotelId": "12**567 ",
"iata": "56**523 ",
"checkinType": "DAY ",
"paymentType": "CCPN ",
"distributorResId": "13248292900 ",
"contactPerson ": {
"email": "***@huazhu.com ",
"firstName ": "***",
"lastName ": "***",
"phone": "139****2343 ",
"countryAccessCode": "86"
},
"reservations ": [
{
"rateCode": "BAR1 ",
"roomTypeCode": "TR1 ",
"checkin": "2021-10-06 ",
"checkout": "2021-10-08 ",
"childAges ": [
8,
10
],
"amountBeforeTax ": [
500,
500
],
"amountAfterTax ": [
549,
549
],
"roomCount": 1
"adultCount": 2
"childCount": 2
"currencyCode": "CNY ",
"estimatedArrivalTime": "18:30 ",
"guaranteePolicyCode": "PN ",
"resGuest ": [
{
"email": "***@huazhu.com ",
"firstName ": "***",
"lastName ": "***",
"phone": "139****2343 ",
"countryAccessCode": "86"
}
]
}
],
"guestComment": "I'm a guest note",
"hotelComment": "I am the order note, the guest can't see it",
"paymentCard ": {
"cardType": "MC ",
"cardHolderName": "lilei ",
"cardNumber": "5531******58757 ",
"expireDate": "1225"
}
}

Case4: order with preBookToken#

Request Example#

{
"preBookToken": "7132E7B17A219A4CCAAF86CD0D9EF1F1 ",
"hotelId": "12**567 ",
"checkinType": "DAY ",
"paymentType": "OPN ",
"distributorResId": "13248292900 ",
"contactPerson ": {
"email": "***@huazhu.com ",
"firstName ": "***",
"lastName ": "***",
"phone": "139****2343 ",
"countryAccessCode": "86"
},
"reservations ": [
{
"rateCode": "BAR1 ",
"roomTypeCode": "TR1 ",
"checkin": "2021-10-06 ",
"checkout": "2021-10-08 ",
"childAges": [
8,
10
]
"amountBeforeTax": [
500,
500
]
"amountAfterTax": [
549,
549
]
"roomCount": 1
"adultCount": 2
"childCount": 2
"currencyCode": "CNY ",
"estimatedArrivalTime": "18:30 ",
"guaranteePolicyCode": "PN ",
"resGuest ": [
{
"email": "***@huazhu.com ",
"firstName ": "***",
"lastName ": "***",
"phone": "139****2343 ",
"countryAccessCode": "86"
}
]
}
],
"guestComment": "I'm a guest note",
"hotelComment": "I am the order note, the guest can not see"
}

Example of successful response#

{
"code": 1000,
"content ": {
"resId": "R12**567**32332 ",
"resCode": "NMPMS23"
}
}

Response Failure Example#

{
"code": 5210,
"message": "No rooms available for requested dates"
}