# List of payments

## Description

The service automatically searches for all payments coming to your crypto wallets, but only if there are active (unpaid) invoices.

## Request

```bash
curl -X POST https://api.bitsby.app/payments/list \
  -H "Authorization: Token MSvL2ltaDZdWVjmZURURMVWhqSJLT2NURjhL2Fla1Z1T1IxQTltKs1T3Ay" \
	-F "startDate=2000-01-01" \
	-F "endDate=2030-01-01" \
	-F "offset=0" \
	-F "limit=10"
```

## Request parameters

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Data type</th><th>Description</th><th>Example</th><th>Mandatory?</th><th>Default</th></tr></thead><tbody><tr><td><code>walletId</code></td><td>UUID</td><td>Wallet ID in UUID format</td><td>1c48b092-9878-48f5-b441-07a8a48e7b54</td><td>no</td><td></td></tr><tr><td><code>invoiceId</code></td><td>UUID</td><td>Invoice ID in UUID format</td><td>1c48b092-9878-48f5-b441-07a8a48e7b54</td><td>no</td><td></td></tr><tr><td><code>startDate</code></td><td>String</td><td>Start date of the transaction in blockchain in Y-m-d format</td><td>2000-01-01</td><td>no</td><td></td></tr><tr><td><code>endDate</code></td><td>String</td><td>End date of the transaction in blockchain in Y-m-d format</td><td>2030-01-01</td><td>no</td><td></td></tr><tr><td><code>offset</code></td><td>Integer</td><td>The number of the initial record from which the output will begin</td><td>0</td><td>no</td><td>0</td></tr><tr><td><code>limit</code></td><td>Integer</td><td>Number of records you want to retrieve</td><td>50</td><td>no</td><td>10</td></tr></tbody></table>

## Example answer

```json
{
   "result":"success",
   "data":[
      {
         "id":"f986ad8d-2298-473d-982a-efbc817b975d",
         "amount":"12.00000000",
         "hash":"f09352627039c088688806821b864895ff237558612d834861621fc026de5f68",
         "transactionDatetime":"2024-02-27 21:05:36",
         "invoice":{
            "id":"f31c61f6-407f-4999-95cf-56477eff06d4",
            "uid":"riUZBnNvd2rX",
            "projectId":"9deea1e2-0c08-41a3-bdc2-a34eada3892d",
            "createDatetime":"2024-02-27 20:57:23",
            "timeToPayDatetime":"2024-02-28 08:57:23",
            "commissionFiatUSD":"0.12",
            "amountFiatUSD":"12.00",
            "amountFiat":"12.00",
            "currencyFiat":"USD",
            "description":null,
            "serviceData":"userId:2444",
            "views":0,
            "status":"paid"
         },
         "wallet":{
            "id":"47aa71e2-07a0-482e-9172-7114d7376ba0",
            "name":"usdt-tron",
            "blockchain":"tron",
            "cryptocurrency":"usdt",
            "address":"TKbstUwMzLrfTAGL4erYb7gc7ghmHQ9zG7"
         }
      },
      {
         "id":"f3195184-9a6f-4c82-928b-d7fe7c015b7b",
         "amount":"5.02000000",
         "hash":"74763b65e43bcc9492a6ce9a7f26fbfdbd7635aecd3454420b5e9534cba50ee6",
         "transactionDatetime":"2024-02-26 13:32:57",
         "invoice":{
            "id":"fac8ef03-2c41-4ce0-a432-7c33b928f16f",
            "uid":"AFhygKX21ecd",
            "projectId":"9deea1e2-0c08-41a3-bdc2-a34eada3892d",
            "createDatetime":"2024-02-26 13:29:24",
            "timeToPayDatetime":"2024-02-27 01:29:24",
            "commissionFiatUSD":"0.05",
            "amountFiatUSD":"5.00", 
            "amountFiat":"5.00",
            "currencyFiat":"USD",
            "description":null,
            "serviceData":"userId:3419",
            "views":0,
            "status":"paid"
         },
         "wallet":{
            "id":"47aa71e2-07a0-482e-9172-7114d7376ba0",
            "name":"usdt-tron",
            "blockchain":"tron",
            "cryptocurrency":"usdt",
            "address":"TKbstUwMzLrfTAGL4erYb7gc7ghmHQ9zG7"
         }
      }
   ]
}
```

## Answer parameters

| Parameter                   | Description                                                                                                                        |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `id`                        | Payment ID in UUID format                                                                                                          |
| `amount`                    | Payment amount in cryptocurrency                                                                                                   |
| `hash`                      | Transaction hash in blockchain                                                                                                     |
| `transactionDatetime`       | Date and time of the transaction in blockchain (UTC)                                                                               |
| `invoice`                   | A section containing invoice parameters. Displayed if an invoice is binded to the payment                                          |
| `invoice.id`                | Invoice ID in UUID format                                                                                                          |
| `invoice.uid`               | Invoice ID (for buyer)                                                                                                             |
| `invoice.projectId`         | Project ID in UUID format                                                                                                          |
| `invoice.createDatetime`    | Date and time of invoice creation (UTC)                                                                                            |
| `invoice.timeToPayDatetime` | Date and time until which the invoice is valid (UTC)                                                                               |
| `invoice.commissionFiatUSD` | The amount of the service commission. Calculated relative to the amount `invoice.amountFiatUSD`                                    |
| `invoice.amountFiatUSD`     | Amount in USD currency calculated during invoice creation at the current exchange rate relative to the `invoice.amountFiat` amount |
| `invoice.amountFiat`        | Amount in fiat currency                                                                                                            |
| `invoice.currencyFiat`      | Fiat currency                                                                                                                      |
| `invoice.description`       | Description that was set during invoice creation                                                                                   |
| `invoice.serviceData`       | Service data that was set via API during invoice creation                                                                          |
| `invoice.views`             | Number of views of the payment page                                                                                                |
| `invoice.status`            | Invoice status                                                                                                                     |
| `wallet`                    | A section containing wallet parameters. It is displayed if an invoice is binded to the payment                                     |
| `wallets.id`                | Wallet ID in UUID format                                                                                                           |
| `wallets.name`              | Wallet name                                                                                                                        |
| `wallets.blockchain`        | Blockchain of the crypto wallet                                                                                                    |
| `wallets.cryptocurrency`    | Cryptocurrency of the wallet                                                                                                       |
| `wallets.address`           | Crypto wallet address                                                                                                              |


---

# 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://docs.bitsby.app/api-documentation/list-of-payments.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.
