---
title: "Return the invoice as a PDF (rendering it if needed)."
method: POST
path: "/core/v1/invoices/{id}/printed-document"
tags: ["Finance"]
---

# Return the invoice as a PDF (rendering it if needed).

`POST /core/v1/invoices/{id}/printed-document`

## Request

- Base URL: `https://api.klara.ch`
- URL: `https://api.klara.ch/core/v1/invoices/{id}/printed-document`
- Auth: one of:
  - API key in header `X-API-KEY`
  - HTTP bearer

Returns the invoice document as a binary <code>application/pdf</code> stream via the internal Klara printing pipeline (<code>luz_web</code> + Aspose Words), mirroring the behaviour of the Klara GUI. The caller must hold the <code>FINANCE</code> permission on the target company.<br/><br/><strong>Reuse vs. render</strong> (mirrors the Klara GUI): if the invoice was already printed, the previously rendered PDF is fetched from storage and returned as-is; if it was not yet printed, it is rendered now and the <code>printedFileId</code> is stored on the invoice record. In both cases the response body is the binary PDF with a <code>Content-Disposition: attachment</code> header containing the suggested filename. This is a <code>POST</code> (not <code>GET</code>) because the first print persists the <code>printedFileId</code>.

## Path parameters

- `id` integer, required

## Response `200`

Invoice PDF returned as a binary <code>application/pdf</code> stream with a <code>Content-Disposition: attachment</code> header — either freshly rendered (first print) or the previously stored PDF (already printed).

## Other responses

- `401`: No Authorization header found or invalid token<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `403`: The current user is not allowed to access this company data<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `404`: Invoice not found.<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `429`: API rate limit exceeded<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `500`: Something went wrong on our side while processing the request. Please kindly contact our support.<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.

---

[API](https://skmtc.dev/klara/apis/klara-public-api.md) · [All operations](https://skmtc.dev/klara/apis/klara-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/klara/apis/klara-public-api/revisions/490b1a879fc2?raw)
