Skip to navigation

Download invoice PDF

View as Markdown

Returns the rendered invoice as a PDF binary stream. The document is rendered server-side — generation is CPU-intensive, so this endpoint has a dedicated rate limit of 30 requests per minute per API key (vs. the general 300/min limit for other API operations).

For SK and CZ workspaces an issued invoice is returned by default as ISDOC.PDF (PDF/A-3 with the ISDOC XML embedded; filename <number>.isdoc.pdf). It is still application/pdf and opens like any PDF. The plain PDF (filename <number>.pdf) is returned instead whenever ISDOC.PDF cannot be built — a draft or canceled invoice, a workspace outside SK/CZ, a document type ISDOC does not support, or a failed ISDOC build at request time — so this endpoint never fails or comes back empty for that reason. ?variant=plain forces the plain PDF explicitly — it is the only accepted value; omitting the parameter selects the default.

Caching: ETag is a weak validator derived from the invoice’s updated_at AND the requested variant, so ?variant=plain and the default never share an ETag for the same invoice. Clients sending If-None-Match with a matching ETag get a 304 Not Modified and skip regeneration entirely. A default response that fell back to the plain PDF because the ISDOC build failed at request time carries no ETag/Last-Modified and is sent with Cache-Control: no-store instead, so the transient failure is never pinned by a client or proxy cache.

Disposition control:

  • Default: Content-Disposition: attachment; filename=... (browser file download).
  • ?disposition=inline: Content-Disposition: inline; filename=... for embedded preview.

Required scope: read:invoices — PDF is the canonical machine-readable representation of an invoice, so any token that can read invoices can fetch their PDF.

Authentication

AuthorizationBearer

JWT issued via POST /api/v1/auth/sign_in. Used by mobile and SPA clients. Revoked tokens are rejected.

OR
AuthorizationBearer

Lucanto API key. Two prefixes:

  • lct_pat_<random><checksum> — personal access token (owner: User)
  • lct_live_<random><checksum> — workspace token, live data

Issue keys at /settings/api_keys (personal) or /:workspace_id/settings/api_keys (workspace). Plaintext token is shown once and never again.

Path parameters

workspace_idlongRequired>=1
Workspace ID. The numeric ID shown in your URLs.
idlong or stringRequired

Invoice ID. Either the numeric id or the public_id (doc_…).

Query parameters

dispositionenumOptionalDefaults to attachment

Whether the browser should download the file (attachment, the default) or render it inline for preview (inline). Values other than inline map to attachment server-side.

Allowed values:
variantenumOptional

plain forces the plain PDF instead of ISDOC.PDF and is the only accepted value. Omitting the parameter selects the default (ISDOC.PDF where it can exist).

Allowed values:

Response headers

Content-TypeenumOptional
Allowed values:
Content-DispositionstringOptional

attachment; filename="FAK2026-0001.isdoc.pdf" for the default artifact when ISDOC.PDF exists (or inline; filename="..." when ?disposition=inline); the plain PDF’s filename is the same number with .pdf instead of .isdoc.pdf.

ETagstringOptional

Weak ETag for conditional GETs, derived from updated_at and the variant. Absent — with Cache-Control: no-store — on a default-variant response that fell back to the plain PDF after a failed ISDOC build.

Response

OK. The rendered PDF.

Errors

401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error