Book
Create hotel reservation
#
Request MethodPOST
uri: /reservation/book
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 |
iata | String | N | 32 | 56 **523 | IATA No |
checkinType | String | Y | 16 | DAY | Check-in type, case sensitive, value Enumeration Dictionary |
contactPerson | Guest | Y | - | Contact Information | |
reservations | List<ReservationInfo> | Y | - | Room list information, only single hotel and single product reservation are supported for the time being, only one collection is required | |
distributorResId | String | Y | 64 | Distributor reservation number, which must be unique. Interface idempotent usage: distributorId + distributorResId, permanent idempotent | |
paymentType | String | Y | 16 | Enum value: Enumeration Dictionary | |
guestComment | String | N | 512 | no smoking | Guest notes, **Unsupported character: โ\ |
hotelComment | String | N | 512 | Guest paid, no invoicing required | Reservation note, invisible for guest |
memberId | String | N | 32 | Huazhu Member ID, member information will be verified if there is a value | |
occupyRoomFlag | Integer | N | - | Unsupported | |
actualTotalPrice | BigDecimal | N | - | ActualTotalPrice cannot be blank when couponUseinfos has value. ActualTotalPrice is the sum of daily pricing, it represents the total cost of reservation. | |
couponUseInfos | List<CouponUseInfo> | N | - | Coupon Information | |
paymentCard | PaymentCard | N | - | Guaranteed Credit Card Information | |
preBookToken | String | N | 64 | Certification 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. |
#
CouponUseInfoParameter | Type | Required | Maximum length | Example | Description |
---|---|---|---|---|---|
couponId | String | Y | 32 | Coupon ID | |
actualDiscountAmount | BigDecimal | Y | - | The amount of the discounted value. For example, if a guest redeems a $10 coupon in the reservation, the amount would be $10 |
#
ReservationInfoParameter | 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. The days of one reservation is up to 60 days |
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 |
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 |
guaranteePolicyCode | String | Y | 32 | Guarantee policy code, Enumeration Dictionary | |
childCount | Integer | N | - | 2 | Number of children per room, number limit depending on hotel details |
childAges | List<Integer> | N N | - | list of length 2 | |
estimatedArrivalTime | String | - | 12:00 | The estimation of guest arrival time at the property when specified, the time format is HH:mm, the default time is 12:00. | |
resGuest | Guest | N | - | Check-in person information. if no check-in person information , it can be left blank |
#
GuestParameter | Type | Required | Maximum length | Example | Description |
---|---|---|---|---|---|
firstName | String | N | 16 | 3 | Name |
lastName | String | Y | 16 | Zhang | Last name (whole name can be delivered using this field only when last name and first name can't be split correctly) |
String | N | 32 | 001@test.com | 001@test.com mailbox | |
phone | String | N | 32 | 18917569235 | Phone number |
countryAccessCode | String | N | 8 | 86 | Country Access Code |
#
PaymentCardParameter | Type | Required | Maximum length | Example | Description |
---|---|---|---|---|---|
cardType | String | Y | 16 | MC | Reference Enumeration: Card Type |
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 |
---|---|---|---|---|---|
resId | String | Y | 64 | Huazhu reservation number | |
resCode | String | N | 32 | Huazhu confirmation number |
#
ResponseCodeException Code | Exception Type | Description |
---|---|---|
1000 | Success | |
5201 | Checkin and checkout does not match the rules | check-in and check-out date does not conform to the rules |
5202 | End date is invalid | check-out date is invalid |
5203 | Start date is invalid | Check-in date is invalid |
5204 | Invalid hotel Id | The hotel Id does not exist |
5205 | Hotel is closed | Hotel closed |
5206 | Invalid currency code | Unsupported currency |
5207 | Cannot book - too far in advance | Not available, too many days in advance |
5208 | Reservation status invalid | Booking status error |
5209 | Price incorrect for room | Price check failed |
5210 | No rooms available for requested dates | Not enough rooms on reservation date |
5211 | Payment type invalid | Payment type error |
5212 | Credit card number is invalid | Unsupported credit cards |
5213 | Reservation requires credit card data | Credit card information is required to book |
5214 | Invalid number of rooms, exceeded max number of room count | |
5215 | Invalid number of adults, exceeded max number of adult count | |
5216 | Invalid rate code for requested hotel | The requested hotel does not have this room price code |
5217 | Invalid room type for requested hotel | The requested hotel does not have this room type |
5218 | DistributorResId already exist | Channel number already exists, need to change channel number |
5219 | Field exceeded the maximum limit | Parameter length exceeds maximum limit |
5220 | Parent-child room check failed | Parent-child room check failed, not supported |
5221 | Repeated request | Repeat Request |
5222 | Coupons unbound or used | Coupon not bound or used |
5223 | Price incorrect for coupon | Wrong coupon amount |
5224 | Multiple nights can not use coupon | |
5225 | Coupon type not support | Unsupported coupon types |
5226 | Coupon use required memberId | Member ID required to use coupons |
5227 | Member info check failed | Member information check failed. For detailed reasons, please refer to responseDes |
5228 | Current hotel not support lock room | The current hotel does not support reservation lock room |
5229 | Invalid guarantee policy code | Failed to verify the guarantee policy. For more information, see Response Description: responseDes |
5230 | Invalid cancel policy code | Failed to verify the cancellation policy. For more information, see Response Description: responseDes |
5231 | ResId already exist | Order already exists |
5232 | Invalid product for requested hotel | Hotel Product Verification Failed |
5233 | Restriction verification failed | The verification of sales terms failed. For specific information, please refer to the response description: responseDes |
5234 | Member level check failed | Member level check failed |
5235 | Member register time check failed | Member registration time check failed |
Others | Global Exception Code | Global Exception [Reference] |