Signature string is mandatory to ensure the request was sent from your server
Overview
The signature generation process involves creating a unique cryptographic hash value based on payout parameters and your merchant private key to ensure data integrity and authenticity.
Process
Generate signature when you are creating a new payout.
- Construct String: Concatenate the necessary parameters into a single string before applying the hash function. The parameters typically include:
Items | Description |
---|---|
order_id | Your internally created order_id |
order_amount | The order_amount you passed for this payment |
is_order_usd | The is_order_usd value you passed for this payment |
token_id | Token ID you passed for this payment |
receiver | Receiver wallet address |
merchant_private | Your private key. |
- Apply Hash Function: Use a secure hashing algorithm such as SHA-256 to calculate the hash value of the before-hash string.
- Pass the signature variable along with other parameters to the 'New Payout' endpoint.
//Request Body
const payout = {
//Your payout request body
};
//YOUR MERCHANT KEY
const merchantPrivate = process.env.PRIVATE_KEY;
//Concat payout parameters
const payload = payout.order_id + Number(payout.order_amount) + payout.is_order_usd + payout.token_id + payout.receiver + merchantPrivate;
// Generate SHA-256 hash of the JSON body
const signature = createHash('sha256').update(payload).digest('hex'); //hex digest
// Add signature to payout object
payout.signature = signature;
//Perform Create new payout API call with payout object