Document Automation
ZUGFeRD & Factur-X EU Invoices from Google Sheets
- ZUGFeRD
- Factur-X
- EU invoice
- compliance
- DocForge
Why "just send a PDF" stopped being good enough in Europe
Public-sector buyers across the EU now require structured electronic invoices that comply with the EN 16931 standard. Germany's ZUGFeRD and France's Factur-X profiles embed the XML inside a regular PDF/A-3, giving you one file that humans read and machines parse.
Suppliers that keep sending plain PDF face rejection notices, payment delays, and, increasingly, lost contracts. Doing this from a spreadsheet is possible—if the generator understands the standard.
Anatomy of a hybrid PDF/XML invoice
- PDF/A-3 container: archive-grade PDF with attachments allowed.
- Cross-Industry Invoice (CII) XML: the structured payload aligned with EN 16931.
- Conformance profile:
BASIC,EN16931, orEXTENDED—pick the minimum your buyer accepts. - Schematron validation: the safety net that catches missing buyer reference, wrong tax category, or invalid country code.
The mapping problem—solved once, reused forever
Most teams fail here. They have a perfect-looking PDF that ships without the XML, or the XML uses the wrong currency. A robust generator separates two concerns:
- Visual template (logo, layout, line items) for the human-readable PDF.
- Field mapping from Sheet columns to EN 16931 codes (
BT-1 Invoice number,BT-31 Seller VAT,BT-48 Buyer VAT, etc.).
Once mapped, every batch produces both layers in lockstep.
Profile selection cheat sheet
- BASIC: minimum for many B2B exchanges; lightest payload.
- EN 16931: required for most public-sector buyers and Peppol routing.
- EXTENDED: needed when you carry delivery, payment terms, or allowance details with item-level granularity.
Country specifics that bite
- Germany (XRechnung): mandatory profile for federal contracts; ZUGFeRD 2.x EN 16931 covers most cases.
- France (Chorus Pro): Factur-X EN 16931; specific buyer routing codes required.
- Italy (FatturaPA): separate format; consider it a downstream conversion from your EN 16931 source.
- Spain (FACe / Verifactu): evolving rules; keep the source EN 16931 and convert at the edge.
Validation strategy
- Run Schematron before you sign or send—catch 90% of structural issues.
- Test against a buyer sandbox (Peppol, Chorus Pro, etc.) before going live.
- Keep validation logs per invoice; auditors love them.
- Reject the batch on the first invalid invoice rather than send "best effort" PDFs that lack the XML.
Why this is impossible to maintain in Apps Script
The EN 16931 schema is large, the Schematron rules evolve, and country variants drift quarterly. An Apps Script project that works in May breaks in November when a buyer updates its rules. The pragmatic move is to let a maintained engine handle ZUGFeRD/Factur-X and keep your spreadsheet workflow intact.
Batch validation before your buyer rejects the file
EU buyers do not negotiate on hybrid invoices—they reject them. A ZUGFeRD or Factur-X file that looks fine in Preview mode may still fail Schematron because BT-49 buyer routing is blank or the tax category on line 3 does not match the VAT rate. Treat validation as a gate, not a post-mortem.
Run validation on every row in the batch before any PDF leaves Drive. If row 14 fails, the entire batch should pause until finance fixes the source sheet—not until someone notices a payment delay two weeks later.
Sheet columns mapped to EN 16931 business terms
| Sheet column | BT code | Common failure |
|---|---|---|
invoice_number | BT-1 | Duplicate or non-sequential after void |
seller_vat | BT-31 | Missing country prefix (DE123…) |
buyer_vat | BT-48 | Spaces or wrong checksum |
buyer_reference | BT-10 | Blank for public-sector buyers |
line_net_amount | BT-131 | Currency mismatch vs header |
tax_category | BT-151 | Standard vs zero-rated mislabel |
Profile rollout checklist for spreadsheet teams
- Ask your top five buyers which profile they accept: BASIC, EN16931, or EXTENDED—do not guess.
- Pick one test row with real VAT numbers and run it through Peppol or Chorus Pro sandbox.
- Archive the Schematron report next to the PDF in a read-only folder.
- Document which Sheet tab is the source of truth; clones break mapping silently.
- Schedule a quarterly re-test when country rules update (Germany XRechnung, France Factur-X).
Practical example: Monday invoice run
A Berlin SaaS vendor exports 90 rows every Monday from a shared Sheet. Without batch validation, three invoices ship with wrong buyer VAT and Chorus Pro rejects them on Tuesday. With a pre-flight gate, row 47 fails at 09:04 with BR-CL-01; finance fixes the cell, re-runs only that row, and all 90 files pass ingestion before noon. The spreadsheet workflow stays intact—only the generator enforces the standard.
Archiving hybrid invoices for audit
Store the PDF/A-3 and Schematron report in the same Drive folder with matching invoice number prefix. Auditors ask for proof the embedded XML existed at issuance—not regenerated later. Restrict folder delete to the service account and keep validation output for your tax retention period.
Document automation earns trust when ops owns the pipeline: weekly batch reviews, mapping change control, and a single owner who can explain every failed row to finance without opening three tools. Treat the generator like payroll—silent success, loud failures, zero mystery duplicates in numbering or filenames.
Where DocForge fits
DocForge embeds ZUGFeRD and Factur-X XML in every invoice rendered from Google Sheets, validates against Schematron, and stores the validation log in Drive alongside the PDF. Install from Google Workspace Marketplace and run your next EU invoice batch with confidence.
Related articles
Document Automation
Google Sheets to PDF in Bulk: The Complete 2026 Guide
Stop exporting rows one by one. Learn how to turn a Google Sheets tab into hundreds of branded PDFs—invoices, quotes, contracts—with template variables, auto numbering, and Drive delivery.
Document Automation
Invoice Numbering Without Pain: Automation for Google Sheets
Sequential, gap-free, audit-ready invoice numbers from Google Sheets—without the duplicate disasters every finance team has seen.
Document Automation
E-Sign From Google Sheets With a Real Audit Trail
How to add legally-defensible e-signature to documents generated from Google Sheets—hash chain, IP capture, signer identity, and a court-ready audit pack ZIP.