# The document list

Source: https://amanucci.com/fr/docs/developers/api/documents/listDocuments

## GET /v1/entities/{entityId}/documents

The document list

This entity's documents, PAGED BY CURSOR (rule 5) — the domain is unbounded, one invoice a day is four thousand rows before the first retention period is up. The walk is `order`: `id`, the default, oldest first by insertion order (`uuidv7` is monotonic, so a document appended mid-walk is met on a later page rather than skipped), what an exporter pages to exhaustion; every other walk is a view, a key and a direction (the business day, inbound received in Europe/Brussels and outbound issued; the due date, a contact's Open with `partyId` and `open=true`; the party; the total; a quote's last valid day), its cursor its own. `period`, or `from` / `to`, narrow it to the business days named, and `amountFrom` / `amountTo` to the totals between them. Each row carries its party, file, source, uploader, payment state and live case; `inFlight` carries the files still being read and those whose reading failed while their case is open.

Operation ID: `listDocuments`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "entityId",
    "in": "path"
  },
  {
    "schema": {
      "type": "string",
      "pattern": "^-?\\d{1,14}(\\.\\d{1,4})?$",
      "example": "500",
      "description": "Only the documents whose total (`totals.taxInclusiveAmount`) is at least this decimal, inclusive, in their own currency; a document with no total yet never matches. Not above `amountTo`, compared as decimals."
    },
    "required": false,
    "description": "Only the documents whose total (`totals.taxInclusiveAmount`) is at least this decimal, inclusive, in their own currency; a document with no total yet never matches. Not above `amountTo`, compared as decimals.",
    "name": "amountFrom",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "pattern": "^-?\\d{1,14}(\\.\\d{1,4})?$",
      "example": "500",
      "description": "Only the documents whose total is at most this decimal, inclusive, in their own currency."
    },
    "required": false,
    "description": "Only the documents whose total is at most this decimal, inclusive, in their own currency.",
    "name": "amountTo",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "description": "An opaque position, taken verbatim from a previous response's `nextCursor`. Never construct one: its encoding is an implementation detail and may change within `/v1` (rule 6 governs FIELDS, not the contents of an opaque token)."
    },
    "required": false,
    "description": "An opaque position, taken verbatim from a previous response's `nextCursor`. Never construct one: its encoding is an implementation detail and may change within `/v1` (rule 6 governs FIELDS, not the contents of an opaque token).",
    "name": "cursor",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "enum": [
        "inbound",
        "outbound"
      ],
      "description": "Narrow the walk to one direction. The inbound side also carries `inFlight` — artifacts whose reading is still running, or failed with its case open, and that have no row yet."
    },
    "required": false,
    "description": "Narrow the walk to one direction. The inbound side also carries `inFlight` — artifacts whose reading is still running, or failed with its case open, and that have no row yet.",
    "name": "direction",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "format": "date",
      "description": "The first business day to include (inclusive, Europe/Brussels)."
    },
    "required": false,
    "description": "The first business day to include (inclusive, Europe/Brussels).",
    "name": "from",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "enum": [
        "quote",
        "invoice",
        "credit_note"
      ],
      "description": "Only the live documents of this kind, never a superseded one: a kind's list holds a revised quote's revision, not its original beside it."
    },
    "required": false,
    "description": "Only the live documents of this kind, never a superseded one: a kind's list holds a revised quote's revision, not its original beside it.",
    "name": "kind",
    "in": "query"
  },
  {
    "schema": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 200,
      "description": "How many rows at most. The hard ceiling is 200; a larger value is refused with 422, never silently reduced."
    },
    "required": false,
    "description": "How many rows at most. The hard ceiling is 200; a larger value is refused with 422, never silently reduced.",
    "name": "limit",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "enum": [
        "true",
        "false"
      ],
      "description": "`true`: only the documents still open at the business day, both directions: an invoice or credit note whose `document_open` is above zero (net of its pair,; an inbound one a payable, an unposted bill at its projected total, (b)); never a superseded one. With `kind=quote` it is a 422, never an empty page. `inFlight` is then empty."
    },
    "required": false,
    "description": "`true`: only the documents still open at the business day, both directions: an invoice or credit note whose `document_open` is above zero (net of its pair,; an inbound one a payable, an unposted bill at its projected total, (b)); never a superseded one. With `kind=quote` it is a 422, never an empty page. `inFlight` is then empty.",
    "name": "open",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "enum": [
        "id",
        "day",
        "due",
        "day.desc",
        "day.asc",
        "due.asc",
        "due.desc",
        "party.asc",
        "party.desc",
        "amount.asc",
        "amount.desc",
        "valid.asc",
        "valid.desc"
      ],
      "default": "id",
      "description": "The walk. `id` (the default): the log, oldest first by insertion order, stable under concurrent appends, what an exporter pages to exhaustion. `day`: newest business day first, then newest id. `due` (one walk with `due.asc`): oldest due date first, a row with none last, then the row's creation. Every other walk is a key and a direction, a view whose rows sharing the key come by the row's moment, else its creation, in the walk's direction, a row with no value for the key last both ways: `day.desc` / `day.asc` the business day (inbound: received; outbound: issued), two received the same day by the moment received; `due.desc`; `party.asc` / `.desc` the party's name; `amount.asc` / `.desc` the total, the entity's functional currency first and every other after it by code; `valid.asc` / `.desc` a quote's last valid day. A cursor resumes only the walk that minted it: change the order and start at the first page."
    },
    "required": false,
    "description": "The walk. `id` (the default): the log, oldest first by insertion order, stable under concurrent appends, what an exporter pages to exhaustion. `day`: newest business day first, then newest id. `due` (one walk with `due.asc`): oldest due date first, a row with none last, then the row's creation. Every other walk is a key and a direction, a view whose rows sharing the key come by the row's moment, else its creation, in the walk's direction, a row with no value for the key last both ways: `day.desc` / `day.asc` the business day (inbound: received; outbound: issued), two received the same day by the moment received; `due.desc`; `party.asc` / `.desc` the party's name; `amount.asc` / `.desc` the total, the entity's functional currency first and every other after it by code; `valid.asc` / `.desc` a quote's last valid day. A cursor resumes only the walk that minted it: change the order and start at the first page.",
    "name": "order",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "enum": [
        "true",
        "false"
      ],
      "description": "`true`: only the invoices `document_overdue_days` finds late at the business day, whatever their `status` (; an inbound one past the due date its supplier printed while it still owes, (b)), never a superseded one: the Overdue view, whose rows the `overdue` head figure sums. With another `kind` it is a 422, never an empty page. `inFlight` is then empty."
    },
    "required": false,
    "description": "`true`: only the invoices `document_overdue_days` finds late at the business day, whatever their `status` (; an inbound one past the due date its supplier printed while it still owes, (b)), never a superseded one: the Overdue view, whose rows the `overdue` head figure sums. With another `kind` it is a 422, never an empty page. `inFlight` is then empty.",
    "name": "overdue",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid",
      "description": "Only the documents naming this party, both directions. `inFlight` is then empty."
    },
    "required": false,
    "description": "Only the documents naming this party, both directions. `inFlight` is then empty.",
    "name": "partyId",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "description": "The days to list, resolved by the server against today in the books' own day (Europe/Brussels): `7d` and `30d` (the last 7 or 30 days, today included), `month`, `last-month`, `quarter`, `last-quarter` and `year` (the whole calendar unit holding today, or the one before it), a year `2026`, a quarter `2026-q3`, a month `2026-03`, `all` (no bound), or a day range `2026-01-05..2026-02-10` (inclusive, its ends in order). Not with `from` or `to`.",
      "example": "quarter"
    },
    "required": false,
    "description": "The days to list, resolved by the server against today in the books' own day (Europe/Brussels): `7d` and `30d` (the last 7 or 30 days, today included), `month`, `last-month`, `quarter`, `last-quarter` and `year` (the whole calendar unit holding today, or the one before it), a year `2026`, a quarter `2026-q3`, a month `2026-03`, `all` (no bound), or a day range `2026-01-05..2026-02-10` (inclusive, its ends in order). Not with `from` or `to`.",
    "name": "period",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "description": "A case-insensitive substring of the party's name, the document number or the file name (1..100 characters)."
    },
    "required": false,
    "description": "A case-insensitive substring of the party's name, the document number or the file name (1..100 characters).",
    "name": "q",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid",
      "description": "Only the invoices this recurring plan's runs made: a plan's Invoices. `inFlight` is then empty."
    },
    "required": false,
    "description": "Only the invoices this recurring plan's runs made: a plan's Invoices. `inFlight` is then empty.",
    "name": "recurringPlanId",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "enum": [
        "peppol",
        "codabox",
        "upload",
        "email_in",
        "mobile",
        "api",
        "system",
        "created"
      ],
      "description": "How the source file entered (`artifact.source`), or `created` for the documents originated here (outbound)."
    },
    "required": false,
    "description": "How the source file entered (`artifact.source`), or `created` for the documents originated here (outbound).",
    "name": "source",
    "in": "query"
  },
  {
    "schema": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "draft",
          "ready",
          "sent",
          "partially_paid",
          "paid",
          "credited",
          "settled",
          "accepted",
          "declined",
          "expired",
          "invoiced",
          "to_pay",
          "open"
        ]
      },
      "maxItems": 13,
      "description": "Only the documents whose `status` is one of these, at the business day, never a superseded one (a view lists what its head figure sums): the server filters, so a cursor-paged view and its chips agree. Repeat the key for several. With `kind`, each must be one of that kind's own in the list's `direction`, or in either without one (a `paid` quote and an outbound `to_pay` invoice are a 422, never an empty page). An inbound row with no status (still being read, a duplicate's loser) never matches; `inFlight` is then empty."
    },
    "required": false,
    "description": "Only the documents whose `status` is one of these, at the business day, never a superseded one (a view lists what its head figure sums): the server filters, so a cursor-paged view and its chips agree. Repeat the key for several. With `kind`, each must be one of that kind's own in the list's `direction`, or in either without one (a `paid` quote and an outbound `to_pay` invoice are a 422, never an empty page). An inbound row with no status (still being read, a duplicate's loser) never matches; `inFlight` is then empty.",
    "name": "status",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "format": "date",
      "description": "The last business day to include (inclusive, Europe/Brussels)."
    },
    "required": false,
    "description": "The last business day to include (inclusive, Europe/Brussels).",
    "name": "to",
    "in": "query"
  }
]
```

### Responses

#### 200 One page of documents.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/DocumentList"
    }
  }
}
```

#### 401 Dead or absent credential (`unauthenticated`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 403 Authenticated, present, and refused: a missing grant, a missing seat, or a missing step-up.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 404 Absent, or hidden from this asker — the two are indistinguishable (`not-found`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 422 The request did not satisfy the schema (`invalid-input`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 429 Too many requests on this door's bucket (`rate-limited`); refused before any handler ran, `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 503 Temporarily unavailable; `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```
