Create a Pay-in Instance
This endpoint allows you to create a new payment instance and receive a URL that can be used to launch the Tylt Prime Pay-In widget. Through the widget, the merchant's end customer can make a deposit or payment to the merchant using PIX. The payment is settled in USDT into the merchants wallet.
Endpoint
POST
https://api.tylt.money/v2/prime/BR/PIX/instance
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.
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.
Request Body
Field Name
Type
Description
isBuyTrade
number
Must be set to 1 for a Pay-In transaction.
userDetails
JSON Object
Custom fields associated with the user, supplied by the merchant. These fields are included in web-hook notifications and other API responses for easy reference and tracking. An empty object can be sent.
merchantOrderId
string
A UUID used by the merchant to reference this instance or any transaction related to it.
callBackUrl
string
The URL to which payment status updates are sent.
redirectUrl
string
The URL to redirect the user after completing the payment.
amount
number
Mandatory. This is the amount the user wants to deposit in USDT or BRL equivalent.
currencySymbol
string
Supported Currency is "USDT" or "BRL" only.
network
string
Only for Instant Channel: The network of the self-hosted wallet where the crypto will be settled. Accepted values: "ETH"
, "TRX"
, "AVAX"
, "TON"
, "SOL"
walletAddress
string
Only for Instant Channel: Please provide the public address of your self-hosted wallet where the crypto will be settled.
API Keys and Wallet / Network Configuration — Instant Channel Settlement: Please use the API Key associated with the designated wallet — PIX Instant Payin.
Before initiating settlements, kindly share the network and wallet address details in advance with the technical service team for whitelisting and template creation. This process typically takes 4–6 hours to complete. Network Fees & MDR — Instant Channel Settlement On Instant Settlement transactions, both MDR fees and network fees are automatically deducted from your PIX Instant Payin (Cross-Ramp) wallet balance, while the payment amount is transferred on-chain.
Example
If a payment of 165 BRL (≈ 30 USDT) is initiated:
On successful payment, 30 USDT is sent on-chain to the recipient.
The network fee (e.g., 1 USDT) and the MDR fee (e.g., 0.45 USDT) are debited from your wallet balance.
In this case, your wallet must hold enough balance to cover both the 1 USDT network fee and 0.45 USDT MDR fee at the time of creation.
Wallet Balance Requirement
A minimum balance of 50 USDT must be maintained in your PIX Instant Payin (Cross-Ramp) wallet to create a new payment link or transaction. Please ensure that the wallet remains sufficiently funded to cover on-chain gas costs and MDR fees, as these are deducted directly from your wallet balance for each transaction.
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
const requestBody = {
isBuyTrade: 1,
userDetails: {},
merchantOrderId: 'b73b73b-87wtbc-q36gbc-331n3',
callBackUrl: 'https://www.test.com/callback',
redirectUrl: 'https://www.test.com/callback',
amount: 10.00,
currencySybmol: 'BRL',
// Required only for PIX Instant Payin Channel:
walletAddress: "0xd2AF4B117EfE474B66Fc79E6A8E1938D41a60F4c", // Public address of self-hosted wallet for crypto settlement
network:"ETH" // Network of the self-hosted wallet — accepted values: "ETH", "TRX", "AVAX", "TON", "SOL"
};
// 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 = {
"X-TLP-APIKEY": apiKey,
"X-TLP-SIGNATURE": signature
};
// Send the request
axios.post('https://api.tylt.money/p2pRampsMerchant/createInstance', raw, { headers })
.then(response => console.log("Success:", response.data))
.catch(error => console.error("Error:", error));
Response
{
"msg": "Instance created successfully",
"data": {
"url": "https://app.tylt.money/prime-brl/d0f6cc25-e8f8-11ef-830e-02d8461243e9",
"instanceId": "d0f6cc25-e8f8-11ef-830e-02d8461243e9",
"tradeId": 10432
}
}
Last updated