订单Webhook

接口描述

当订单到流转到一状态时,给商户推送订单状态信息。

注意:如果商户的 http 应答码不是 200 或响应内容未包含 success,会判定本次通知失败。后续会重新通知,通知频率如下:

时间范围发送频率
10 分钟内每 2 分钟发送 1 次
1 小时内每 10 分钟发送 1 次
12 小时内每 1 小时发送 1 次
  • 商户需对通知内容进行签名验证,并检查返回的订单金额是否与商户端金额相符。
  • 签名字符串只包含 “验证= Y” 的参数

接口说明

请求方式:POST

请求地址:创建订单时上传的 callbackURL 参数

请求参数

参数名验证类型长度详情
orderNoYstring64订单号
orderStatusYstring32订单状态
userIdYstring128用户ID (邮箱或手机号码)
merchantOrderNoYstring64用户交易编号
orderCurrencyYstring32订单的法定货币 (USD/EUR)
orderAmountYstring16订单金额 (单位:元)
payCryptoRateYstring16支付加密货币汇率 (到USDT)
payFiatRateYstring16支付法定货币汇率 (到USD)
payCryptoCurrencyYstring32用戶支付的token
payCryptoVolumeYstring16用户支付金额(token)
payCryptoNetworkYstring32用户支付token的网络
hxAddressYstring256哈希
failReasonYstring256失败原因
feeYstring16手续费
settlementAmountNstring16入账金额
settlementCurrencyNstring16入账金额币种
customParamNobject512可定制字段
addressNstring64用戶打币地址
payNoNstring64支付单号(需配置)
signNstring256签名
payMethodNstring16用戶支付方式(仅在使用wallet connect或ton connect时生效)
fromAddressNstring256用户打币地址(仅在使用wallet connect或ton connect时生效)
payTimeNstring64时区 UTC+8,格式: yyyy-MM-dd hh:mm:ss
(仅在订单状态COMPLETED时生效)
orderTimeNstring64UTC+8时区的时间,格式为yyyy-MM-dd hh:mm:ss

回调参数示例

COMPLETED

{
    "fee": "2",
    "hxAddress": "2b04aa547740d8de8d442bc1827457b3e9bf4551234567893c319",
    "merchantOrderNo": "to_4bc9603bc5c123456",
    "orderAmount": "100",
    "orderCurrency": "USD",
    "orderNo": "3002172361782345678",
    "orderStatus": "COMPLETED",
    "payCryptoCurrency": "USDT",
    "payCryptoNetwork": "TRX",
    "payCryptoRate": "1",
    "payCryptoVolume": "102",
    "payFiatRate": "1",
    "settlementAmount": "100",
    "settlementCurrency": "USD",
    "sign": "C615A4F6436CAA3C5B74AA80AF0CF08D342E7C49D0164765D3563EC3E3E61F889E9B46BB1E6F1EEEB28280DA233B81E31591C8B1A33C0EE7969CD3",
    "userId": "u_dabd123456"
}

CLOSE

{
    "payCryptoCurrency": "ACH",
    "vCryptoNetwork": "BTC",
    "payCryptoRate": "123.4",
    "payCryptoVolume": "123",
    "payFiatRate": "1.23",
    "address": "adfdsafdsafdsafdsafadsfdsaf",
    "customParam": "customParam",
    "failReason": "crypto or network inconsistent",
    "fee": "1.1",
    "hxAddress": "aweweas",
    "merchantOrderNo": "9999999999",
    "orderAmount": "12",
    "orderCurrency": "EUR",
    "orderNo": "300217177567252640030",
    "orderStatus": "CLOSE",
    "settlementAmount": "0",
    "settlementCurrency": "USD",
    "sign": "B42DA144E9BD180F83E8E7EBD2A9F933798616819FF1BBE4AD4C84081073ECB85BD67F850D25303C5FD9CDF17FE82DD4DD0AAA44F9B7D6121EF17DE3428EFF1C",
    "userId": "[email protected]"
}

订单状态说明

参数名详情
COMPLETED支付成功
TIMEOUT支付取消
FAILED支付失败
DELAY_SUCCESS订单超时,支付成功
DELAY_FAILED订单超时,支付失败
ORDER_EXCEPTION异常订单,用户重复支付(需配置)