Creating a Payout Request

This resource allows users to submit cryptocurrency payouts to active recipients. It caters to various use cases such as offering cryptocurrency withdrawals to clients, facilitating payouts for marketplaces or affiliate networks, or managing payroll by creating multiple payouts at a time.

Endpoint

POSThttps://api.tylt.money/transactions/merchant/createPayoutRequest

Request Headers

Name
Type
Example
Description

X-TLP-APIKEY

string

93ee3c5e133697251b5362bcf9cc8532476785t8768075616f58d88

Your Tylt API Key, used to identify your account in API requests.

X-TLP-SIGNATURE

string

d0afef3853dfc8489c8b9affa5825171fdd7y7685675e4966a05f66ed2b3eaf9462b3c9c0

HMAC SHA-256 signature generated using the API Secret Key to secure the request.

When using the API, ensure to include your API Key and generate the signature for the request payload using your API Secret. The tables provided above contain example values for illustration purposes only. Please refer to the code snippets for detailed instructions on how to sign the request and generate the signature properly.

Request Body

Field Name

Type

Description

baseAmount

number

The amount of currency to be sent.

baseCurrency

string

Optional: To be used if the amount into crypto to be sent is expressed as FIAT. The baseCurrency symbol must be of the FIAT currency. Check supporting baseCurrency API for more details.

address

string

The recipient's address for the payout.

settledCurrency

string

The currency in which the payout will be made (symbol).

networkSymbol

string

The network to be used for the payout (e.g., BSC).

customerName

string

Optional: Customer's name for the transaction.

comments

string

Optional: Comments for additional context.

callBackUrl

string

Optional: URL for the callback after transaction completion.

redirectUrl

string

Optional: URL for the redirection after transaction completion.

Code Snippet

const axios = require('axios');
const crypto = require('crypto');

// Replace with your API Key and Secret
const apiKey = 'your-api-key';
const apiSecret = 'your-api-secret';

// Request body
// In this example we are sending USDT worth INR 10000 to the web3 address
const requestBody = {
    baseAmount: 10000,
    baseCurrency: "INR"
    address: "0xd2AF4B117EfE474B66Fc79E6A8E1938D41a60F4c",
    settledCurrency: "USDT",
    networkSymbol: "BSC",
    callBackUrl:"www.callback.com",
    redirectUrl:"www.redirect.com"
};

// Convert request body to JSON
const raw = JSON.stringify(requestBody);

// Function to create HMAC SHA-256 signature
const createSignature = (secret, data) => {
    return crypto.createHmac('sha256', secret)
                 .update(data)
                 .digest('hex');
};

// Generate signature
const signature = createSignature(apiSecret, raw);

// Define headers
const headers = {
    "Content-Type": "application/json",
    "X-TLP-APIKEY": apiKey,
    "X-TLP-SIGNATURE": signature
};

// Function to send the request
const sendRequest = async (url, headers, body) => {
    const response = await axios.post(url, body, { headers: headers });
    return response.data;
};

// Send the request
sendRequest("https://api.tylt.money/transactions/merchant/createPayoutRequest", headers, raw)
    .then(result => console.log("Success:", result))
    .catch(error => console.error("Error:", error));

Response

{
    "data": {
        "orderId": "1deecabb-79b8-11ef-8277-02d8461243e9",
        "merchantOrderId": "1deecabb-79b8-11ef-8277-02d8461243e9",
        "settledCurrency": "USDT",
        "settledAmountRequested": 0.1,
        "settledAmountDebited": 0,
        "settledAmountSent": 0,
        "commission": 0,
        "network": "BSC",
        "toAddress": "0xh22kbbq3hbth4bjwh433adgda",
        "status": "Pending",
        "insufficientBalance": 0,
        "paymentURL": "",
        "callBackURL": "",
        "transactions": [],
        "createdAt": "2024-09-23T14:28:35Z",
        "expiresAt": "2024-09-23T14:28:35Z",
        "updatedAt": "2024-09-23T14:28:35Z",
        "isFinal": 0,
        "isDebited": 0,
        "customerName": "",
        "comments": ""
    },
    "msg": "Withdrawal request accepted"
}

Last updated