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⚡️)

Transactions

You need to create a 'charge' 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.

Method


GET https://api.ninjapay.me/lapi/v1/history

Parameters


Body (application/json)
 {
  limit: number; // The number of transactions you need in response
}

Response

{
  "status": true,
     "data": {
      "tid": "2106A602N77897",
      "payment_mode": "lightning",
      "wallet": "lbtc",
      "amount": "-0.19362077",
      "receiver_ninjatag": null,
      "description": "sample_description",
      "created_at": 1661215876,
      "status": "paid", // undefined, pending, declined, paid status's by Ninjapay
      "callback_url": null,
      "callback_status": null, // 200, 400, ... only triggers after payment
      "success_url": null,
      "hosted_checkout_url": null,
      "hosted_checkout_expiry": null,
      "customer_name": "Satoshi Nakamoto";
      "order_id": "21",
      "fiat_currency": "USD",
      "fiat_value": "4000.22",
      "extra": {
          "name": "nakamoto",
          "email": "sample@sample.com"
      },
      "uri": null,
      "ttl": 10,
      "lightning_invoice": {
          "lightning_invoice_type": "invoice",
          "expires_at": null,
          "payreq": "lnbcl193620n1p3sgfyrpp5vsy5xumnky24rvt3aty94d4srrwy2rhp94yqzwu6er5x9eymh2zsdqawdsk6urvv40kgetnvdexjur5d9hkucqzpgxqzjhsp5uvmlp5xkteze6qmty35kuxe3j8cwzk25zsx7t9z84423peps9h9s9qyyssqp2ydxchkqceyzz4ma68kmjm58pr0pnx3anl48ajqlhfcgzqrpa0j7kxzjygdxujptkqjrkk6gxsag87yx9wcd7ugyauq45skvcg9aygqx5geqv"
      },
      "total_fee": {
          "network_fee": "0.00000061 btc",
          "service_fee": "0.00000002 btc (1%)",
          "gst_fee": null
      }
  },
   {
      "tid": "1986A602N13M997",
      "payment_mode": "lightning",
      "wallet": "lbtc",
      "amount": "1.10771927",
      "receiver_ninjatag": null,
      "description": "sample_description",
      "created_at": 1661215876,
      "status": "undefined", // undefined, pending, declined, paid status's by ninjapay
      "callback_url": "https://yourwebhook.com",
      "callback_status": 201, // 200, 201 400, ... only triggers after payment
      "success_url": "https://yoursuccessurl.com",
      "hosted_checkout_url": "https://checkout.ninjapay.me/198660213997",
      "hosted_checkout_expiry": 1814912992,
      "customer_name": null;
      "order_id": "210",
      "fiat_currency": "USD",
      "fiat_value": "2000.22",
      "extra": {
          "name": "nakamoto",
          "email": "sample@sample.com"
      },
      "uri": "lightning:lnbc193620n1p3sgfyrpp5vsy5xumnky24rvt3aty94d4srrwy2rhp94yqzwu6er5x9eymh2zsdqawdsk6urvv40kgetnvdexjur5d9hkucqzpgxqzjhsp5uvmlp5xkteze6qmty35kuxe3j8cwzk25zsx7t9z84423peps9h9s9qyyssqp2ydxchkqceyzz4ma68kmjm58pr0pnx3anl48ajqlhfcgzqrpa0j7kxzjygdxujptkqjrkk6gxsag87yx9wcd7ugyauq45skvcg9aygqx5geqv",
      "ttl": 10,
      "lightning_invoice": {
          "lightning_invoice_type": "invoice",
          "expires_at": 1761215976,
          "payreq": "lnbc193620n1p3sgfyrpp5vsy5xumnky24rvt3aty94d4srrwy2rhp94yqzwu6er5x9eymh2zsdqawdsk6urvv40kgetnvdexjur5d9hkucqzpgxqzjhsp5uvmlp5xkteze6qmty35kuxe3j8cwzk25zsx7t9z84423peps9h9s9qyyssqp2ydxchkqceyzz4ma68kmjm58pr0pnx3anl48ajqlhfcgzqrpa0j7kxzjygdxujptkqjrkk6gxsag87yx9wcd7ugyauq45skvcg9aygqx5geqv"
      },
      "total_fee": {
          "network_fee": null,
          "service_fee": null,
          "gst_fee": null
      }
  },
  "message": "",
}

Code Example


const options = {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'API_KEY' 
  },
  body: '{"limit":10}'
};

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

Last updated 1 year ago

💻