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⚡️)
  3. Withdraw Vouchers

Redeem Voucher

Redeem a particular voucher using the voucher code.

Method


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

Parameters

Body (application/json)
{
  "voucher_code": string, // Voucher code of a particular voucher
  "redeem_mode": string, // "ninjatag" or "invoice" as inputs.... ninjatag is basically username of ninjapay user & "invoice" means a btc lightning invoice
  "redeem_to": string, // add username(ninjatag) or lightining invoice(lnbc....82je)
}

Other info

Parameters
Input options

redeem_mode

ninjatag , invoice

Response

{  
 "status": true, 
    "data":{
      "voucher_code": "7ee15185",
      "redeemed": true,
      "redeemed_mode": "ninjatag",
      "redeemed_by": "satoshinakamoto",
      "redeemed_tid": 628660213994,
      "redeemed_at": 1714912921
    },
  "message": ""
}
    

Code Example


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

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

Last updated 1 year ago

💻
🎁