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
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.
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).