Getting Started
#
Get API CredentialsGo to: Developers → Settings → API Keys → Generate API Key
Please save the API keys securely. It will be masked after you generate the keys.
#
API Protocol Rules and Requests HeaderFor security purposes, please follow the protocol rules and steps to create your API requests.
Rule | Description |
---|---|
Protocol | Use HTTPS for secure transactions |
Content-Type | application/json |
Character Encoding | UTF-8 |
Signature Algorithm | HMAC-SHA512 |
Endpoint | https://bpay.binanceapi.com |
Rule
Protocol
Description
Use HTTPS for secure transactions
Rule
Content-Type
Description
application/json
Rule
Character Encoding
Description
UTF-8
Rule
Signature Algorithm
Description
HMAC-SHA512
Rule
Endpoint
Description
https://bpay.binanceapi.com
Please save the API keys securely. It will be masked after you generate the keys.
#
Request HeaderRule | Type | Required | Description |
---|---|---|---|
content-type | string | Y | application/json |
BinancePay-Timestamp | long | Y | UnixTimestamp in milliseconds that the requ... |
BinancePay-Nonce | string | Y | A random string generated by merchants. M... |
BinancePay-Certificate-SN | string | Y | API Key generated in Binance Merchant Admin Portal |
BinancePay-Signature | string | Y | API Signature. Please see the next step for ... |
Rule
content-type
Type
string
Required
Y
Description
application/json
Rule
BinancePay-Timestamp
Type
long
Required
Y
Description
UnixTimestamp in milliseconds that the requests send, guarantee the machine time is sync with the network
Rule
BinancePay-Nonce
Type
string
Required
Y
Description
A random string generated by merchants. Must be 32 characters. e.g.5RhaTrZPhknNv0kDSA2UQ67cPMVNS4sA
Rule
BinancePay-Certificate-SN
Type
string
Required
Y
Description
API Key generated in Binance Merchant Admin Portal
Rule
BinancePay-Signature
Type
string
Required
Y
Description
API Signature. Please see the next step for how to generate
#
How to Generate API SignatureStep 1. Build the content
String payload=timestamp+" \n"+nonce+" \n"+body+" \n";
Step 2. Sign the content
String signature = hex(hmac("sha512", payload, secretKey)).toUpperCase();