Document Templates
Read the PDF design templates a document renders with over the LedgerBee public
API (base URL
https://api.ledgerbee.com/api/v1). A
template's id can be passed as documentTemplateId when sending an invoice or
credit note 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.
Code
Pass a returned id as documentTemplateId when you send an invoice or a
credit note, to render that one document with that template:
Code
The field is accepted on the invoice and credit-note
send bodies. Everywhere else —
create calls, and quote / order-confirmation sends — the document renders with
the customer's or company's default design. The public API validates with
forbidNonWhitelisted, so passing the field where it isn't accepted returns a
400 rather than being ignored.
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. |