Archiving e-invoices: what GoBD really requires from the XML

What GoBD requires when archiving e-invoices: retention period, immutability, and why the XML is the original.

Hand-drawn sketch: an open archive box with a single folder inside

GoBD requires you to archive e-invoices in their structured original format, that is as a pure XML file for XRechnung and as embedded XML for ZUGFeRD, not just as a PDF or screen view. The retention period under Section 147 of the German Fiscal Code (Abgabenordnung) is eight years from the end of the calendar year in which the invoice was issued or received, and during this time the document must remain complete, unaltered, and machine-readable. As of: August 2026.

Why does the XML file count as the original and not the PDF view?

The XML file is legally the original, because it carries the actual, machine-readable invoice data, while a PDF view is only a visualization of this data. For XRechnung there is only the XML file anyway, a PDF exists at most as an additional, self-generated view for humans. For ZUGFeRD, the XML is embedded as a file within a PDF/A-3 document, and in case of doubt, according to the GoBD principles of orderliness, the structured data is authoritative, not the layout. Anyone who only saves the PDF and discards the XML is, by this reading, archiving not the original but a copy.

How long must you retain e-invoices?

The retention period is eight years under Section 147 (3) AO, calculated from the end of the calendar year of invoicing or receipt. This applies regardless of company size and regardless of whether the invoice is outgoing or incoming, as long as it is tax-relevant. You can find the exact legal text at Section 147 AO. After the period expires you may delete, not before, even if an accounting system is changed.

What does immutability mean in practice?

Immutability means that an archived invoice may not be altered in content or through deletion at any point during the entire retention period, without the change being traceably logged. In practice, this means: no storage in a normal file system, from which anyone with write permissions can overwrite or delete a file, but rather a system with versioning, an access log, and ideally WORM storage (Write Once, Read Many). The Verband elektronische Rechnung summarizes the twelve central rules for a GoBD-compliant invoice exchange, including traceability, completeness, and order as further core principles alongside immutability.

How can archiving be automated?

Archiving can be automated by routing incoming e-invoices directly from the mailbox or Peppol access into a GoBD-compliant archive system, without anyone manually saving a PDF and discarding the XML. An automation tool such as n8n can detect incoming emails with invoice attachments, extract the XML file, validate it, and place it together with a reference to the original into a document management system or an audit-proof storage system. Important here: the workflow must not merely convert the XML into a PDF for display and then discard it, but must pass through the original file. NordFlux builds such archiving pipelines as part of n8n automation for businesses that don't want to handle their e-invoicing obligations manually.

Frequently asked questions about e-invoice archiving

Do I also have to keep the PDF visualization?

No, strictly only the XML file is the GoBD-relevant original; you may keep an additional PDF view, but you don't have to. If you generate a PDF for internal filing, that does not replace the obligation to retain the XML file unaltered. Many businesses keep both for practicality's sake, which is permitted, but the XML remains the authoritative source in case of a dispute.

Is a regular cloud storage service like OneDrive sufficient for archiving?

An ordinary cloud storage service without versioning and deletion protection generally does not meet the GoBD requirements for immutability, because files there can be overwritten or silently deleted. For legally compliant archiving you need a system with a documented change log that technically prevents deletions before the retention period expires, or at least logs them. Some cloud providers offer optional compliance or retention features for this, which must be activated separately.

What happens when you switch accounting systems?

When switching systems, the archived e-invoices must remain readable and analyzable, either through migration to the new system or through continued read access to the old system until the end of the retention period. A mere export as PDF without the underlying XML is not sufficient for this. Plan a system switch accordingly, with sufficient lead time for data migration.

Does the retention obligation also apply to small business owners?

Yes, the obligation under Section 147 AO applies regardless of the small-business regulation under Section 19 UStG, as long as the documents are tax-relevant. Since the e-invoicing obligation took effect in 2025, small business owners must also be able to receive and archive incoming e-invoices accordingly, even though for now they may still issue paper or PDF invoices themselves.

About NordFlux

NordFlux UG (haftungsbeschränkt)

NordFlux builds digital employees for organisations: automations and AI agents that take over repetitive work. You stay in control.

More about us
Free initial analysis

Concrete questions about automation or AI?

In a free initial analysis we discuss your case directly. No strings attached.