Preview an invoice

Render the invoice you are about to create, without creating it. The product module's invoice template is rendered against an unsaved invoice and returned as HTML. Nothing is persisted: no invoice row, no invoice number, no document and no events. The rendered invoice carries the placeholder reference INV-DRAFT, since a real invoice number is only allocated at finalisation.

Every field is optional, so an empty body renders the template's empty state. Unlike create an invoice, the selected entries do not have to be uninvoiced: nothing is written, so the only cost of previewing one is seeing it.

Guarded by invoices:create rather than invoices:read: the state being rendered only exists for someone building an invoice.

Invoicing is opt-in per organization: unless the invoicing feature flag is enabled for your organization this endpoint returns 403.

Path Params
string
required

Must be a UUID. The unique identifier of the policy to preview an invoice for.

Body Params
journal_entry_ids
array of uuids
length ≤ 500

The ledger journal entries to render as line items, in selection order. Capped at 500 because the preview renders in-process.

journal_entry_ids
string
length between 1 and 255

A free-form label passed through to the render template.

string
length ≤ 5000

A free-text note to the recipient, handed to the render template.

date

The date the invoice would fall due, as an ISO 8601 date.

Responses

400

Validation error. Examples: the product module has no invoice template configured, the template failed to render or timed out, a journal entry does not belong to the policy, or journal_entry_ids contains duplicates.

403

Invoicing is not enabled for the organization, or the caller is missing the invoices:create permission.

409

The policy has not been migrated to Root's current ledger.

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json