This endpoint allows you to retrieve the account balance/ holdings for your merchant account. It provides essential information regarding the quantity of crypto tokens available, which can be critical for managing transactions and ensuring you have sufficient balance for processing payments.
Endpoint
GET
https://api.tylt.money/transactions/merchant/getAccountBalance
Request Headers
Code Snippet
Node JS Python JavaScript
Copy 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';
// Create query parameters (if any)
const queryParams = '';
// Create the HMAC SHA-256 signature
const signature = crypto
.createHmac('sha256', apiSecret)
.update(queryParams)
.digest('hex');
// Define headers
const headers = {
"X-TLP-APIKEY": apiKey,
"X-TLP-SIGNATURE": signature
};
// Send the GET request
axios.get("https://api.tylt.money/transactions/merchant/getAccountBalance", { headers })
.then(response => {
console.log("Response:", response.data);
})
.catch(error => {
console.error('Error:', error.response ? error.response.data : error.message);
});
Copy import requests
import json
import hmac
import hashlib
# Replace with your API Key and Secret
api_key = 'your-api-key'
api_secret = 'your-api-secret'
# Create query parameters (if any)
query_params = ''
# Create the HMAC SHA-256 signature
signature = hmac.new(api_secret.encode(), query_params.encode(), hashlib.sha256).hexdigest()
# Define headers
headers = {
"X-TLP-APIKEY": api_key,
"X-TLP-SIGNATURE": signature
}
# Send the GET request
response = requests.get("https://api.tylt.money/transactions/merchant/getAccountBalance", headers=headers)
# Print the response
if response.status_code == 200:
print("Response:", response.json())
else:
print(f"Failed with status code {response.status_code}: {response.text}")
Copy const crypto = require('crypto');
// Replace with your API Key and Secret
const apiKey = 'your-api-key';
const apiSecret = 'your-api-secret';
// Create query parameters (if any)
const queryParams = '';
// Create the HMAC SHA-256 signature
const signature = crypto
.createHmac('sha256', apiSecret)
.update(queryParams)
.digest('hex');
// Define headers
const headers = {
"X-TLP-APIKEY": apiKey,
"X-TLP-SIGNATURE": signature
};
// Send the GET request
fetch("https://api.tylt.money/transactions/merchant/getAccountBalance", { headers })
.then(response => response.json())
.then(data => console.log("Response:", data))
.catch(error => console.error('Error:', error));
Response
200 Response Fields
Copy {
"data": [
{
"currencySymbol": "USDT",
"balance": 12.0579
},
{
"currencySymbol": "DAI",
"balance": 0.99
}
],
"errorCode": 0,
"msg": ""
}
The symbol representing the cryptocurrency (e.g., DAI, USDT). Use this as input in other API requests.
Last updated 5 months ago