Get Account Balance / Holdings

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

GEThttps://api.tylt.money/transactions/merchant/getAccountBalance

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.

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';

// 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);
  });

Response

{
    "data": [
        {
            "currencySymbol": "USDT",
            "balance": 12.0579
        },
        {
            "currencySymbol": "DAI",
            "balance": 0.99
        }
    ],
    "errorCode": 0,
    "msg": ""
}

Last updated