# Fetch invoices

<mark style="color:green;">`POST`</mark> `https://app.thedex.cloud/api/v1/invoices`

#### Headers

| Name                                             | Type   | Description                        |
| ------------------------------------------------ | ------ | ---------------------------------- |
| X-EX-APIKEY<mark style="color:red;">\*</mark>    | String | Your API key                       |
| X-EX-PAYLOAD<mark style="color:red;">\*</mark>   | String | Body to base64                     |
| X-EX-SIGNATURE<mark style="color:red;">\*</mark> | String | Encrypted body with the secret key |

#### Request Body

```json
{
    "from": "Number", // timestamp
    "to": "Number" // timestamp
}
```

**Request JSON attributes**

| Name | Type | Description                                       |
| ---- | ---- | ------------------------------------------------- |
| from | Long | Timestamp (from) in milliseconds since Unix epoch |
| to   | Long | Timestamp (to) in milliseconds since Unix epoch   |

**Response body**

{% tabs %}
{% tab title="200 invoice" %}

```json
[
{
   "invoiceId": "String",
   "merchantId": "String",
   "orderId": "String",
   "clientId": "String",
   "status": "Integer",
   "statusName": "String",
   "createDate": "String",
   "modifiedDate": "String",
   "expirationDate": "String",
   "createTimestamp": "String",
   "modifiedTimestamp": "String",
   "expirationTimestamp": "String",
   "expirationDateInMilliseconds": "Long",
   "purse": "String",
   "memo": "String",
   "currency": "String",
   "payCurrency": "String",
   "amount": "String",
   "amountInPayCurrency": "String",
   "paidAmount":"String",
   "paidAmountFiat": "String",
   "payUrl": "String",
   "creationWay": "String",
   "merchantCommission": "String",
   "merchantBalance": "String",
   "title": "String",
   "description": "String",
   "uniqueUserId":" String",
   "depositBlockchainFee": "String",
   "rate": "String",
   "rateWithCommission": "String",
   "txId": "String"[],
   "fromAddress": [],
   "successUrl": "String",
   "failureUrl": "String",
   "merchantSiteUrl": "String",
   "callbackUrl": "String",
   "complexCommission": "String"
},

{...}
]
```

{% endtab %}
{% endtabs %}

**Response JSON attributes:**

