# Document Templates


Read the PDF design templates a document renders with over the LedgerBee public
API (base URL
[`https://api.ledgerbee.com/api/v1`](https://api.ledgerbee.com/api/v1)). A
template's `id` can be passed as `documentTemplateId` when creating or sending an
invoice, quote, or order confirmation to pick a specific design. Authenticate
with the `x-api-key` header.

Templates are configured in the LedgerBee app; the public API exposes them
read-only so a partner can discover an id to reference. There is one scope:

- `document-templates-read` — list templates.

The public API exposes templates for the four partner document types only:
`invoice-template`, `credit-note-template`, `quote-template`, and
`order-confirmation-template`. Choosing a template is optional; a document with
no `documentTemplateId` renders with the customer's or company's default design.

## Operations

| Operation | Endpoint | Scope |
| --- | --- | --- |
| List | `GET /v1/document-templates` | `document-templates-read` |

The list is paginated (`page`, `limit`), filterable by `documentType` and
`search`, and sortable by `name`, `documentType`, or `createdAt`. A type's
default template is the one flagged `isDefault: true`, not the first item in the
list; list position follows the requested sort, so rely on the `isDefault` flag.
See the
[list operation](/api/document-templates#list-document-templates).

```bash
curl 'https://api.ledgerbee.com/api/v1/document-templates?documentType=invoice-template' \
  -H 'x-api-key: <your-key>'
```

Pass a returned `id` as `documentTemplateId` on a document create or send to
render it with that template:

```bash
curl -X POST 'https://api.ledgerbee.com/api/v1/quotes' \
  -H 'x-api-key: <your-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "customerId": "0197a943-2325-7829-b835-b6c71a293065",
    "date": "2026-01-15",
    "documentTemplateId": "0197a943-2325-7829-b835-b6c71a293040",
    "lines": [
      { "priceId": "0197a943-2325-7829-b835-b6c71a293099", "quantity": 1 }
    ]
  }'
```

## Errors

| Condition | Error code | Fix |
| --- | --- | --- |
| `documentType` filter outside the four partner types | A 400 validation error | Filter by `invoice-template`, `credit-note-template`, `quote-template`, or `order-confirmation-template`. |
