Create an Internal Transfer Request
Name
Type
Example
Description
import axios from "axios";
import crypto from "crypto";
const apiKey = "your-api-key";
const apiSecret = "your-api-secret";
function createSignature(apiSecret, bodyString) {
return crypto
.createHmac("sha256", apiSecret)
.update(bodyString)
.digest("hex");
}
const transferMerchantBalanceData = {
fromUUID: "ybht35h-2a33-11f0-b2d9-42010a28011c",
toUUID: "bkhe4tt-33cc-11f0-b2d9-42010a28011c",
settledAmount: 2,
settledCurrency: "USDT",
comments: "",
};
try {
const signature = createSignature(
apiSecret,
JSON.stringify(transferMerchantBalanceData),
);
console.log("Generated signature: ", signature);
const apiDomain = "https://api.tylt.money/transactions/merchant";
const res1 = await axios.request({
method: "POST",
url: `${apiDomain}/transferMerchantBalance`,
headers: {
"Content-Type": "application/json",
"X-TLP-APIKEY": apiKey,
"X-TLP-SIGNATURE": signature,
},
data: transferMerchantBalanceData,
});
console.log(`Response: ${JSON.stringify(res1.data)}`);
} catch (error) {
console.log(error);
}Last updated