Skip to main content

Getting Started

Get API Credentials#

Go to: Developers → API → API Keys → Generate API Key

Give your API key a name, and select the type of access for the API keys. For added security, you may add your trusted IP from which the API will be called from. Once done click “submit and the API key and secret will be shown on the page.

Please save the API key and secret immediately and securely, as the key will be masked shortly and a hashed information will be shown instead.

Please save the API keys securely. It will be masked after you generate the keys.

API Protocol Rules and Requests Header#

For security purposes, please follow the protocol rules and steps to create your API requests.

RuleDescription
ProtocolUse HTTPS for secure transactions
Content-Typeapplication/json
Character EncodingUTF-8
Signature AlgorithmHMAC-SHA512
Endpointhttps://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 Header#

RuleTypeRequiredDescription
content-typestringYapplication/json
BinancePay-TimestamplongYUnixTimestamp in milliseconds that the requ...
BinancePay-NoncestringYA random string generated by merchants. M...
BinancePay-Certificate-SNstringYAPI Key generated in Binance Merchant Admin Portal
BinancePay-SignaturestringYAPI 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 Signature#

Step 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();