Send Payment

This endpoint sends a payment on the Bitcoin Lightning Network.

Request to sends a payment from a wallet. The application needs to provide a lightning invoice or Ninjapay username(@ninjatag). We recommend using ninjatag(Ninjapay username) for sending BTC rewards/cashbacks/payments to users, since it's instant and zero network fee.

Method


POST https://api.ninjapay.me/lapi/v1/send

Parameters

Body (application/json)
 {
  payment_mode: string; // ninjatag, lightning
  ninjatag?: string; // Add this username if you want to send to other ninjapay users
  lightning_invoice?: string; // Add this if you want to send payment via lightning
  lightning_invoice_type?: string; // "invoice"(default) and "lnurl" currently supported (amount required for lnurl type)
  amount?: string; // Amount should be entered in BTC, not SAT. (Amount is not required for lightning_invoice_type is "invoice")
  fiat_value?: string;
  fiat_currency?: string; // INR, USD, EUR...
  description?: string;
  customer_name?: string;
  order_id?: string;
  extra?: {}
}

Other info

Parameters
Input options

payment_mode

ninjatag , lightning

lightning_invoice_type

invoice , lnurl

Response

{
    "status": bool,
    "data": {
        "tid": string
    },
    "message": string
}

Example


const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'API_KEY' //Admin key required
  },
  body: '{"payment_mode":"ninjatag","amount":0.0018,"description":"sample_description","ninjatag":"nakamoto","order_id":"21"}'
};

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

Note: You need to use Admin key for this request! Ex Response Body (application/json)

 {
    "status": true,
    "data": {
        "tid": "128390A389H2920"
    },
    "message": "Paid"
}

Last updated