创建订单

创建酒店预订单

请求方式#

POST

uri: /reservation/book

Content-Type: application/json


请求参数说明#

RequestHeader#

公共请求头[引用]

RequestBody#

参数类型是否必填最大长度示例描述
hotelIdStringY3212**567华住酒店ID
iataStringN3256**523航司号
checkinTypeStringY16DAY入住类型,区分大小写,取值参考枚举
contactPersonGuestY-联系人信息
reservationsList<ReservationInfo>Y-房单信息,暂只支持单酒店,单产品的预订,集合只需传1个
distributorResIdStringY64分销商订单号,需保证唯一性;接口幂等使用:distributorId+distributorResId,永久幂等
paymentTypeStringY16枚举值:
参考枚举
guestCommentStringN512no smoking客人备注, 无可不传,特殊字符不支持“|” 和 “'”
hotelCommentStringN512客人已付款,无需开票订单备注,客人不可见不支持“|” 和 “'”
memberIdStringN32华住会员ID,有值会进行会员信息校验
occupyRoomFlagIntegerN-锁房标记,1表示锁房订单,0表示不锁房,默认0;需与华住侧确认后支持,暂不开放
actualTotalPriceBigDecimalN-couponUseInfos有值时,actualTotalPrice不能为空
订单实际支付金额: 订单总金额(汇总每日价实体)=优惠金额+实际支付金额
couponUseInfosList<CouponUseInfo>N-优惠券信息
paymentCardPaymentCardN-担保信用卡信息
preBookTokenStringN647132E7B17A219A4CCAAF86CD0D9EF1F1试单成功凭证,校验通过不验价,不传或校验失败则会验价

CouponUseInfo#

参数类型是否必填最大长度示例描述
couponIdStringY32优惠券ID
actualDiscountAmountBigDecimalY-优惠券实际优惠金额

ReservationInfo#

参数类型是否必填最大长度示例描述
roomTypeCodeStringY64DR1房型Code
rateCodeStringY64Base-NTR房价码
checkinDateY-2021-10-01入住日期,格式 yyyy-MM-dd
checkoutDateY-2021-10-02离店日期,格式 yyyy-MM-dd,传价格不包含离店日,时租入离同一天,一次最大支持入离间隔60天的订单,即checkout-checkin=60
rackRateList<BigDecimal>N-[ 110, 130]门市价
amountBeforeTaxList<BigDecimal>N-[ 100, 120]不含税价
amountAfterTaxList<BigDecimal>Y-[ 100, 130]含税价
currencyCodeStringY8CNY价格对应的币种,参考国际标准: ISO-4217
roomCountIntegerY-2房间数量,最多预订3间
adultCountIntegerY-1每间房成人数, 人数限制依赖酒店详情对应的人数
guaranteePolicyCodeStringY32担保政策code,取值参考枚举
childCountIntegerN-2每间房儿童数, 人数限制依赖酒店详情对应的人数
childAgesList<Integer>N N-长度为2的list儿童年龄段,长度需与儿童数量保持一致
estimatedArrivalTimeString-12:00预计到店时间,格式 HH:mm,默认12:00,报价为分时担保政策时,需要必填,暂无此业务可为空。
resGuestGuestN-入住人信息,无入住人信息可不填
hourlyRoomHourlyRoomN-时租房信息

Guest#

参数类型是否必填最大长度示例描述
firstNameStringN16
lastNameStringY16姓(姓、名无区分时,可把姓名传至此字段)
emailStringN32001@test.com001@test.com邮箱
phoneStringN3218917569235手机号
countryAccessCodeStringN886国家访问代码

PaymentCard#

参数类型是否必填最大长度示例描述
cardTypeStringY16MC参考枚举:卡类型
cardHolderNameStringY64持卡人姓名
cardNumberStringY32卡号
expireDateStringY32过期时间(月2个数字,年2个数字), 格式: MMyy

HourlyRoom#

参数类型是否必填最大长度示例描述
hourlyRateStartTimeStringN509:00时租计费开始时间,格式 HH:mm
hourlyRateEndTimeStringN513:00时租计费结束时间,格式 HH:mm

响应参数说明#

公共响应参数[引用]

响应码-code[引用]

content#

参数类型是否必填最大长度示例描述
resIdStringY64华住订单号
resCodeStringN32华住预订码,非必填值

响应码#

异常码异常类型说明
1000Success
5201Checkin and checkout does not match the rules入住离店日期不符合规则
5202End date is invalid离店日无效
5203Start date is invalid入住日无效
5204Invalid hotel Id酒店Id不存在
5205Hotel is closed酒店停业
5206Invalid currency code不支持的币种
5207Cannot book - too far in advance不可预订,提前预订天数过大
5208Reservation status invalid预订状态错误
5209Price incorrect for room房价校验失败
5210No rooms available for requested dates预订日期房间数量不足
5211Payment type invalid支付类型错误
5212Credit card number is invalid不支持的信用卡
5213Reservation requires credit card data需要信用卡信息才可预订
5214Invalid number of rooms, exceed max number of room count预订房间数超过最大限制
5215Invalid number of adults, exceed max number of adult count成人数超过最大限制
5216Invalid rate code for requested hotel请求的酒店无此房价码
5217Invalid room type for requested hotel请求的酒店无此房型
5218DistributorResId already exist渠道单号已存在,需更改渠道单号
5219Field exceeded the maximum limit参数长度超过最长限制
5220Parent-child room check failed亲子房校验失败,不支持
5221Repeated request重复请求
5222Coupons unbound or used优惠券未绑定或已使用
5223Price incorrect for coupon优惠券金额错误
5224Multiple nights can not use coupon多间夜不可用使用优惠券
5225Coupon type not support不支持的优惠券类型
5226Coupon use required memberId使用优惠券需传会员ID
5227Member info check failed会员信息检查失败,详细原因参考:responseDes
5228Current hotel not support lock room当前酒店不支持预订锁房
5229Invalid guarantee policy code校验担保政策失败,具体信息参考响应描述:responseDes
5230Invalid cancel policy code校验取消政策失败,具体信息参考响应描述:responseDes
5231ResId already exist订单已存在
5232Invalid product for requested hotel酒店商品校验失败
5233Restriction verification failed销售条款校验失败,具体信息参考响应描述:responseDes
5234Member level check failed会员等级检查失败
5235Member register time check failed会员注册时间检查失败
其他全局异常码全局异常[引用]

报文示例#

Case1:正常下单#

请求示例#

{
"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":"我是客人备注",
"hotelComment":"我是订单备注,客人看不见"
}

Case2:带信用卡信息下单#

请求示例#

{
"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":"我是客人备注",
"hotelComment":"我是订单备注,客人看不见",
"paymentCard":{
"cardType":"MC",
"cardHolderName":"lilei",
"cardNumber":"5531******58757",
"expireDate":"1225"
}
}

Case3:带iata信息下单#

请求示例#

{
"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":"我是客人备注",
"hotelComment":"我是订单备注,客人看不见",
"paymentCard":{
"cardType":"MC",
"cardHolderName":"lilei",
"cardNumber":"5531******58757",
"expireDate":"1225"
}
}

Case4:带preBookToken下单#

请求示例#

{
"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":"我是客人备注",
"hotelComment":"我是订单备注,客人看不见"
}

响应成功示例#

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

响应失败示例#

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