# Check Voucher

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

#### **Method**

```

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

```

#### **Parameters**

**`tid: string`** // the transaction ID of the voucher request.

#### **Response**

```jsx
{
   "status": true,
     "data":{
      "tid": "19B86602A1399N7",
      "created_at": 1414912921, 
      "expires_at": 1714912921, 
      "voucher_count": 2,
      "voucher_redeemed": 1, 
      "amount": 0.00001000, // amount/voucher in BTC
      "from": "Swiggy",
      "title": "Congrats IPL Spinwheel winner",
      "receiver_email": "dev@ninjapay.me", 
      "email_status": "success", // "success", "pending", "undefined" status's
      "unique_design": true,
      "unique_design_url": "https://www.mycompanydesignin600x900pixel.com",
      "callback_url": "https://yourwebhook.com",
      "revoked": false, 
      "revoked_at": null,
      "voucher_static_url": "https://www.ninjapay.me/voucher/198660213997", // This single multi use url can be used to redeem all vouchers.
      "voucher_urls": [
          {
              "voucher_url": "https://www.ninjapay.me/voucher/redeem/7ee15185",
              "voucher_code": "7ee15185",
              "redeemed_by": "ninjatagUsername", // @ninjatag or invoice(lnbc..ndjj)
              "redeemed_tid": 128660213994,
              "redeemed_at": 2014912928,
              "callback_status": 201 // 200, 201, 400, ... only triggers after successful redeem of voucher.
          },
           {
              "voucher_url": "https://www.ninjapay.me/voucher/redeem/39e11981h",
              "voucher_code": "39e11981h",
              "redeemed_by": null, //
              "redeemed_tid": null,
              "redeemed_at": null,
              "callback_status": null // 200, 201, 400, ... only triggers after successful redeem of voucher.
              
         }
       ]
    },
    "message":""
}

```

#### **Code Example**

```jsx

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

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

If the payment status is Pending, then Check Status API should be called in the following interval: \
The first status check at 20-25 seconds post transaction start, then \
Every 3 seconds once for the next 30 seconds, \
Every 6 seconds once for the next 60 seconds, \
Every 10 seconds for the next 60 seconds, \
Every 30 seconds for the next 60 seconds, and then \
Every 1 min until timeout (10 mins).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ninjapay.gitbook.io/ninjapay-api-docs/how-to/api-reference-btc/withdraw-vouchers/check-voucher.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
