This endpoint allows you to create a new payment link and receive a URL that can be used to complete the accept a crypto payment from your customer. By sending a request to this endpoint with the required parameters, you can generate a payment link for a specific amount and configure various payment options.
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
merchantOrderId
string
The order ID provided by the Merchant for local reference.
baseAmount
number
The amount to be paid.
baseCurrency
string
The base currency of the good/service being supplied.
settledCurrency
string
The currency in which the payment is to be made.
networkSymbol
string
The network symbol for the transaction (e.g., BSC).
callBackUrl
string
URL for the callback after transaction completion.
customerName
string
Optional: Customer's name for the transaction.
comments
string
Optional: Comments for additional context.
Code Snippet
constaxios=require('axios');constcrypto=require('crypto');// Replace with your API Key and SecretconstapiKey='your-api-key';constapiSecret='your-api-secret';// Request bodyconstrequestBody= { merchantOrderId:'b73b73b-87wtbc-q36gbc-331n3', baseAmount:'1', baseCurrency:'USDT', settledCurrency:'USDT', networkSymbol:'BSC', callBackUrl:'https://www.test.com/callback', customerName:'TradingLeagues', comments:'Description testing'};// Convert request body to JSONconstraw=JSON.stringify(requestBody);// Function to create HMAC SHA-256 signatureconstcreateSignature= (secret, data) => {returncrypto.createHmac('sha256', secret).update(data).digest('hex');};// Generate signatureconstsignature=createSignature(apiSecret, raw);// Define headersconstheaders= {"X-TLP-APIKEY": apiKey,"X-TLP-SIGNATURE": signature};// Send the requestaxios.post('https://api.tylt.money/transactions/merchant/createPayinRequest', raw, { headers }).then(response =>console.log("Success:",response.data)).catch(error =>console.error("Error:", error));
import requestsimport hmacimport hashlibimport json# Replace with your API Key and Secretapi_key ='your-api-key'api_secret ='your-api-secret'# Request bodyrequest_body ={"merchantOrderId":"b73b73b-87wtbc-q36gbc-331n3","baseAmount":"1","baseCurrency":"USDT","settledCurrency":"USDT","networkSymbol":"BSC","callBackUrl":"https://www.test.com/callback","customerName":"TradingLeagues","comments":"Description testing"}# Convert request body to JSONraw = json.dumps(request_body)# Function to create HMAC SHA-256 signaturedefcreate_signature(secret,data):return hmac.new(secret.encode(), data.encode(), hashlib.sha256).hexdigest()# Generate signaturesignature =create_signature(api_secret, raw)# Define headersheaders ={"Content-Type":"application/json","X-TLP-APIKEY": api_key,"X-TLP-SIGNATURE": signature}# Send the requestresponse = requests.post('https://api.tylt.money/transactions/merchant/createPayinRequest', headers=headers, data=raw)print("Response:", response.json())
constfetch=require('node-fetch');constcrypto=require('crypto');// Replace with your API Key and SecretconstapiKey='your-api-key';constapiSecret='your-api-secret';// Request bodyconstrequestBody= { merchantOrderId:'b73b73b-87wtbc-q36gbc-331n3', baseAmount:'1', baseCurrency:'USDT', settledCurrency:'USDT', networkSymbol:'BSC', callBackUrl:'https://www.test.com/callback', customerName:'TradingLeagues', comments:'Description testing'};// Convert request body to JSONconstraw=JSON.stringify(requestBody);// Function to create HMAC SHA-256 signatureconstcreateSignature= (secret, data) => {returncrypto.createHmac('sha256', secret).update(data).digest('hex');};// Generate signatureconstsignature=createSignature(apiSecret, raw);// Define headersconstheaders= {"Content-Type":"application/json","X-TLP-APIKEY": apiKey,"X-TLP-SIGNATURE": signature};// Function to send the requestconstsendRequest=async (url, headers, body) => {constresponse=awaitfetch(url, { method:'POST', headers: headers, body: body, });returnresponse.json();};// Send the requestsendRequest('https://api.tylt.money/transactions/merchant/createPayinRequest', headers, raw).then(result =>console.log("Success:", result)).catch(error =>console.error("Error:", error));
The order ID provided by the Merchant at the time of request.
baseAmount
number
The value of the good/service being supplied expressed in the baseCurrency
baseCurrency
string
The base currency of the good/service. (symbol)
settledCurrency
string
The crypto currency in which the payment is to be made by the customer. (symbol)
settledAmountRequested
number
The amount of crypto currency requested from the customer.
settledAmountReceived
number
The amount of crypto currency received from the customer.
settledAmountCredited
number
The amount of crypto currency credited to your balance.
commission
number
The commission deducted for the transaction.
network
string
The crypto network used for the payment.
depositAddress
string
The address where the payment should be sent by the customer.
status
string
The status of the transaction (e.g., Pending, Completed).
paymentURL
string
The URL for the customer to make the payment.
callBackURL
string
The URL for callback notifications.
transactions
array
Details of the transactions associated with the payment.
createdAt
string
The timestamp when the request was created.
expiresAt
string
The timestamp when the request expires.
updatedAt
string
The timestamp when the request was last updated.
isFinal
number
Indicates if the transaction is completed (1) or pending (0).
isCredited
number
Indicates if the payment has been credited (1) or not (0).
customerName
string
The name of the customer making the payment.
comments
string
Additional comments provided during the request.
Understanding BaseCurrency and SettledCurrency in Pay-In Requests
The baseCurrency represents the currency in which the merchant expects to receive the payment, while the settledCurrency refers to the currency in which the transaction is processed and settled.
Example 1:
A merchant sells a pair of shoes on an e-commerce website, priced at $100. The merchant accepts payments in cryptocurrency, and the customer chooses to pay using DAI.
baseCurrency: USD (the currency the merchant prices the shoes in)
settledCurrency: DAI (on Binance Smart Chain or another supported network)
In this case, the merchant expects $100 in USD, but the transaction will be processed in DAI on the BSC network. The merchant will receive the equivalent amount of DAI, calculated automatically by Tylt based on real-time spot rates at the time of the transaction request.
Example 2:
The baseCurrency doesn't have to be a fiat currency (USD, GBP, EUR, etc.). It can also be a cryptocurrency.
For instance, a merchant providing consulting services charges $100 in USDT.
If the customer chooses to pay in USDT, both the baseCurrency and settledCurrency will be USDT.
If the customer opts to pay in DAI, the baseCurrency will be USDT, and the settledCurrency will be DAI.
This scenario shows that both the baseCurrency and settledCurrency can be cryptocurrencies, and Tylt will handle the correct conversion at the moment of the transaction using real-time rates.
Important Notes:
The baseCurrency can be either a supported fiat or cryptocurrency. The settledCurrency will always be a cryptocurrency.