Binance Link › Crypto-As-A-Service (CAAS) › KYC SaaS › Getting Started
KYC Data should be sent in the Request Body in JSON format.
Convert the Request Body JSON to a JSON String
Use the HmacSHA256 algorithm to sign the JSON String, and assign the result to the
X-SHA2-Signature request header.
Sign the exact string you send. Serialize the JSON String compactly, with no extra whitespace,
and send that same string as the request body. Re-serializing or reformatting the JSON after
signing will invalidate the signature.
Examples
Request Body to be sent:
{
"bizEntityKey" : "<your_biz_entity_key>" ,
"entityCustomerId" : "<your_user_id>" ,
"kycType" : "USER" ,
"extra" : {},
"notifyUrl" : "<your_notify_url>"
}
Converted Request BODY to JSON String:
{
"bizEntityKey" : "<your_biz_entity_key>" ,
"entityCustomerId" : "<your_user_id>" ,
"kycType" : "USER" ,
"extra" : {},
"notifyUrl" : "<your_notify_url>"
}
Sign the JSON String (see below examples).
NodeJS Example
const crypto = require ( "crypto" );
const secret = "<your_secret_key>" ;
const postData = {
bizEntityKey: "<your_biz_entity_key>" , // entity key will be decided and given Binance team
entityCustomerId: "<your_user_id>" ,
kycType: "USER" ,
extra: {},
notifyUrl: "<your_notify_url>" ,
};
const hash = crypto. createHmac ( "sha256" , secret). update ( JSON . stringify (postData)). digest ( "hex" );
Java Example
import org.apache.commons.codec.binary.Hex;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
public class App {
public static void main ( String [] args ) throws Exception {
String rawString = "{ \" bizEntityKey \" : \" <your_biz_entity_key> \" , \" entityCustomerId \" : \" <your_user_id> \" , \" kycType \" : \" USER \" , \" extra \" : { }, \" notifyUrl \" : \" <your_notify_url> \" }" ;
Mac sha256Hmac = Mac. getInstance ( "HmacSHA256" );
SecretKeySpec secretKey = new SecretKeySpec ( "<your_secret_key>" . getBytes (), "HmacSHA256" );
sha256Hmac. init (secretKey);
String eventSignature = new String (Hex. encodeHex (sha256Hmac. doFinal (rawString. getBytes (StandardCharsets.UTF_8))));
System.err. println (eventSignature);
}
}
Python Example
import requests
import json
import hmac
import hashlib
body = {
"bizEntityKey" : "<your_biz_entity_key>" ,
"entityCustomerId" : "<your_user_id>" ,
"kycType" : "USER" ,
"extra" : {
},
"notifyUrl" : "<your_notify_url>"
}
api_secret = '<your_secret_key>' ##please replace with your own
json.dumps(body, separators = ( ',' , ':' )) #use this instead to remove extra spaces
signature = hmac.new(api_secret.encode(), json_str.encode(), hashlib.sha256).hexdigest()
Last modified on September 22, 2026