Request Payment

You need to create a 'request' to receive payments through Ninjapay. A request contains both a Lightning Network BOLT11 invoice, capable of accepting payments through the LN protocol, and a on-chain address for standard on-chain transactions. We recommend using only "lbtc" lightning wallet for all your use-cases, since it's built for instant almost zero fee micro payments.

Method


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

Parameters


Body (application/json)
 {
  wallet: string; // lbtc(recommended), usdt, btc are supported currently
  payment_mode: string; // onchain, lightning
  amount: int; // For lbtc & btc amount should be entered in BTC not SAT
  receiver_ninjatag?: string; // Add this username if you want to request for other users
  chain_network?: string; // Add this to get the onchain address for a specific network(not required for "lbtc" wallet)
  fiat_value?: int;
  fiat_currency?: string; // INR, USD, EUR...
  description?: string;
  expires_in?: int; // The expiry of payment request in mins for hosted checkout
  callback_url?: string; // only works for lbtc_wallet currently
  success_url?: string; // Redirected to this after success from hosted checkout
  customer_name?: string;
  order_id?: string;
  extra?: {};
}

Other info

Parameters
Input options

wallet

lbtc,btc,usdt

chain_network

BTC,ERC20,BEP20, MATIC

Response

How to decode a lightning invoice?

Use the url πŸ‘‰ https://lightningdecoder.com/<lightning_invoice>arrow-up-right or there are many free open source dependency packages which can be used in your code/project to decode an invoice. You can also use our api Decode Invoicearrow-up-right method.

Code Example

You can use Ninjapay's native checkout experience by redirecting your user to the checkout endpoint:

Production - https://checkout.ninjapay.me/arrow-up-right{tid}

Last updated