# The head figures of a document list

Source: https://amanucci.com/nl/docs/developers/api/documents/getDocumentTotals

## GET /v1/entities/{entityId}/document-totals

The head figures of a document list

The head figures of one documents list: each a sum per currency with the count of the documents it sums, summed by the server over every row, so no page bound caps them. An invoice list carries what is owed, what is overdue and what was paid this month; a quote list what waits for an answer and what is accepted but not yet invoiced; a credit-note list what is still to settle; the purchases what is still to book and, over the payables, what the entity owes its suppliers, what of it is overdue, what it paid them this month, and what its suppliers' credit notes still give back or settled this month. `partyId` narrows them to one counterparty; `period` or `from`/`to` narrow what is still to book to the purchases received in those days, and an outbound kind, whose heads are the whole book's, refuses them (422).

Operation ID: `getDocumentTotals`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "entityId",
    "in": "path"
  },
  {
    "schema": {
      "type": "string",
      "format": "date",
      "description": "`kind=purchase` only: the first day received counted, inclusive (as `listDocuments` takes it)."
    },
    "required": false,
    "description": "`kind=purchase` only: the first day received counted, inclusive (as `listDocuments` takes it).",
    "name": "from",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "enum": [
        "credit_note",
        "invoice",
        "purchase",
        "quote"
      ],
      "description": "Whose list: `invoice`, `quote` or `credit_note`, or `purchase`, the received documents."
    },
    "required": true,
    "description": "Whose list: `invoice`, `quote` or `credit_note`, or `purchase`, the received documents.",
    "name": "kind",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid",
      "description": "One counterparty's documents only."
    },
    "required": false,
    "description": "One counterparty's documents only.",
    "name": "partyId",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "description": "`kind=purchase` only: the days received counted, the period `listDocuments` takes, resolved against today in the books' own day. Not with `from` or `to`.",
      "example": "quarter"
    },
    "required": false,
    "description": "`kind=purchase` only: the days received counted, the period `listDocuments` takes, resolved against today in the books' own day. Not with `from` or `to`.",
    "name": "period",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "format": "date",
      "description": "`kind=purchase` only: the last day received counted, inclusive."
    },
    "required": false,
    "description": "`kind=purchase` only: the last day received counted, inclusive.",
    "name": "to",
    "in": "query"
  }
]
```

### Responses

#### 200 The head figures.

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

#### 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"
    }
  }
}
```
