Check Payment

Check the status of a particular payment using the transaction ID.

Method


GET https://prod.ninjapay.me/sapi/v1/checkQuote

Parameters

tid: int // the transaction ID of the payment request.

Response


{
  "tid": int, // The transaction ID.
  "created_at": int, // The time when the quote was requested
  "status": string, // The status of the transaction (e.g., 'pending', 'success', 'failed', 'expired', 'refunded').
  "sending_asset": string; // "btc" or "usdt" for btc/usdt to inr conversion.
  "sending_asset_amount": int; // The amount to pay for fiat conversion.
  "fiat_amount": number, // The fiat amount that the upi id will receive.
  "payment_method": string, // The method of payment (e.g., 'upi', 'ninjatag').
  "lightning_invoice": string, // The Lightning invoice.
  "onchain_address": string, // The on-chain address.
  "onchain_address_network": string, // BTC, ERC20, BEP20...
  "expires_at": int, // The expiry time for the payment quote.
  "receiver_upi_id": string, // The UPI ID to which the fiat amount was sent.
  "receiver_ninjatag": string, // The Ninjatag of the recipient.
  "refund_wallet": string, // The type of merchant's wallet used for refund if upi transfer fails (e.g., lbtc, btc, usdt).
  "transaction_time": string // The timestamp of when the transaction was processed.
}

Response


{
  "tid": int, // The transaction ID.
  "created_at": int, // The time when the quote was requested
  "status": string, // The status of the transaction (e.g., 'Pending', 'Completed', 'Failed').
  "fiat_amount": number, // The fiat amount that was sent.
  "receiver_upi_id": string, // The UPI ID to which the fiat amount was sent.
  "ninjatag": string, // The NinjaTag of the recipient.
  "refund_wallet": string, // The type of wallet used (e.g., lbtc, btc, usdt).
  "payment_method": string, // The method of payment (e.g., 'lightning', 'onchain').
  "transaction_time": string // The timestamp of when the transaction was processed.
}

Code Example


const options = {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'API_KEY'
  },
  body: '{"tid": 21066027789}'
};

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

Last updated