Tylt: API Documentation
  • Introduction
    • Introduction
    • Getting Started
    • Generating API Keys
    • Signing API Payloads
    • Important Concepts
    • Merchant Verification
    • Tylt Prime (UPI to Crypto Solution)
      • API Reference
        • Create a Pay-in Instance
        • Create a Pay-out Instance
        • Webhook for Tylt Prime
        • Get Instance Information
        • Get Pay-In Transaction Information
        • Get Pay-Out Transaction Information
    • Tylt Prime (UPI to Crypto Solution - H2H)
      • API Reference ( Pay-In)
        • Create a Pay-in Instance
        • Buyer Confirms Payment
        • Webhook for Tylt Prime
        • Get Instance Details
        • Get Pay-In Transaction Information
        • Get List of Fiat Currency and Supported Payment Methods
        • Get List of Supported Crypto Currency for Settlement
        • Get Conversion Rates
  • Tylt CPG (Crypto Payment Gateway)
    • API Reference
      • Accept Crypto Payments
        • Creating a Pay-in Request
        • Get Pay-In Transaction History
        • Get Pay-In Transaction Information
      • Make Crypto Payouts
        • Creating a Payout Request
        • Get Pay-Out Transaction History
        • Get Pay-Out Transaction Information
      • Supporting API's
        • Get Supported Crypto Currencies List
        • Get Supported Fiat Currencies
        • Get Account Balance / Holdings
        • Get Supported Crypto Networks
        • Supported Base Currency List
      • Webhook
    • Use Cases
      • E-commerce Flow
      • Withdrawal Flow
Powered by GitBook
On this page
  1. Tylt CPG (Crypto Payment Gateway)
  2. API Reference
  3. Make Crypto Payouts

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));
import requests
import hmac
import hashlib
import json

# Replace with your API Key and Secret
api_key = 'your-api-key'
api_secret = 'your-api-secret'

# Request body
request_body = {
    "baseAmount": 10000,
    "baseCurrency": "INR"
    "address": "0xd2AF4B117EfE474B66Fc79E6A8E1938D41a60F4c",
    "settledCurrency": "USDT",
    "networkSymbol": "BSC",
    "callBackUrl":"www.callback.com",
    "redirectUrl":"www.redirect.com"
}

# Convert request body to JSON
raw = json.dumps(request_body, separators=(',', ':'), ensure_ascii=False)

# Function to create HMAC SHA-256 signature
def create_signature(secret, data):
    return hmac.new(secret.encode(), data.encode(), hashlib.sha256).hexdigest()

# Generate signature
signature = create_signature(api_secret, raw)

# Define headers
headers = {
    "Content-Type": "application/json",
    "X-TLP-APIKEY": api_key,
    "X-TLP-SIGNATURE": signature
}

# Send the request
response = requests.post("https://api.tylt.money/transactions/merchant/createPayoutRequest", headers=headers, data=raw)

# Print the response
print("Success:", response.json())

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"
}

Field Name

Type

Description

orderId

String

The order ID generated by TL Pay, used as a global identifier.

merchantOrderId

String

The merchant's local order ID for reference (optional).

settledCurrency

String

The cryptocurrency or token used for payout.

settledAmountRequested

Number

The amount of cryptocurrency or token requested to be paid out.

settledAmountDebited

Number

The amount of cryptocurrency debited from your merchant balance.

settledAmountSent

Number

The total amount of cryptocurrency sent to the recipient.

commission

Number

The commission deducted from the payout transaction.

network

String

The blockchain network over which the payout is made (e.g., "BSC").

toAddress

String

The recipient's wallet address where the payout will be sent.

status

String

The status of the payout (e.g., "Pending", "Completed", "Failed").

insufficientBalance

Number

Indicates if there is insufficient balance for the transaction (1 = Yes, 0 = No).

paymentURL

String

The URL where the customer can make the payment (if applicable).

callBackURL

String

The callback URL specified by the merchant (optional).

transactions

Array

Details of any individual transactions linked to this payout (if applicable).

createdAt

String

The timestamp when the payout request was created.

expiresAt

String

The timestamp when the payout request will expire.

updatedAt

String

The timestamp when the payout request was last updated.

isFinal

Number

Indicates if the transaction is final (1 for completed, 0 for pending).

isDebited

Number

Indicates if the payout amount has been debited from your merchant account.

customerName

String

The name of the customer associated with the transaction (optional).

comments

String

Any comments or notes provided by the merchant (optional).

PreviousMake Crypto PayoutsNextGet Pay-Out Transaction History

Last updated 2 months ago