---
title: "Download an invoice file"
description: "Invoices API"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.certinvo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Download an invoice file

{/* Generated by apps/docs/scripts/generate.ts from contracts/api/openapi.yaml. Do not edit. */}
<div class="cvo-op">
<div class="cvo-op-main">

<div class="cvo-op-header">
<div class="cvo-op-path-row">
<span class="cvo-method" data-method="get">GET</span>
<code class="cvo-op-path-code">/v1/invoices/&#123;id&#125;/download</code>
</div>
</div>

Returns one file of an invoice, chosen with `format`. Stored files are returned exactly as stored. They are never rebuilt from the canonical model.

### Stored files

- `original`: the file exactly as it arrived.
- `source-file`: the customer's file an invoice made through a mapping was read from, exactly as it arrived, once for all the invoices in it. Its sha256 is the invoice's `sourceFile.sha256`. None for an invoice made from no file of the customer's (404).
- `ubl`, `cii`, `zugferd-pdf`, `peppol`, `en16931-ubl`, `en16931-cii`, `factur-x`, `extended-cii`, `zugferd-extended`: the files the writer produced, as written.
- `canonical`: the canonical model read from a received document, stored at filing. It is not a file anyone sent.
- `not-carried`: what the reader could not carry into the canonical model.
- `omissions`: what the files made for the invoice leave out, as JSON `{ uncarriable, omissions }`. Invoices filed before 2026-09-17 have none.
- `trace`: where each value of an invoice made through a mapping came from, as a JSON list with one entry per value: `at` (its place in the canonical model), `bt` (its business term, empty when the model names none) and `origin`, which is `source` with the `source` pointer it was read at in the customer's record, `card` for a constant the mapping sets, or `derived` with a sentence `from` saying what it was worked out from. An invoice nobody mapped, such as canonical JSON sent as it is, has none (404), and so has one filed before 2026-09-29.
- `gate-report`, `peppol-report`, `peppol-gate-report`: the validation reports. `gate-report` is the validator's HTML report (Prüfbericht).

If you request `ubl` or `cii` for a received document that does not carry that syntax, it is rendered from the canonical model. That rendering is not stored.

### DATEV files

Built at download time and never stored, because they depend on settings that can change:

- `datev-ledger`: the DATEV invoice data package (`application/zip`, containing document.xml, the ledger XML and the invoice PDF). It includes the accounts from `/v1/datev-settings` when there are any.
- `datev-extf`: the DATEV Buchungsstapel (`text/csv`, windows-1252). It requires `/v1/datev-settings`.

An invoice the company sent is booked as revenue. An invoice it received is booked as an expense.

## Path parameters

## Query parameters

## Status codes

| Status | Meaning |
|---|---|
| `200` | The file, with the media type it was stored with. |
| `401` | No usable credential was sent (`invalid_credentials`). |
| `404` | No such invoice exists for this company, or the invoice has no file in that format (`unknown_invoice`). Both cases use the same code. |
| `409` | The file is held back, or it cannot be made. The file is held back when you created the invoice and its newest verdict is `rejected` (`invoice_rejected`), or when it was never validated (`invoice_not_validated`). Re-check it at `/v1/invoices/{id}/validations` to resolve the second case. An invoice already sent is decided by the check it was sent with, while that check accepted it, so a later check does not hold its files back. A rulebook decision that waits for a fact, or reaches none, holds nothing back: the file leaves on the validator's verdict. A stored file is also held back when it is no longer the file the validator graded (`invoice_changed_since_check`): every check records a hash of the bytes it graded, and a file whose bytes no longer match that hash goes out on no verdict of its own. A PDF is compared by the XML it carries. A re-check grades the stored files, so it resolves this only when the stored file is still valid. A file made at download (a syntax, a PDF, a DATEV file) is held back the same way when the invoice data it would be made from is not the data the newest check recorded. Held back: every file meant for a buyer or a bookkeeper (`original`, `ubl`, `cii`, `zugferd-pdf`, `peppol`, `en16931-ubl`, `en16931-cii`, `factur-x`, `extended-cii`, `zugferd-extended`, `datev-ledger`, `datev-extf`). Always available: the files about the invoice (`gate-report`, `peppol-gate-report`, `peppol-report`, `canonical`, `not-carried`, `omissions`, `trace`), and the customer's own file it was made from (`source-file`). Received invoices are never held back, except the DATEV files of one your settings hold, because the gate rejected it or for its bank account, until a person releases it (`invoice_on_hold`). A syntax CONVERTED from one is a file we made, so it is decided by its own verdict and not by the received invoice's. A conversion with no verdict of its own is checked on the exact file built before it leaves, and that answer decides: a refusal is `invoice_rejected`. A held-back invoice's XML stays readable as text at `/v1/invoices/{id}/preview`. The file cannot be made when a syntax or the PDF cannot carry the document (`conversion_would_be_incomplete`), or when the DATEV settings or the invoice do not allow a DATEV file (`datev_export_refused`). The message gives the engine's reason. |
| `502` | The engine could not run, so no file was made (`engine_unavailable`). |

</div>
<div class="cvo-op-aside">

</div>
</div>

Source: https://docs.certinvo.com/reference/api/invoices/download-an-invoice-file/index.mdx
