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. How to
  2. API Reference (BTC⚡️)

Ninjapay URI Intent

PreviousNinjaAuthNextCheck Payment

Last updated 1 year ago

Ninjapay supports a URI scheme which allows web pages, apps, or other services to initiate a payment request through the Ninjapay app installed on the user's device.

Constructing the Ninjapay URI

The URI should be constructed as follows:

ninjapay://pay?key=<invoice-key>&tid=<transaction-id>

where:

  • <invoice-key> is the unique API used for authentication.

  • <transaction-id> is the unique 12-digit number to be used for the payment. Get it using method.

For example:

ninjapay://pay?key=n6bda6e5c9377c21a5cdee98572f08e1&tid=128662902742

Initiating the Payment Request

To initiate the payment request, simply navigate to the constructed URI.

In a web page, this can be done by providing the URI as a hyperlink:


<a href="ninjapay://pay?key=n6bda6e5c9377c21a5cdee98572f08e1&tid=128662902742">Pay with Ninjapay</a>

In a mobile app, this can typically be done by opening the URI:


window.open("ninjapay://pay?key=n6bda6e5c9377c21a5cdee98572f08e1&tid=128662902742");

Receiving a Payment Response

After the payment has been processed, the Ninjapay app will return control to the calling app along with a response that contains details about the transaction. This response will typically include:

  • tid: a unique identifier for the transaction.

  • status: the status of the transaction, e.g., "successful", "failed", etc.

The method of receiving this response will depend on the specific platform and programming language. In general, you will need to set up a callback mechanism to handle the response.

User Experience

When a user activates a Ninjapay URI:

  1. The Ninjapay app will open on their device, with the payment details pre-filled according to the information provided in the URI.

  2. The user will be asked to confirm the payment.

    If the user is not already logged in to the Ninjapay app, they will be asked to log in before they can confirm the payment.

  3. Once the user confirms the payment, the transaction will be processed. The user will see a confirmation message in the Ninjapay app, and they can then return to the original app or webpage.

Note:

  • Allowing payments to be initiated in this way can be convenient for users, but it also presents security considerations. Ensure that the Ninjapay URIs are only generated and used in a secure manner.


This covers the basic usage of the NinjaPay URI intent system. Depending on the specifics of your implementation, you may want to add more details or examples to help users understand how to use it effectively.

Make sure to verify confirmations from Ninjapay on the server side.

💻
invoice key
request payment
payment status