Tylt: API Documentation
  • Introduction
    • Introduction
    • Getting Started
    • Generating API Keys
    • Signing API Payloads
    • Important Concepts
    • Merchant Verification
    • Tylt Prime (UPI to Crypto Solution)
      • API Reference
        • Create a Pay-in Instance
        • Create a Pay-out Instance
        • Webhook for Tylt Prime
        • Get Instance Information
        • Get Pay-In Transaction Information
        • Get Pay-Out Transaction Information
    • Tylt Prime (UPI to Crypto Solution - H2H)
      • API Reference ( Pay-In)
        • Create a Pay-in Instance
        • Buyer Confirms Payment
        • Webhook for Tylt Prime
        • Get Instance Details
        • Get Pay-In Transaction Information
        • Get List of Fiat Currency and Supported Payment Methods
        • Get List of Supported Crypto Currency for Settlement
        • Get Conversion Rates
  • Tylt CPG (Crypto Payment Gateway)
    • API Reference
      • Accept Crypto Payments
        • Creating a Pay-in Request
        • Get Pay-In Transaction History
        • Get Pay-In Transaction Information
      • Make Crypto Payouts
        • Creating a Payout Request
        • Get Pay-Out Transaction History
        • Get Pay-Out Transaction Information
      • Supporting API's
        • Get Supported Crypto Currencies List
        • Get Supported Fiat Currencies
        • Get Account Balance / Holdings
        • Get Supported Crypto Networks
        • Supported Base Currency List
      • Webhook
    • Use Cases
      • E-commerce Flow
      • Withdrawal Flow
Powered by GitBook
On this page
  1. Introduction
  2. Tylt Prime (UPI to Crypto Solution)
  3. API Reference

Create a Pay-out 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-Out widget. Through the widget, the merchant's end customer can make a withdrawal or payout from the merchants website / application. The end customer will receive the payout in INR using UPI and the merchant wallet will be debited in USDT.

Endpoint

POSThttps://api.tylt.money/p2pRampsMerchant/createInstance

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.

Request Body

Field Name

Type

Description

isBuyTrade

number

Must be set to 0 for a Pay-Out transaction.

userDetails

string

Custom fields associated with the user, supplied by the merchant. These fields are included in webhook notifications and other API responses for easy reference and tracking. An empty object can be sent.

amount

string

The amount to be paid out in USDT equivalent.

currencySymbol

string

Supported Currency is "USDT" or "INR" only.

userEmail

string

Non-mandatory. If the merchant wants to share the user email id they can use this field. If this field is empty, the user will have to provide the email or SSO login during the payment flow.

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.

Flow Modularity

Merchants have the flexibility to enable or disable the following modules within the customer flow:

  1. User Email Sign-in:

    • The system requires an email for user identification.

    • Merchants can provide the email by passing it in the userEmail field within the request body.

    • Alternatively, if the merchant prefers the user to enter their email during the payment process, this field can be left empty.

  2. KYC Bypass:

    • KYC Bypass is not available for payouts.

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: 0,
    userDetails: {},
    amount: 10,
    currencySymbol: "USDT",
    merchantOrderId: "c84c84c-87wtbc-q36gbc-331n3",
    callBackUrl: "https://www.test.com/callback",
    redirectUrl: "https://www.test.com/callback"
};

// 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 = {
    "Content-Type": "application/json",
    "X-TLP-APIKEY": apiKey,
    "X-TLP-SIGNATURE": signature
};

// Function to send the request
const sendRequest = async (url, headers, body) => {
    const response = await axios.post(url, body, { headers: headers });
    return response.data;
};

// Send the request
sendRequest("https://api.tylt.money/p2pRampsMerchant/createInstance", headers, raw)
    .then(result => console.log("Success:", result))
    .catch(error => console.error("Error:", error));
import json
import hashlib
import hmac
import requests

# Replace with your API Key and Secret
api_key = 'your-api-key'
api_secret = 'your-api-secret'

# Function to create HMAC SHA-256 signature
def create_signature(secret, data):
    return hmac.new(secret.encode(), data.encode(), hashlib.sha256).hexdigest()

# Function to send a POST request
def send_post_request(url, body):
    raw = json.dumps(body, separators=(',', ':'), ensure_ascii=False)
    signature = create_signature(api_secret, raw)

    headers = {
        'Content-Type': 'application/json',
        'X-TLP-APIKEY': api_key,
        'X-TLP-SIGNATURE': signature
    }

    response = requests.post(url, headers=headers, data=raw)
    return response.json()

# Request body
request_body = {
    "isBuyTrade": 0,
    "userDetails": {},
    "amount": 1,
    "currencySymbol": "USDT",
    "merchantOrderId": "c84c84c-87wtbc-q36gbc-331n3",
    "callBackUrl": "https://www.test.com/callback",
    "redirectUrl": "https://www.test.com/callback"
}

# Send the request
response = send_post_request("https://api.tylt.money/p2pRampsMerchant/createInstance", request_body)
print("Success:", response)
const fetch = require('node-fetch');
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: 0,
    userDetails: {},
    amount: 1,
    currencySymbol: "USDT",
    merchantOrderId: "c84c84c-87wtbc-q36gbc-331n3",
    callBackUrl: "https://www.test.com/callback",
    redirectUrl: "https://www.test.com/callback"
};

// 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 = {
    "Content-Type": "application/json",
    "X-TLP-APIKEY": apiKey,
    "X-TLP-SIGNATURE": signature
};

// Function to send the request
const sendRequest = async (url, headers, body) => {
    const response = await fetch(url, {
        method: 'POST',
        headers: headers,
        body: body,
    });
    return response.json();
};

// Send the request
sendRequest("https://api.tylt.money/p2pRampsMerchant/createInstance", headers, raw)
    .then(result => console.log("Success:", result))
    .catch(error => console.error("Error:", error));

Response

{
    "msg": "Instance created successfully",
    "data": {
        "instanceId": "674c7142-e906-11ef-830e-02d8461243e9",
        "url": "https://app.tylt.money/prime/674c7142-e906-11ef-830e-02d8461243e9"
    }
}

Field Name

Type

Description

url

string

The unique link to the Tylt Prime Payment widget. You can display this url either on iframe or a browser.

instanceId

string

The instance ID generated by Tylt, used as a global identifier.

PreviousCreate a Pay-in InstanceNextWebhook for Tylt Prime

Last updated 3 months ago