Ninjapay API Docs
  • Namaste
    • â„šī¸Welcome to Ninjapay!
    • 🏆Benefits of NinjapayAPI
    • đŸ› ī¸Fees & Limit
  • How to
    • ❓How Plugins Work
    • 👨‍đŸ’ģGetting Started
    • 🔐Authentication
    • đŸ’ģAPI Reference (UPI)
      • 🧩Plugins
        • 🔗Realtime Payment Links
          • Create Realtime Payment Link
          • Create Template
          • List Payment Links
          • Multi super order Id list
          • Get templates
          • Single order Id trx list
          • Generate Upi payment link
          • Record payment
          • Expiry List
          • Delete Payment Link
          • Delete Template
          • Check Payment
        • đŸ›Ąī¸Paywalls
          • Create Paywall
          • Create Paywall QR
          • List Paywalls
          • Detail Paywall
          • Check Paywall
          • Remove Paywall
        • 📄Invoice
          • Add Client
          • Edit Client
          • Get Client
          • Remove Client
          • Add Product
          • Edit Product
          • Get Products
          • Remove Product
          • Upload Attachment
          • Add/Edit Template
          • Create Invoice
          • Get Invoice by ID
          • Add Tracking Details
          • Remove Invoice
        • đŸ–Ĩī¸Point of Sale - POS
          • Create POS
          • Create Paywall QR
          • List Paywalls
          • Detail Paywall
          • Check Paywall
          • Remove POS
        • 👨‍đŸ’ģBuild Your Own Plugin
          • Ninjapay Plugin Development Guide
      • Error Handling
      • Limits on API Requests
    • đŸ’ģAPI Reference (P2P)
      • 🧩Plugins
        • 🔗Payment Links (P2P)
          • Dashboard Stats
          • Create Payment Link
          • Submit UTR for Approval
          • List Payment Links
          • Transactions
          • Approve/Decline
          • Check Payment
        • đŸ›Ąī¸Paywalls
          • Create Paywall
          • Create Paywall QR
          • List Paywalls
          • Detail Paywall
          • Check Paywall
          • Remove Paywall
        • 👨‍đŸ’ģBuild Your Own Plugin
          • Ninjapay Plugin Development Guide
      • Error Handling
      • Limits on API Requests
    • đŸ’ģAPI Reference (BTCâšĄī¸)
      • Wallet Info
      • Send Payment
      • Request Payment
      • NinjaAuth
      • Ninjapay URI Intent
      • Check Payment
      • Transactions
      • Get Prices
      • Decode Invoice
      • Error Handling
      • Limits on API Requests
      • 🎁Withdraw Vouchers
        • Request Voucher
        • Check Voucher
        • Revoke Voucher Request
        • Redeem Voucher
      • 📈Spot Trade
        • Asset Balances
        • Asset Prices
        • Buy/Sell
        • Check Order
        • Revoke Order Request
  • other
    • 🤝Partnerships
    • 📓Helpful references
  • Use Cases
    • Game Developers
      • Implementing BTC Points
  • Coming Soon
    • đŸ’ģAPI Reference (Pro)
      • Wallet Info
      • Send Payment
      • Request Payment
      • NinjaAuth
      • Ninjapay URI Intent
      • Check Payment
      • Transactions
      • Get Prices
      • Decode Invoice
      • Error Handling
      • Limits on API Requests
    • 🧩Widget Integration
      • Widget (Onramp)
      • Widget (Offramp)
      • Request Token
      • Check Token
  • Fiat x Web3 Bridge
    • â„šī¸Intro to NinjaUPI
    • 👩‍đŸ’ģGet Started
      • Request Quote ID (BTC<>INR)
      • Request Quote ID (USDT<>INR)
      • Request Invoice for Quote
      • Check Payment
    • đŸĻ¸Upgrades
  • Protocols
    • Commerce Onchain Protocol
Powered by GitBook
On this page
  1. Fiat x Web3 Bridge
  2. Get Started

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.

PreviousRequest Quote ID (BTC<>INR)NextRequest Invoice for Quote

Last updated 1 year ago

👩‍đŸ’ģ