NIN API Docs
  • How to
    • 👨‍💻Getting Started
    • 🔐How to get API Keys?
    • Full API Documentation
    • 💻OpenAPI Reference (Trade)
      • Authentication
      • Instruments
      • Orders
      • Portfolio
      • Margin
      • WebSocket
      • Models
      • Error Handling
      • Limits on API Requests
  • Use Cases
  • Algo Developers
    • Implementing BTC Points
  • Coming Soon
    • Automations Protocol
    • 🧩Widget Integration
      • Widget (Onramp)
      • Widget (Offramp)
      • Request Token
      • Check Token
Powered by GitBook
On this page
  1. Coming Soon
  2. Widget Integration

Request Token

Create a withdraw voucher request to be redeemed by anyone. Money will be deducted from your lightning wallet.

Method


POST https://prod.ninjapay.me/lapi/v1/requestToken

Parameters

Body (application/json)
{
  widget_mode: string, // Add "onramp" for receiving or "offramp" for withdrawing.
  amount: number, // The amount in BTC(not SAT)
  order_id?: string; // Optional From title for voucher giveaway
  callback_url?: string, // Add this if you want a success response upon 
}

Other info

Parameters
Input options

widget_mode

onramp , offramp

Response


{
  "token": 198660213997
}

Code Example


const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'API_KEY' //Admin key required
  },
  body: '{"amount":0.00180204,"voucher_count":1,"title":"Happy Birthday🥳"}'
};

fetch('https://prod.ninjapay.me/lapi/v1/requestToken', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
  
PreviousWidget (Offramp)NextCheck Token
🧩