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));
  

Last updated