<table data-header-hidden><thead><tr><th width="273.3333333333333">Name</th><th width="123">Type</th><th>Descripton</th></tr></thead><tbody><tr><td><code>"invoiceId"</code></td><td><code>String</code></td><td>Invoice id.</td></tr><tr><td><code>"merchantId"</code></td><td><code>String</code></td><td>Merchant id.</td></tr><tr><td><code>"orderId"</code></td><td><code>String</code></td><td>Order id.</td></tr><tr><td><code>"clientId"</code></td><td><code>String</code></td><td>Client id.</td></tr><tr><td><code>"status"</code></td><td><code>Integer</code></td><td>reach out all accessed values by link: <a href="/pages/z3ihQbPDAepeTxdumQ0z"><code>/api/v1/info/statuses</code></a></td></tr><tr><td><code>"statusName"</code></td><td><code>String</code></td><td>reach out all accessed values by link: <a href="/pages/z3ihQbPDAepeTxdumQ0z"><code>/api/v1/info/statuses</code></a></td></tr><tr><td><code>"createDate"</code></td><td><code>String</code></td><td>Creation date.</td></tr><tr><td><code>"modifiedDate"</code></td><td><code>String</code></td><td>Modification date.</td></tr><tr><td><code>"expirationDate"</code></td><td><code>String</code></td><td>Expiration date.</td></tr><tr><td><code>"createTimestamp"</code></td><td><code>Long</code></td><td>Creation date in milliseconds</td></tr><tr><td><code>"modifiedTimestamp"</code></td><td><code>Long</code></td><td>Modified date in milliseconds</td></tr><tr><td><code>"expirationTimestamp"</code></td><td><code>Long</code></td><td>Expiration date in milliseconds</td></tr><tr><td><code>"expirationDateInMilliseconds"</code></td><td><code>Long</code></td><td>Left expiration time in milliseconds.</td></tr><tr><td><code>"purse"</code></td><td><code>String</code></td><td>Crypto-address is used by client to send cryptocurrency.</td></tr><tr><td><code>"currency"</code></td><td><code>String</code></td><td>reach out all accessed values by link: <a href="/pages/T8Adh6BIVE4Ma5SN3zSc"><code>/api/v1/info/currencies</code></a></td></tr><tr><td><code>"payCurrency"</code></td><td><code>String</code></td><td>reach out all accessed values by link: <a href="/pages/T8Adh6BIVE4Ma5SN3zSc"><code>/api/v1/info/currencies</code></a></td></tr><tr><td><code>"amount"</code></td><td><code>String</code></td><td>Amount in fiat currency.</td></tr><tr><td><code>"amountInPayCurrency"</code></td><td><code>String</code></td><td>Converted amount in cryptocurrency.</td></tr><tr><td><code>"paidAmount"</code></td><td><code>String</code></td><td>Represents paid amount in crypto-currency.</td></tr><tr><td><code>"paidAmountFiat"</code></td><td><code>String</code></td><td>Represents paid amount in fiat currency.</td></tr><tr><td><code>"payUrl"</code></td><td><code>String</code></td><td>Url is used to deposit.</td></tr><tr><td><code>"callbackUrl"</code></td><td><code>String</code></td><td><p>Callback URL.<br>To reach out more about statuses that trigger callback read the section about</p><p><a href="/pages/z3ihQbPDAepeTxdumQ0z"><code>/api/v1/info/statuses</code></a></p></td></tr><tr><td><code>"creationWay"</code></td><td><code>String</code></td><td><p>For this usage “API“.</p><p>To reach out more creation ways use:<a href="/pages/akX5SB0icQekshIT2Bsp"><code>/api/v1/info/invoice/creation/ways</code></a></p></td></tr><tr><td><code>"merchantCommission"</code></td><td><code>String</code></td><td>Merchant commission.</td></tr><tr><td><code>"merchantBalance"</code></td><td><code>String</code></td><td>Merchant balance.</td></tr><tr><td><code>"title"</code></td><td><code>String</code></td><td>Title.</td></tr><tr><td><code>"description"</code></td><td><code>String</code></td><td>Description.</td></tr><tr><td><code>"uniqueUserId"</code></td><td><code>String</code></td><td>User UUID.</td></tr><tr><td><code>"depositBlockchainFee"</code></td><td><code>String</code></td><td>Deposit blockchain fee.</td></tr><tr><td><code>"rate"</code></td><td><code>String</code></td><td>Rate.</td></tr><tr><td><code>"rateWithCommission"</code></td><td><code>String</code></td><td>Rate with commission.</td></tr><tr><td><code>"txId"</code></td><td><code>String[]</code></td><td>Transactions list</td></tr><tr><td><code>"failureUrl"</code></td><td><code>String</code></td><td>Used for redirect to this reference on failure invoice status. You could set this URL individually to merchant.</td></tr><tr><td><code>"successUrl"</code></td><td><code>String</code></td><td>Used for redirect to this reference on success invoice status. You could set this URL individually to merchant.</td></tr><tr><td><code>"merchantSiteUrl"</code></td><td><code>String</code></td><td>Used for redirect to this reference if <code>successUrl</code> or <code>failureUrl</code> are not defined.</td></tr><tr><td>"<code>memo"</code></td><td><code>String</code></td><td>Note for payment</td></tr><tr><td><code>"</code>fromAddress<code>"</code></td><td><code>String[]</code></td><td>From Address list</td></tr><tr><td><code>"complexCommission"</code></td><td><code>String</code></td><td>Used for commision </td></tr></tbody></table>

**Request Curl**

```powershell
curl --location --request POST 'https://app.thedex.cloud/api/v1/invoices' \
--header 'X-EX-APIKEY: <string>' \
--header 'X-EX-PAYLOAD: <string>' \
--header 'X-EX-SIGNATURE: <string>' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
  "from": "<Long>",
  "to": "<Long>"
}'
```

**Example Curl**

```powershell
curl --location --request POST 'https://app.thedex.cloud/api/v1/invoices' \
--header 'X-EX-APIKEY: test_api_key_123' \
--header 'X-EX-PAYLOAD: eyJmcm9tIjoxNzE4MDAwMDAwMDAsInRvIjoxNzE4MTIwMDAwMDAwfQ==' \
--header 'X-EX-SIGNATURE: dummy_signature_abc1234567890' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
  "from": 1718000000000,
  "to": 1718120000000
}'

```


---

# 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.thedex.cloud/documentation/invoices/fetch-invoices.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.
