Get Custom Conversion Rate History
This endpoint retrieves the custom crypto-to-FX rate configured by the merchant
Endpoint
GET
https://api.tylt.money/transactions/merchant/gerRateHistory?fromCurrencySymbol={fromCurrencySymbol}&toCurrencySymbol={toCurrencySymbol}
Endpoint Example
GET
https://api.tylt.money/transactions/merchant/gerRateHistory?fromCurrencySymbol=INR&toCurrencySymbol=USDT
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.
Code Snippet
import axios from "axios";
import crypto from "crypto";
const apiKey = "your-api-key";
const apiSecret = "your-api-secret";
const data = {
fromCurrencySymbol: "INR", // optional
toCurrencySymbol: "USDT", // optional
};
/*
If you pass both, it gives 10 most recent rates with fromCurrencySymbol and toCurrencySymbol
If you pass one, it gives 10 most recent rates with that fromCurrencySymbol or toCurrencySymbol, whichever one is passed
If you pass none, it gives 10 most recent rates irrespective of currencySymbol
If you pass either the fromCurrencySymbol or the toCurrencySymbol, remember -
fromCurrencySymbol can only be of currenctType 'fiat'
toCurrencySymbol can only be of currenctType 'crypto'
currencyType of a currency can be checked here -
https://docs.tylt.money/tylt-cpg-crypto-payment-gateway/api-reference/supporting-apis/supported-base-currency-list
For your reference -
fromCurrencySymbol can be 'INR' and other fiat currencies
toCurrencySymbol can be 'USDT' and other crypto currencies
*/
const queryString = new URLSearchParams(data).toString();
const signaturePayload = JSON.stringify(data);
const signature = crypto
.createHmac("sha256", apiSecret)
.update(signaturePayload)
.digest("hex");
const url = `https://api.tylt.money/transactions/merchant/getRateHistory?${queryString}`;
const config = {
method: "get",
url: url,
headers: {
"X-TLP-APIKEY": apiKey,
"X-TLP-SIGNATURE": signature,
},
};
axios
.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.error(error);
});
Response
{
"data": [
{
"fromCurrencySymbol": "INR",
"toCurrencySymbol": "USDT",
"rate": "90.000000000000000000000000000000",
"createdAt": "2025-08-04T12:18:07Z",
"isReciprocal": 0
}
],
"errorCode": 0,
"msg": "Rate history fetched successfully"
}
Last updated