# Transactions

You need to create a 'charge' to receive payments through Ninjapay. A request contains both a <mark style="color:red;">Lightning Network BOLT11</mark> invoice, capable of accepting payments through the LN protocol, and a on-chain address for standard on-chain transactions.

#### **Method**

```

GET https://prod.ninjapay.me/uapi/v1/p2p/paymentLink/transactions

```

#### **Parameters**

```javascript

Body (application/json)
 {
  limit: number; // The number of transactions you need in response
  fetch_by: string; // "month", "date" supported currently
  month?: string; // "jan", "feb", "mar"....
  year?: int; // 2021, 2022, 2023...
  date?: int // 01, 02, 03....31 (not required if fetch_by is "month")
}

```

#### **Response**

```json
[
   {
      "tid": "M19866021A3997",
      "payment_mode": "upi",
      "payment_mode_type": "primary",
      "utr": "278917658915", // UTR added by the payer/customer upon 
      "amount": 120.10,
      "amount_currency": "INR",
      "payer_info": "+917337557707", // email or phone number of the payer/customer
      "purpose": "sample_description",
      "created_at": 1661215876,
      "status": "pending", // pending, approved, declined status's by admin or merchant
      "callback_url": "https://yourwebhook.com",
      "callback_status": 200, // 200, 400, ... only triggers after payment approval
      "success_url": "https://yoursuccessurl.com",
      "hosted_checkout_url": "https://bit.ly/3H24Msg",
      "order_id": "210",
      "extra": {
          "name": "nakamoto",
          "email": "sample@sample.com"
      },
      "upi_info": {
          "upi_id": "merchantupi@icici", // null if payment_mode is bank
      },
      "bank_info": {
          "account_number": 001001553534,
          "name": "Nanda Neeraj",
          "ifsc": "icic0000060",
          "bank_name": "icici",
          "address": "vizag, dwarakanagar branch, 530024",
          "swift": "merchantupi@icici"
      },
      "other_info": {
          "paytm": "mypaytmid"
      }
       "total_fee": {
          "network_fee": null,
          "service_fee": null,
          "gst_fee": null
      }
  },
   {
      "tid": "M1986A60213997",
      "payment_mode": "upi",
      "payment_mode_type": "primary",
      "utr": "278917658915", // UTR added by the payer/customer upon 
      "amount": 120.10,
      "amount_currency": "INR",
      "payer_info": "+917337557707", // email or phone number of the payer/customer
      "purpose": "sample_description",
      "created_at": 1661215876,
      "status": "pending", // pending, approved, declined status's by admin or merchant
      "callback_url": "https://yourwebhook.com",
      "callback_status": 200, // 200, 400, ... only triggers after payment approval
      "success_url": "https://yoursuccessurl.com",
      "hosted_checkout_url": "https://bit.ly/3H24Msg",
      "order_id": "210",
      "extra": {
          "name": "nakamoto",
          "email": "sample@sample.com"
      },
      "upi_info": {
          "upi_id": "merchantupi@icici", // null if payment_mode is bank
      },
      "bank_info": {
          "account_number": 001001553534,
          "name": "Nanda Neeraj",
          "ifsc": "icic0000060",
          "bank_name": "icici",
          "address": "vizag, dwarakanagar branch, 530024",
          "swift": "merchantupi@icici"
      },
      "other_info": {
          "paytm": "mypaytmid"
      }
       "total_fee": {
          "network_fee": null,
          "service_fee": null,
          "gst_fee": null
      }
  }
]
```

#### **Code Example**

{% code overflow="wrap" %}

```javascript

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

fetch('https://prod.ninjapay.me/uapi/v1/p2p/paymentLink/transactions', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
  
```

{% endcode %}


---

# 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-p2p/plugins/payment-links-p2p/transactions.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.
