预订

客人所选的房型、餐食类型和价格以 BookingPushRQ 结构推送到 HMS。同一端点也可处理取消和修改:将 type 设为 CancelModify 即可。端到端流程见预订流程指南。

推送预订(BookingPushRQ)#

POST/external/online/channel/booking

身份验证: Authorization: Bearer · 请求体: application/json

在 HMS 中记录一个或多个预订。ID 是由您一方生成的唯一预订编号;使用相同 ID 发送 Modify 会更新该记录,发送 Cancel 则取消该预订。同一房型和餐食类型售出多间房时,每间房都是一个独立的 RoomStays 项,NumberOfUnits 依次为 1、2、3…

支付方式为信用卡(9)时,卡信息放在 PaymentCard 下;其他支付方式请省略该字段。处理卡数据意味着您需要满足 PCI DSS 合规要求。

请求体

BookingPushRQ.Bookings[]object[]必填
预订列表。通常只有一项。
hotelIDstring必填
酒店 ID。
IDstring必填
您系统中的唯一预订编号。同时保存为凭证(voucher)编号。
typestring必填
操作类型。
BookModifyCancel
createDateTimedatetime
预订创建时间(ISO 8601)。
checkinDate / checkoutDatedate必填
入住和退房日期,YYYY-MM-DD
RoomStays[]object[]必填
售出的房间。
roomTypeIDstring必填
房型列表中的 items[].id
roomNamestring
房型名称(仅供参考)。
ratePlanIDstring必填
房型列表中的 accommodationTypes[].id
ratePlanNamestring
餐食类型名称(仅供参考)。
typestring
该房间的操作类型。
BookModifyCancel
NumberOfUnitsstring必填
同一房型/餐食类型下各房间的序号:1、2、3…
checkinDate / checkoutDatedate必填
该房间的入住和退房日期。
GuestCountobject必填
adultchild 人数。
PerDayRatesobject
currencyPerDayRate[]stayDatebaseRatehotelServiceFees
Totalobject必填
房间合计:amountAfterTaxesamountOfTaxescurrency
PaymentCardobject
仅限支付方式 9(信用卡)。CardHolder{fullname, address, country, city}cardNumberexpireDateMMYY)、cardCodeseriesCode(CVV)。
PrimaryGuests[]object[]必填
主客人:namesurnamePhoneNumberemailCountryCode
ChildGuests[]object[]
儿童。age 为必填;namesurnameyeardatedetail 为可选。
SpecialRequest[]object[]
客人备注和取消条款:text。会合并到预订备注中。
extras[]object[]
售出的附加服务/套餐:namenotepersonpiecepricepriceModepriceTotalstockID(套餐列表中的 id)。
Totalobject必填
总计:amountAfterTaxesamountOfTaxesextraTotalcurrency

响应

200 BookingPushRS 对象。成功时返回 Success: true 和 HMS 预订 ID(HMS_ID);失败时返回 Error 消息和 BookingConfirmNumbers[].Error[]

错误响应

  • 200 ErrorNo available data could be found.(01,请求体为空或无法解析)· Hotel registration not found on HMS.(02,酒店未接入在线渠道)· Could not register. · Failed to parse information.
请求
curl -X POST "https://test.hms.gen.tr/external/online/channel/booking" \
  -H "Authorization: Bearer $HMS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "BookingPushRQ": {
        "Bookings": [
            {
                "hotelID": "1000",
                "ID": "4811174883",
                "type": "Book",
                "createDateTime": "2026-08-01T08:32:11:293Z",
                "checkinDate": "2026-08-18",
                "checkoutDate": "2026-08-20",
                "RoomStays": [
                    {
                        "roomTypeID": "2",
                        "roomName": "标准间",
                        "ratePlanID": "2",
                        "ratePlanName": "含早餐",
                        "type": "Book",
                        "NumberOfUnits": "1",
                        "checkinDate": "2026-08-18",
                        "checkoutDate": "2026-08-20",
                        "GuestCount": {
                            "adult": 2,
                            "child": 1
                        },
                        "PerDayRates": {
                            "currency": "TRY",
                            "PerDayRate": [
                                {
                                    "stayDate": "2026-08-18",
                                    "baseRate": "965.00",
                                    "hotelServiceFees": "0"
                                },
                                {
                                    "stayDate": "2026-08-19",
                                    "baseRate": "965.00",
                                    "hotelServiceFees": "0"
                                }
                            ]
                        },
                        "Total": {
                            "amountAfterTaxes": "1930.00",
                            "amountOfTaxes": "175.45",
                            "currency": "TRY"
                        }
                    }
                ],
                "PrimaryGuests": [
                    {
                        "name": "Ayşe",
                        "surname": "Demir",
                        "PhoneNumber": "+905551112233",
                        "email": "[email protected]",
                        "CountryCode": "TR"
                    }
                ],
                "ChildGuests": [
                    {
                        "age": 7
                    }
                ],
                "SpecialRequest": [
                    {
                        "text": "晚到,约 23:00 入住。"
                    }
                ],
                "extras": [
                    {
                        "name": "晚餐",
                        "note": "",
                        "person": 2,
                        "piece": 1,
                        "price": "400.00",
                        "priceMode": null,
                        "priceTotal": "400.00",
                        "stockID": 12
                    }
                ],
                "Total": {
                    "amountAfterTaxes": "2330.00",
                    "amountOfTaxes": "211.82",
                    "extraTotal": "400.00",
                    "currency": "TRY"
                }
            }
        ]
    }
}'
响应 · 200
{
    "BookingPushRS": {
        "Success": true,
        "BookingConfirmNumbers": [
            {
                "confirmTime": 1755500000,
                "bookingID": 48213,
                "bookingType": "Book",
                "HMS_ID": 48213
            }
        ]
    }
}
响应 · 200(错误)
{
    "BookingPushRS": {
        "Error": "Hotel registration not found on HMS.",
        "BookingConfirmNumbers": [
            {
                "bookingID": null,
                "bookingType": null,
                "confirmTime": 1755500000,
                "Error": [
                    {
                        "code": "02",
                        "text": "Hotel registration not found on HMS."
                    }
                ]
            }
        ]
    }
}
最后更新: 2026年9月21日发现错误?请告诉我们