跳到主要内容

Webhook

Request Headers

FieldTypeRemarks
X-BN-Connect-Timestamptimestamptimestamp
X-BN-Connect-SignaturestringSHA256withRSA(requestBody + X-Connect-Timestamp)
X-BN-Connect-ForstringSame with your client id (X-Tesla-ClientId)

Request Body

FieldTypeRemarks
externalOrderIdstringThe unique order id from the partner side.
typeint1: buy, 3: send
statusintINIT(0)

ON_RAMP_PROCESSING(1)

ON_RAMP_COMPLETED(2)

WITHDRAW_INIT(10)

WITHDRAW_PROCESSING(11)

COMPLETED(20)

WITHDRAW_ABANDONED(96)

ON_RAMP_FAILED(97)

WITHDRAW_FAILED(98)

FAILED(99)
payMethodCodestringThe payment method code is from payment method list API
payMethodSubCodestringThe payment method sub code is from payment method list API
fiatCurrencystringfiat currency
cryptoCurrencystringcrypto currency
fiatAmountstringfiat amount
cryptoAmountstringcrypto amount
feeAmountstringfee amount
feeCurrencystringfee currency, USD or crypto
revenueAmountstringpartner revenue amount
revenueCurrencystringpartner revenue currency, USD or crypto
networkFeestringnetwork fee amount
withdrawWalletAddressstringwithdraw wallet address
withdrawNetworkstringwithdraw network
withdrawMemostringwithdraw network memo
withdrawTxHashstringwithdraw tx hash
orderDetailLinkstringorder detail link
orderTimetimestamporder time
completionTimetimestampcompletion time

Response Body

  • HTTP status code is 200
  • Response body is in JSON format.
FieldTypeRemarks
returnCodestringSUCCESS or other code you wish to return to Binance Connect
returnMessagestringthe message you wish to return to Binance Connect

How signature works

The webhook signature flow is as follows:

signature-Webhook.png

Verify signature

The example code below shows how to verify signature with public key:

public static boolean verify(String srcData, PublicKey publicKey, String sign) throws Exception {
Signature signature = Signature.getInstance("SHA256withRSA");
signature.initVerify(publicKey);
signature.update(srcData.getBytes());
return signature.verify(Base64.decodeBase64(sign.getBytes()));
}

Example

Request Body:

{
"externalOrderId": "180401941923045",
"type": 1,
"status": 2,
"payMethodCode": "BUY_P2P",
"payMethodSubCode": "BANK",
"fiatCurrency": "EUR",
"cryptoCurrency": "USDT",
"fiatAmount": "100",
"cryptoAmount": "107.8",
"feeAmount": "1",
"feeCurrency": "USDT",
"revenueAmount": "0.08",
"revenueCurrency": "USDT",
"networkFee": "0.5",
"withdrawWalletAddress": "0xbb4CdB98Bd36B01bD1cBaEA52De08d9173bc095c",
"withdrawNetwork": "BSC",
"withdrawMemo": "",
"withdrawTxHash": "0xcb163e2e6322cd6aa7bc4d45306029e846c0c06e9cdee45a06e88801d1231e71",
"orderDetailLink": "https://www.binance.com/en/my/wallet/exchange/buysell-history?type=buy",
"orderTime": 1723186761000,
"completionTime": 1723206761000
}