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 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.
Code
Pass a returned id as documentTemplateId on a document create or send to
render it with that template:
Code
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. |