TABLE OF CONTENTS

介绍

此接口是推送协议,由德比向渠道的指定 endpoint 推送订单的入住状态、入住时间、离店时间及订单金额等信息。

此接口采用了德比 GO API 鉴权机制,来确保接口交互时数据的安全性。(详细说明请参考:GO API 鉴权说明

渠道需要配置订单环境 endpoint 用于接收来自德比的订单状态推送。
如何配置 endpoint:
① 登录 Go Console 并导航到 Management >> Customer Setting 页面。
② 滚动光标到页面底部, 找到标签 "Reservation Audit Endpoint"。 ③ *** 请注意 *** 只有授权用户才能更新(ReNew)生产环境的 endpoint(授权管理与 Access Token 类似)。如需申请授权,请联系您的客户经理或我们的支持团队。

订单状态推送

/reservation/audit/push

消息体采用标准JSON格式,UTF-8编码 

HTTP头中增加Authorization,用于传递认证信息,包括请求消息和响应消息

POST /reservation/audit/push HTTP/1.1
URL: {{endpoint}}/reservation/audit/push
Authorization: 53ac07777cdffac2d53000002d698728ce964432d7167596bc005c5fc
Accept-Encoding: gzip
Content-Encoding: gzip
Content-Type: application/json;charset=utf-8

请求示例

{
    "header": {
        "distributorId": "xxx",
        "supplierId": "xxx",
        "token": "xxx"
    },
    "hotelId": "hotelCode",
    "reservationId": {
        "distributorResId": "xxx",
        "derbyResId": "xxx",
        "supplierResId": "supplierResId1,supplierResId2"
    },
    "auditId": "xx",
    "auditDateTime": "2023-06-04T08:12:23.123Z",
    "currency": "CNY",
    "roomDetails": [
        {
            "roomId": "100001",
            "rateId": "123456",
            "stayDateRange": {
                "checkInDateTime": "2023-06-01 08:12:23",
                "checkOutDateTime": "2023-06-03 08:12:23",
                "timeZone": ""
            },
            "roomStatus": "CHECK_IN",
            "roomRevenue": {
                "amountBeforeTax": 250,
                "amountAfterTax": 450
            },
            "otherFees": [
                {
                    "amountBeforeTax": 3,
                    "amountAfterTax": 5,
                    "description": "Drink"
                }
            ],
            "hotelComments": "Comments from hotel side",
            "supplierResId": "supplierResID1"
        }
    ],
    "total": {
        "roomRevenue": {
            "amountBeforeTax": 250,
            "amountAfterTax": 450
        },
        "otherFees": [
            {
                "amountBeforeTax": 20,
                "amountAfterTax": 40,
                "description": "Drink Fee"
            },
            {
                "amountBeforeTax": 50,
                "amountAfterTax": 70,
                "description": "Penalty"
            },
            {
                "amountBeforeTax": 40,
                "amountAfterTax": 50,
                "description": "ServiceCharge"
            }
        ]
    }
}


请求参数

参数名称

数据类型 

是否必传

描述

示例

header

object

/

/

@distributorId

string

渠道ID,最长32位

HUAWEI

@supplierId

string

供应商ID,最长32位

HUAZHU

@token

string

/

/

hotelId

string

供应商酒店代码

100001

reservationId

object

/

/

@distributorResId

string

渠道订单号

C2084DFL0

@derbyResId

string

德比订单号

D15F893D34DF

@supplierResId

string

供应商订单号

89389494,89389495

auditId

string

日夜审数据Id

9f1925cc888c438d

auditDateTime

string

收到供应商数据推送日期和时间

2023-06-04T08:12:23.123Z

currency

string

货币单位【ISO-4217】

USD

roomDetails

array[object]

/

/

@roomId

string

供应商房型代码

10000101

@rateId

string

供应商价格计划代码

123456

@roomStatus

enum

枚举值【NO_SHOW, CHECK_IN, CHECK_OUT】

/

@hotelComments

string

酒店备注

/

@supplierResId

string


如供应商有多房拆单的情况,这里表示供应商子订单号

89389494

roomDetails/stayDateRange

object

订单实际入住和离店时间

/

@checkInDateTime

string

实际入住日期和时间

2023-06-04T08:12:23.123Z

@checkOutDateTime

string

实际离店日期和时间

2023-06-04T08:12:23.123Z

@timeZone

string

时区

/

roomDetails/roomRevenue

object

房费金额

/

@amountBeforeTax

number

税前价格

/

@amountAfterTax

number

含税价格

/

roomDetails/otherFees

array[object]

其它费用

/

@amountBeforeTax

number

税前价格

/

@amountAfterTax

number

含税价格

/

@description

string

费用描述

/

total

object

订单总费用

/

total/roomRevenue

object

订单总费用

/

@amountBeforeTax

number

税前价格

/

@amountAfterTax

number

含税价格

/

total/otherFees

array[object]

其它费用

/

@amountBeforeTax

number

税前价格

/

@amountAfterTax

number

含税价格

/

@description

string

费用描述

/


响应示例

Notes:
德比会结合响应代码来判断订单状态推送是否成功。例如 Http Status 200 代表推送成功,非 200 代表推送失败。对于失败的请求,德比会进行重试(重试五次,每次间隔五分钟)。
  • 成功示例 (HTTP Status 200)
{
    "header": {
        "distributorId": "xxx",
        "supplierId": "xxx",
        "token": "xxx"
    },
    "result": "Success"
}
  • 错误示例 (HTTP Status 401)
{
    "errorCode": "InvalidIdentityCredential",
    "errorMessage": "Invalid Identity Credential"
}
  • 错误示例 (HTTP Status 500)
{
    "errorCode": "InternalError",
    "errorMessage": "error message with details of the error"
}


响应参数

参数名称

数据类型

是否必传

描述

示例

header

object

Yes

 /

 /

@supplierId

string

Yes

供应商ID,最长32位

HUAZHU

@distributorId

string

Yes

渠道ID,最长32位

HUAWEI

@token

string

Yes

推荐使用UUID,最长64位

18393849028490234

result

string

Yes

/

Success