Skip to main content

Create Order

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

EndPoint#

POST /binancepay/openapi/order

Request Parameters#

AttributesTypeRequiredLimitationDescription
merchantIdlongN-The merchant account id, issued when merchant been created at Binance.
subMerchantIdlongN-The 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"operate entrance
totalFeedecimalYminimum unit: 0.01, minimum equivalent value: 0.5 USDorder amount
currencystringYonly crypto token accepted, fiat NOT supported.order currency, e.g. "BUSD"
productTypestringYmaximum length 16product type
productNamestringYmaximum length 256product name
productDetailstringNmaximum length 256product detail
returnUrlstringNmaximum length 256redirect url

Sample Request Body#

{  "merchantId": "98765987",  "subMerchantId": "98765987",  "merchantTradeNo": "9825382937292",  "totalFee": 25.17,  "productDetail": "Greentea ice cream cone",  "currency": "EUR",  "returnUrl": "",  "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
dataOrderResultY-response body, refer to
errorMessagestringY-

Child Attribute#

OrderResult#

AttributesTypeRequiredLimitationDescription
prepayIdstringY-unique id generated by binance
tradeTypestringY"WEB", "APP"operate entrance
expireTimelongY-expire time in milli seconds
qrcodeLinkstringY-qr code img link
qrContentstringY-qr contend info

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"  },  "errorMessage": ""}

Result Code#

NameCodeReasonSolution
UNKNOW_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.
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
ORDER_NOT_FOUND400202Order not found.
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.