Webhook for Order Status

Introduction

Webhook for Order Status

Webhook will call merchant when order payment success/ failed/ overtime/ overtime and pay successfully.

Description

👍

After the payment is completed, the relevant payment results and user information will be sent to the merchant in JSON format. The merchant needs to receive and process them, and respond according to the documentation specifications.

  • The same notification may be sent to the merchant multiple times. The merchant must be able to handle duplicate notifications correctly.
  • If the merchant's HTTP response code is not 200 or the response content does not include "success," the notification will be considered failed. Subsequent notifications will be retried with the following frequency: every 2 minutes within 10 minutes of the order, every 10 minutes within 1 hour of the order, and every 1 hour within 12 hours of the order.
  • When handling notifications, the merchant should first check the status of the relevant business data to determine whether the notification has already been processed. If it has not been processed, continue processing; if it has been processed, return a successful response directly.
  • Fields with values of null or "" are not included in the signature.

🚧

The merchant system must verify the signature of the payment result notification and check whether the returned order amount matches the amount on the merchant side. This is to prevent "false notifications" caused by data leaks, which could lead to financial losses.

Webhook Parameters

ParameterSignTypeLengthDetails
orderNoYstring64Order number
orderStatusYstring32Order status (COMPLETED, CLOSE, TIMEOUT, FAILED, DELAY_SUCCESS, DELAY_FAILED)
userIdYstring128User id (email or phone number)
merchantOrderNoYstring64User transaction number
orderCurrencyYstring32Fiat Currency of order (USD/EUR)
orderAmountYstring16Order amount (Cent)
payCryptoRateYstring16Payment crypto rate (to USDT)
payFiatRateYstring16Payment Fiat rate (to USD)
payCryptoCurrencyYstring32Token of payment
payCryptoVolumeYstring16Amount of token payment
payCryptoNetworkYstring32Network of token payment
hxAddressYstring256Hash
signNstring256Sign
failReasonYstring256Fail reason
feeYstring16Handling Fee
customParamNobject512Customizable fields
addressNstring64address

Webhook Example

SUCCESS

{
    "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]"
}

Description of Order Status

CodeDetails
COMPLETEDPayment success
CLOSEPayment close
TIMEOUTPayment cancel
FAILEDPayment failure
DELAY_SUCCESSOrder overtime and payment success
DELAY_FAILEDOrder overtime and payment failed