Skip to main content

Create Order (Deprecated)

The API is deprecated, please migrate to Create Order V2 ASAP

Create order API used for merchant/partner to initiate acquiring order.

EndPoint#

POST /binancepay/openapi/order

Request Parameters#

AttributesTypeRequiredLimitationDescription
subMerchantIdstringNmaximum length 19The sub merchant account id, issued when sub merchant been created at Binance, The parameter subMerchantId is required when configuring show subMerchant info.
merchantTradeNostringYletter or digit, no other symbol allowed, maximum length 32The order id, Unique identifier for the request
tradeTypestringY"WEB", "APP", "WAP", "MINI_PROGRAM", "PAYMENT_LINK", "OTHERS"operate entrance
totalFeedecimalYAmount Range: 0.01 - 20000; Max Unit Range: 8 decimal placesorder amount
currencystringYonly "BUSD","USDT","MBOX" can be accepted, fiat NOT supported.order currency
productTypestringNmaximum length 16product type
productNamestringNmaximum length 256product name
productDetailstringNmaximum length 256product detail
returnUrlstringNmaximum length 256The URL to redirect to when the payment is successful
cancelUrlstringNmaximum length 256The URL to redirect to when payment is failed
orderExpireTimelongNmaximum order time is 1 hourOrderExpireTime is the time at which order will expire. Please input orderExpireTime in Epoch timestamp in milliseconds. If not specified, order time will be 1 hour
supportPayCurrencystringNmaximum length 1024. Input to be separated by commas, e.g. "BUSD,BNB"SupportPayCurrency determines the currencies that a customer is allowed to use to pay for the order. If not specified, all Binance Pay supported currencies will be allowed.
universalUrlAttachstringNmaximum length 120. e.g. "countryCode=1&phone=1234567"the attachment parameter for the response field "universalUrl"
passThroughInfostringNmaximum length 512pass through info, returned as-is in query order API and payment webhook notification
webhookUrlstringNmaximum length 256. Can only start with http or https.The URL for order notification. If the webhookUrl is passed in the parameter, the webhook url configured on the merchant platform will not take effect, and the currently passed url will be called back first.

Sample Request Body#

{  "subMerchantId": "98765987",  "merchantTradeNo": "9825382937292",  "totalFee": 25.17,  "productDetail": "Greentea ice cream cone",  "currency": "USDT",  "returnUrl": "",  "cancelUrl": "",  "tradeType": "APP",  "productType": "Food",  "productName": "Ice Cream"}

Response Parameters#

AttributesTypeRequiredLimitationDescription
statusstringY"SUCCESS" or "FAIL"status of the API request
codestringY-request result code, refer to
dataOrderResultN-response body, refer to
errorMessagestringNmaximum length 256

Child Attribute#

OrderResult#

AttributesTypeRequiredLimitationDescription
prepayIdstringYmaximum length 19unique id generated by binance
tradeTypestringY"WEB", "APP", "WAP", "MINI_PROGRAM", "PAYMENT_LINK", "OTHERS"operate entrance
expireTimelongY-expire time in milli seconds
qrcodeLinkstringYmaximum length 256qr code img link
qrContentstringYmaximum length 256qr content info
checkoutUrlstringYmaximum length 256binance hosted checkout page url
deeplinkstringYmaximum length 256deeplink to open binance app to finish payment
universalUrlstringYmaximum length 512universal url to finish the payment

Sample Response#

{  "status": "SUCCESS",  "code": "000000",  "data": {    "prepayId": "29383937493038367292",    "tradeType": "APP",    "expireTime": 121123232223,    "qrcodeLink": "https://qrservice.dev.com/en/qr/dplkb005181944f84b84aba2430e1177012b.jpg",    "qrContent": "https://qrservice.dev.com/en/qr/dplk12121112b",    "checkoutUrl": "https://pay.binance.com/checkout/dplk12121112b",    "deeplink": "bnc://app.binance.com/payment/secpay/xxxxxx",    "universalUrl": "https://app.binance.com/payment/secpay?_dp=xxx=&linkToken=xxx"  },  "errorMessage": ""}

Result Code#

NameCodeReasonSolution
UNKNOWN_ERROR400000An unknown error occurred while processing the request.Try again later
INVALID_REQUEST400001Parameter format is wrong or parameter transferring doesn't follow the rules.Please check whether the parameters are correct.
INVALID_SIGNATURE400002Incorrect signature resultCheck whether the signature parameter and method comply with signature algorithm requirements.
INVALID_TIMESTAMP400003Timestamp for this request is outside of the time window.Sync server clock
INVALID_API_KEY_OR_IP400004API identity key not found or invalid.Check API identity key
BAD_API_KEY_FMT400005API identity key format invalid.Check API identity key.
BAD_HTTP_METHOD400006Request method not supported.Check Request method.
MEDIA_TYPE_NOT_SUPPORTED400007Media type not supported.Check Request Media type.
INVALID_REQUEST_BODY400008Request body is not a valid json object.Check Request body
MANDATORY_PARAM_EMPTY_OR_MALFORMED400100A parameter was missing/empty/null, or malformed.
INVALID_PARAM_WRONG_LENGTH400101A parameter was not valid, was empty/null, or too long/short, or wrong format.
INVALID_PARAM_WRONG_VALUE400102A parameter was not valid, the value is out of range.
INVALID_PARAM_ILLEGAL_CHAR400103A parameter was not valid, contains illegal characters
INVALID_REQUEST_TOO_LARGE400104Invalid request, content length too large
INVALID_MERCHANT_TRADE_NO400201merchantTradeNo is invalid or duplicated
INVALID_ACCOUNT_STATUS400203Not support for this account, please check account status.
SUB_MERCHANT_INVALID400206The sub merchant does not exist or is in an unavailable state.