What this template emits
A single invoice with two legs that travel together inside one PDF file.
The visual leg is a normal PDF invoice in your house style. Your customer's eye reads it the way they always read invoices.
The structured leg is a Cross Industry Invoice (CII) XML attachment embedded inside the same PDF, marked with AFRelationship="Alternative". The accounting software at the receiving end pulls the XML out of the PDF and books the invoice automatically. There is no need for a separate channel; the XML rides inside the PDF.
The CII syntax is published by UN/CEFACT and is functionally equivalent to UBL 2.1 for invoicing. Both encode the EN 16931 semantic model. ZUGFeRD picked CII for historical reasons; Belgium, the Nordics, and the Netherlands picked UBL. Anyone shipping both formats already shares the line-item data model.
The profiles, briefly
ZUGFeRD 2.1 ships in five profiles. From least to most data:
- MINIMUM carries only the totals. Useful for archiving.
- BASIC WL (without lines) carries header data and tax totals but no line items.
- BASIC carries everything EN 16931 requires. This is the profile that satisfies the German mandate.
- EN 16931 (also called COMFORT) adds optional fields the CEN standard allows.
- EXTENDED adds fields outside EN 16931 that some German receivers prefer.
The emitter defaults to BASIC. Pass a different profile constant if your receiver requires it.
What the German mandate actually says
Effective 2025-01-01, every German B2B receiver must accept e-invoices. Effective 2027-01-01, every B2B sender with prior-year revenue over EUR 800,000 must send e-invoices. Effective 2028-01-01, the requirement extends to all B2B senders. The format is whatever satisfies EN 16931, which in practice means ZUGFeRD BASIC or higher, or pure XML over Peppol.
The two-leg PDF approach is popular in Germany because it survives email channels and on-premise accounting systems that cannot accept network protocols.
Validation status
On 2026-06-03 our sample invoice (pkg/einvoice/SampleZUGFeRDInvoice) was validated with Mustang-CLI 2.23.1. The validator reports XML:valid for the claimed BASIC profile (urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic). Mustang's batch validator additionally checks XRechnung BR-DE-* and Peppol-on-CII rules; those rule packs report violations because we do not claim those profiles. The structured report is in test-results/validators/zugferd/mustang-report.txt in the repository.
What the validator checks
The Mustang-Project open-source validator is the de facto checker for ZUGFeRD. The Schematron rules are largely the same EN 16931 rules Peppol enforces. The format-specific additions:
GuidelineSpecifiedDocumentContextParameterID must match the profile you claim.- Embedded XML inside the PDF must be marked with
AFRelationship="Alternative". - The PDF wrapper must be PDF/A-3 conformant: embedded ICC color profile, XMP metadata identifying the conformance level, font subsetting.
Our Free and Starter tiers emit the CII XML standalone. The Pro tier embeds it inside a PDF/A-3 wrapper through the platform's Chromium engine.
Frequently asked questions
Does ZUGFeRD work outside Germany?
The Factur-X 1.0 BASIC profile and ZUGFeRD 2.1 BASIC are byte-identical. Factur-X is the French government's chosen format; Chorus Pro accepts it. The same template emits both.
What about ViDA in 2030?
The ViDA proposal mandates Peppol-compatible structured e-invoicing for cross-border EU B2B from 2030 with a phased rollout. ZUGFeRD will remain valid as a national format for German B2B; the cross-border leg will run over Peppol BIS Billing 3.0. The same line-item data model drives both emitters.