Signature

The "Signature" header is a body converted from JSON to a string and then HMAC SHA256 signed with a private key.

Example

const crypto = require('crypto');

function createHmacSha256(data, secretKey) {
    const queryString = Object.keys(data)
        .map(key => `${key}=${data[key]}`)
        .join('&');
        
    const signature = crypto
        .createHmac('sha256', secretKey)
        .update(queryString)
        .digest('hex');
        
    return signature;
}

const body = { uniq_id: "0sv0c0c02da105aa6b7fbzf1zv05444d8a0ccd4c" };
console.log(createHmacSha256(body, "Your Private Key"));

Last updated