
## List invoices

`GET /v1/invoices`

Returns a list of invoices with filtering, sorting and pagination.

## Parameters

| Parameter | Type | Required | Default | Description |
|----------|-----|:-----:|-----------|---------|
| `limit` (query) | number | no | `50` | Number of records per call, up to 5000 |
| `offset` (query) | number | no | `0` | Skip N records, counted individually: `offset=7` starts at the 8th record. When `offset >= 2500`, `limit <= 500` is more reliable |
| `sort` (query) | string | no | — | Sorting via the short syntax: `?sort=-createdTime`; the minus sign means descending order. The accepted names are listed in the `400 UNKNOWN_SORT_FIELD` error text — not every field from [`GET /v1/invoices/fields`](/docs/entities/invoices/fields) can be sorted on |
| `order` (query) | object | no | — | Sorting: `?order[createdTime]=desc` |
| `select` (query) | string | no | — | Field selection: `?select=id,title,stageId`. Accepts any field from [`GET /v1/invoices/fields`](/docs/entities/invoices/fields) |
| `filter` (query) | object | no | — | Filtering. The accepted names are listed in the `400 UNKNOWN_FILTER_FIELD` error text — not every field from [`GET /v1/invoices/fields`](/docs/entities/invoices/fields) can be filtered on.<br>[Filtering syntax](/docs/filtering). Example: `?filter[stageId]=DT31_5:N` |
| `include` (query) | string | no | — | Related records: `contact`, `company`, `deal`. For what the response contains, see the "Related data" section |

When `limit > 50`, the result set is paginated on the server side. The maximum for a single call is 5000 records. `meta.hasMore` shows whether there are records beyond the returned page, and `meta.total` shows how many match the filter in total.

## Examples

### curl — personal key

```bash
curl -g "https://vibecode.bitrix24.com/v1/invoices?limit=10&order[createdTime]=desc&filter[stageId]=DT31_5:N" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -g "https://vibecode.bitrix24.com/v1/invoices?limit=10&order[createdTime]=desc&filter[stageId]=DT31_5:N" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const params = new URLSearchParams({
  limit: '10',
  'order[createdTime]': 'desc',
  'filter[stageId]': 'DT31_5:N',
})

const res = await fetch(`https://vibecode.bitrix24.com/v1/invoices?${params}`, {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { success, data, meta } = await res.json()
console.log(`Found: ${meta.total}`)
```

### JavaScript — OAuth application

```javascript
const params = new URLSearchParams({
  limit: '10',
  'order[createdTime]': 'desc',
  'filter[stageId]': 'DT31_5:N',
})

const res = await fetch(`https://vibecode.bitrix24.com/v1/invoices?${params}`, {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data, meta } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | array | Array of invoices. For all fields of an element, see [Invoice fields](/docs/entities/invoices/fields) |
| `meta.total` | number | Total number of records matching the filter |
| `meta.hasMore` | boolean | Whether there are more records beyond `limit` |

The card URL of any invoice from the `data` array is built from its `id`:

```
https://<portal>.bitrix24.com/crm/type/31/details/<id>/
```

`31` — the `entityTypeId` of the smart invoice in Bitrix24. `<portal>` — the Bitrix24 portal domain. Access is restricted by the employee's permissions in Bitrix24.

## Related data

The `include` parameter accepts three values — `contact`, `company`, and `deal`:

```
GET /v1/invoices?limit=10&include=contact,company,deal
```

The values are validated: any other value is rejected with `400 INVALID_INCLUDE`, and the error message lists the allowed values. Each element of the `data` array gets an `_included` block with the contact, company, and deal objects referenced by `contactId`, `companyId`, and `parentId2`. When the invoice has no such reference, `null` takes the object's place:

```json
{
  "id": 3,
  "contactId": 181,
  "companyId": 73,
  "parentId2": null,
  "_included": {
    "contact": { "id": 181 },
    "company": { "id": 73 },
    "deal": null
  }
}
```

The objects in `_included` are shortened to `id` here — the response carries every field of the record. For a general description of the mechanism, see [Related data](/docs/includes).

## Response example

Key fields are shown. For the full record, see [Invoice fields](/docs/entities/invoices/fields).

```json
{
  "success": true,
  "data": [
    {
      "id": 117,
      "title": "Invoice for services",
      "stageId": "DT31_5:N",
      "categoryId": 5,
      "contactId": 485,
      "companyId": 0,
      "opportunity": 1500,
      "currencyId": "USD",
      "assignedById": 1,
      "createdBy": 1,
      "createdTime": "2026-08-25T08:13:37.000Z",
      "updatedTime": "2026-08-25T08:13:37.000Z"
    },
    {
      "id": 113,
      "title": "Equipment installation",
      "stageId": "DT31_5:N",
      "categoryId": 5,
      "contactId": 42,
      "companyId": 15,
      "opportunity": 42000,
      "currencyId": "USD",
      "assignedById": 1,
      "createdBy": 1,
      "createdTime": "2026-08-19T11:02:14.000Z",
      "updatedTime": "2026-08-20T09:41:05.000Z"
    }
  ],
  "meta": {
    "total": 47,
    "hasMore": true
  }
}
```

## Error response example

400 — filter on a field that does not exist:

```json
{
  "success": false,
  "error": {
    "code": "UNKNOWN_FILTER_FIELD",
    "message": "Unknown filter field 'nosuchfield' for entity 'invoices'. Available: id, title, stageId, categoryId, assignedById, contactId, companyId, opportunity, currencyId, begindate, closedate, accountNumber, comments, mycompanyId, sourceId, sourceDescription, xmlId, opened, isManualOpportunity, isRecurring, createdBy, createdTime, updatedTime, updatedBy, movedBy, movedTime, previousStageId, lastCommunicationTime, lastCommunicationCallTime, lastCommunicationEmailTime, lastCommunicationImolTime, lastCommunicationWebformTime"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `UNKNOWN_FILTER_FIELD` | Filter on a field the invoice does not have. The error text lists the allowed names |
| 400 | `UNKNOWN_SORT_FIELD` | Sorting on a field the invoice does not have — in `order` or in the short `sort` form. The error text lists the allowed names |
| 400 | `INVALID_INCLUDE` | `include` carries a name the invoice does not have. The error text lists the allowed ones |
| 403 | `SCOPE_DENIED` | API key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | API key has no configured tokens |
| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal. All API keys of the portal share one limit. The current limit is returned in the `x-ratelimit-limit` header. Retry after the delay in the `Retry-After` header |

For the full list of common API errors, see [Errors](/docs/errors).

## Known specifics

**Custom fields arrive even when you do not request them.** Without `select`, every record also carries the `ufCrm_*` fields configured on the Bitrix24 account — on an account with hundreds of them the response grows many times over. List the names you need in `select`, and only those remain in the response.

## See also

- [Get invoice](/docs/entities/invoices/get)
- [Search invoices](/docs/entities/invoices/search)
- [Invoice fields](/docs/entities/invoices/fields)
- [Entity API](/docs/entity-api)
- [Limits and optimization](/docs/optimization)
