Skip to main content

Binance Pay: Order Notification

Webhook Endpoints

Binance Pay will send order events with final status to partner for notification. You will be able to configure webhook endpoints via the Binance Merchant Admin Portal. Result of the orders that are close will be notified to you through this webhook with bizStatus = "PAY_CLOSED".*

*If you don't want to receive "PAY_CLOSED" notifications anymore, you can login MMP and select Developer menu -> Notification to turn it off.

In situation where event was failed to send, the webhook will retry up to 6 times to resend the event.

Request Parameters

AttributesTypeRequiredLimitationDescription
bizTypestringY-"PAY"
bizIdlongY-Prepay order id
bizIdStrstringY-biz id as string
bizStatusstringY-"PAY_SUCCESS","PAY_CLOSED"
datastringY-JSON string, data details refer to

Child Attribute

Notification Data

AttributesTypeRequiredLimitationDescription
merchantTradeNostringYletter or digit, no other symbol allowedThe order id, Unique identifier for the request
productTypestringYmaximum length 16product type
productNamestringYmaximum length 256product name
transactTimelongY-transaction time
tradeTypestringY"WEB", "APP", "WAP", "MINI_PROGRAM", "PAYMENT_LINK", "OTHERS"operate entrance
totalFeedecimalY-order amount
currencystringY-order currency
transactionIdstringN-debit transaction id
openUserIdstringN-payer unique id
passThroughInfostringN-pass through info, from the create order api
commissiondecimalY-Transaction fees charged. Please refer to your contract for more info
paymentInfoobjectN-payment information, refer to

PaymentInfo Data

AttributesTypeRequiredLimitationDescription
payMethodstringY-pay method
paymentInstructionslist[PaymentInstruction]Y-payment instruction list, refer to
channelstringN-channel
subChannelstringN-sub channel
payerDetailstringN-encrypted payer identity information for merchant compliance purposes without compromising privacy and security. Decryption instructions please refer to.
This function is only available for whitelisted merchants.

PaymentInstruction Data

AttributesTypeRequiredLimitationDescription
currencystringY-payment currency
amountdecimalY-currency amount
pricedecimalY-currency price

Sample Payload

PAY SUCCESS

{
"bizType": "PAY",
"data": "{\"merchantTradeNo\":\"xr6wYe8ATWE6thS5Sc7ezMihMFGKn6\",\"productType\":\"Food\",\"productName\":\"Ice Cream\",\"transactTime\":1619508939664,\"tradeType\":\"APP\",\"totalFee\":0.88000000,\"currency\":\"USDT\",\"transactionId\":\"M_R_282737362839373\",\"openUserId\":\"1211HS10K81f4273ac031\",\"commission\":0.0088,\"paymentInfo\":{\"payMethod\":\"funding\",\"paymentInstructions\":[{\"currency\":\"USDT\",\"amount\":0.88000000,\"price\":1}],\"channel\":\"DEFAULT\"}}",
"bizIdStr": "29383937493038367292",
"bizId": 29383937493038367292,
"bizStatus": "PAY_SUCCESS"
}

PAY FAIL

{
"bizType": "PAY",
"data": "{\"merchantTradeNo\":\"9825382937292\",\"totalFee\":0.88000000,\"transactTime\":1619508939664,\"currency\":\"USDT\",\"openUserId\":\"1211HS10K81f4273ac031\",\"productType\":\"Food\",\"productName\":\"Ice Cream\",\"tradeType\":\"WEB\"}",
"bizIdStr": "29383937493038367292",
"bizId": 29383937493038367292,
"bizStatus": "PAY_FAIL"
}

Response Parameters

AttributesTypeRequiredLimitationDescription
returnCodestringY"SUCCESS" or "FAIL"result code of notification processing, if process fail, Binance Pay will retry
returnMessagestringN-return message

Sample Response

After receiving a webhook with your endpoint, please respond with an HTTP 200 OK.

{"returnCode":"SUCCESS","returnMessage":null}