Request Quote ID (USDT<>INR)

Request that the user sends a UPI payment that will be converted into a Lightning Network payment. The web app provides a BOLT-11 invoice and a callback URL. The function will return an acknowledgment if the payment initiation is successful.

Method


POST https://prod.ninjapay.me/sapi/v1/requestQuoteID

Parameters

Body (application/json)
{
  fiat_amount: number, // The fiat amount that the business wishes to send (max 97,000INR).
  payment_mode: string; // upi or ninjatag 
  sending_asset: string; // Add "usdt" for usdt to inr conversion.
  receiver_upi_id?: string, // The UPI ID to which the fiat amount will be sent.
  receiver_ninjatag?: string, // The Ninjatag of the recipient you want quote for.
  refund_wallet: string // If upi transfer fails, usdt amount will be refunded to the merchant wallet(Only "usdt" supported currently)
}

Response


{
  "quote_id": string, // The quote ID to be used in the subsequent api's.
  "linked_upi_id": string // The primary UPI ID linked to the receiver ninjatag.
}

Code Example


const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'API_KEY'
  },
  body: '{"fiat_amount":18,"payment_mode":"upi","sending_asset":"usdt","receiver_upi_id":"ninjapay@icici","refund_wallet":"lbtc"}'
};

fetch('https://prod.ninjapay.me/sapi/v1/requestQuoteID', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
  

Example Response


{
  "quote_id":aa1728acff604222a96d1343f9246c12,
  "linked_upi_id": null 
}

Please note that the actual implementation would depend on the specific UPI app, the cryptocurrency exchange, and the payment gateway used. Also, this function's successful execution does not mean the payment has been completed, only that it has been initiated. The web app should listen for a notification at the provided callback URL to confirm when the payment has been processed.

Last updated