Structured e-invoicing is spreading across Europe, and Germany takes a big step on 1 January 2027. If your invoices come straight out of your own shop, booking system or custom application rather than accounting software, that is where the structured invoice has to be created, right where the invoice data lives.
I have been issuing my own invoices as ZUGFeRD since July 2026 and use the same technique in applications I build. Germany serves as the worked example here, but the format is identical to the French Factur-X and built on the European standard EN 16931, so most of it applies well beyond Germany.
Where e-invoicing becomes mandatory
The common ground in the EU is the European standard EN 16931. With ViDA, Council Directive (EU) 2025/516 adopted on 11 March 2025, e-invoicing becomes the basis for digital reporting on cross-border B2B transactions from 1 July 2030, and member states have been able to introduce domestic mandates since the directive entered into force in April 2025. Belgium has required structured B2B e-invoices since 1 January 2026, France for large and mid-sized companies since 1 September 2026.
Germany phases its mandate in through Section 27(38) of the VAT Act. The FAQ of the Federal Ministry of Finance, as of 29 October 2026, summarises the timeline like this:
| Period | Who | What applies |
|---|---|---|
| since 1 January 2025 | all domestic businesses | must be able to receive e-invoices, an email inbox is enough |
| until 31 December 2026 | everyone | paper or, with consent, PDF still allowed |
| 2027 | total turnover 2026 up to €800,000 | paper or PDF with consent still allowed |
| 2027 | total turnover 2026 above €800,000 | e-invoice mandatory |
| from 1 January 2028 | everyone | e-invoice mandatory |
The threshold refers to the total turnover of the previous calendar year, so 2026 counts for 2027. Exempt are invoices to consumers, small invoices up to €250 gross, travel tickets, small businesses under the German small business scheme and many VAT-exempt supplies. A PDF where an e-invoice is required is not an administrative offence, but the customer then lacks a proper invoice for input VAT deduction and has a civil-law claim to an e-invoice.
For software that bills business customers I recommend a clean cut. From January 2027 every invoice to a business becomes an e-invoice, even below the threshold. Nobody has to switch mid-year and customers get invoices their accounting imports without retyping. How much work sits on the receiving side I described using the example of a property management company.
Photo: Leeloo The First / Pexels
ZUGFeRD, Factur-X, XRechnung and the right profile
In Germany two formats dominate. XRechnung is pure XML without a visible document, maintained by KoSIT, the coordination office for IT standards. ZUGFeRD is a PDF/A-3 file carrying the XML as an attachment. People see the familiar invoice, the recipient’s software reads the XML. ZUGFeRD and the French Factur-X are the same specification under two names.
The German ministry accepts ZUGFeRD from version 2.0.1, except for the MINIMUM and BASIC-WL profiles, which carry no invoice lines. The current release is ZUGFeRD 2.5, published jointly with Factur-X 1.09 in June 2026.
For your own software I recommend the EN 16931 profile, formerly called COMFORT. It covers the full standard without fields only public authorities need. For invoices to German federal authorities, which require a routing ID called Leitweg-ID from €1,000, the same software generates an XRechnung from the same data.
One design rule comes first. If the PDF and XML of a hybrid invoice differ, the ministry treats the XML as authoritative. All mandatory VAT details must be in the structured part, a reference to an attached list is not enough. So PDF and XML are generated in a single pass from the same invoice data.
The data your software needs
A complete XML needs:
- invoice number (BT-1), invoice date and the delivery date (BT-72) or a delivery period
- seller name and address, plus VAT ID (BT-31) and national tax number (BT-32) in separate fields
- buyer name and address
- per line quantity, net amount, VAT rate and VAT category
- payment means and payment terms, with IBAN for bank transfers
Each line needs a VAT category. S is the standard rate, E means exempt with the reason as text (BT-120), Z is the zero rate. I derive the category in one single place from rate and tax status, so lines, allowances and the VAT breakdown always match.
If a business only has a national tax number, it also goes into the seller identifier (BT-29), because rule BR-CO-26 requires BT-29, BT-30 or BT-31. Optional fields without a value are left out entirely, an empty element violates the validation rules.
Gross prices and the rounding cent
Many shops work with gross prices. EN 16931 calculates net per line and VAT rate and derives the tax from that, which does not always add up to the cent. €74.00 gross at 19 percent gives a net amount of either €62.18, which is €73.99 including VAT, or €62.19, which is €74.01.
The standard provides the rounding amount BT-114 for this. Under rule BR-CO-16 the amount due equals the invoice total minus amounts already paid plus the rounding amount. The software puts the missing cent there, so the amount due matches exactly what was paid. In my implementation generation stops at a difference of more than ten cents, because that is a calculation error rather than rounding.
Until 31 December 2027 the German ministry also accepts gross-price invoices whose XML carries only totals per VAT rate, with the lines in an embedded attachment. I prefer the rounding amount, because then all lines are in the XML.
Discounts go into the XML as document-level allowances, grouped by VAT rate. Rule BR-27 does not allow a line with a negative price.
Photo: Bibek ghosh / Pexels
From invoice document to PDF/A-3b with embedded XML
The ZUGFeRD specification requires PDF/A-3, a format for long-term archiving, as the carrier. All fonts are embedded, an sRGB colour profile is stored as output intent and the metadata carry the PDF/A identification together with the Factur-X details and the description of their extension schema. The XML is attached as factur-x.xml, in the EN 16931 profile with the relationship “Alternative”, because it is an equivalent version of the invoice.
My pipeline looks like this:
invoice data
-> HTML template -> tagged PDF (Chromium)
-> PDF/A-3b, tags preserved
-> generate XML according to EN 16931, validate against the schema
-> embed XML as factur-x.xml
-> validate, archive, send
The order matters. Ghostscript and similar converters rewrite the whole file when converting to PDF/A and drop any existing attachment. Convert first, embed second.
In Python drafthorse builds the XML and factur-x embeds and validates it. In Node.js pdfkit writes PDF/A-3b directly, with embedded fonts and the freely usable sRGB profile of the International Color Consortium. Taking the creation date from the invoice instead of the clock makes the same invoice produce a byte-identical PDF, which keeps automated tests simple.
Tagged, not just compliant
PDF/A-3b does not require tags. A tagged PDF additionally carries a structure tree, the document language and a title. Screen readers read the invoice in the right order and copied text comes out as whole words.
Ghostscript, the common route to PDF/A, also drops the structure tree when it rewrites the file. I therefore generate a tagged PDF in Chromium, convert it to PDF/A-3b with a tool that preserves the structure and only then embed the XML. factur-x keeps the tags but writes conformance level B, so the result is PDF/A-3b with tags.
I compared both routes on 21 November 2026 with the same invoice from my own invoicing:
| Check | via Ghostscript | tagged |
|---|---|---|
| Accessibility (32-rule check) | 22 passed, 4 failed | 26 passed, 0 failed |
| PDF/A-3b | compliant | compliant |
| embedded XML | schema-valid | schema-valid, byte-identical |
| text layer | words split apart | words intact |
| file size | 356 KB | 137 KB |
The XML is identical in both cases, the tagged file is simply easier to read and much smaller.
Photo: Yan Krukau / Pexels
Validate before sending
According to the German ministry, validation is not a precondition for tax recognition, but it recommends validating at creation and dispatch. Four free checks do the job, and I run them in sequence:
- veraPDF checks that the PDF really is PDF/A-3b.
- The Python package factur-x extracts the attachment, compares it with the generated XML and validates it against the schema.
- The Factur-X Schematron for the EN 16931 profile, shipped in the same package, checks the business rules.
- The KoSIT validator version 1.6.3 with the XRechnung 3.0.2 configuration of 31 August 2026 checks the XML in the EN 16931 and XRechnung scenarios.
On 2 October 2026 I ran six sample invoices covering the usual tax cases through this chain, from standard and mixed VAT rates with a discount to a cancellation and a VAT-exempt invoice. All six were PDF/A-3b according to veraPDF, all attachments matched the XML, the Schematron found no violation and the KoSIT validator accepted all of them in the EN 16931 scenario without a message.
This chain runs with every change to the invoicing code. In daily use the software checks beforehand that all data is present and names any missing field, such as a tax number or an address.
Photo: Pavel Danilyuk / Pexels
German law requires invoices to be kept for eight years, the structured part of an e-invoice unaltered in its original form. The software therefore archives exactly the file it sent.
If your invoices come out of your own shop or booking system and you want them to go out as validated e-invoices from January, feel free to get in touch.
FAQ
When do German businesses have to issue e-invoices?+
It depends on the previous year's total turnover. Businesses with more than €800,000 in 2026 must issue e-invoices to domestic business customers for supplies from 1 January 2027. Smaller businesses may keep sending paper or, with the recipient's consent, PDF invoices until the end of 2027. From 1 January 2028 the obligation applies to all domestic B2B invoices.
Is a ZUGFeRD or Factur-X invoice a valid e-invoice?+
Yes. The German Federal Ministry of Finance accepts ZUGFeRD from version 2.0.1, except for the MINIMUM and BASIC-WL profiles. ZUGFeRD is a PDF/A-3 file with an embedded XML file following the European standard EN 16931, and it is technically identical to the French Factur-X. The current version is ZUGFeRD 2.5 (Factur-X 1.09) from June 2026.
Does an e-invoice have to be validated before sending?+
There is no legal requirement, but the German Federal Ministry of Finance explicitly recommends validating at creation and dispatch. Validation reveals missing or inconsistent data before the recipient rejects the file. Free tools are the KoSIT validator for the XML, veraPDF for the PDF/A-3 and the Python package factur-x for the embedded attachment.
What does ViDA mean for e-invoicing in the EU?+
ViDA, Council Directive (EU) 2025/516 adopted on 11 March 2025, makes e-invoicing the basis for digital reporting on cross-border B2B transactions from 1 July 2030. Since the directive entered into force in April 2025, member states can introduce domestic e-invoicing mandates. Belgium has required structured B2B e-invoices since 1 January 2026, France for large and mid-sized companies since 1 September 2026.
Why should the PDF of an e-invoice be tagged?+
Because a tagged PDF gives screen readers a structure and keeps the text layer clean. The ZUGFeRD specification requires PDF/A-3 but not tags, so tagging is a recommendation. In my measurement on 21 November 2026 the tagged version was also much smaller, 137 KB instead of 356 KB.
Want to know more?
In a free intro call we look at how you can put these topics to work in your company and what is worth it for you.
Book a free intro call



