DEV Community

Olivier EBRAHIM
Olivier EBRAHIM

Posted on

Factur-X 2026: A Developer's Guide to French Construction Invoice Compliance

Factur-X 2026: A Developer's Guide to French Construction Invoice Compliance

The Problem Nobody Tells You About

You've built a construction management SaaS. It's gorgeous, the UI is smooth, the workflow is intuitive. Then you try to add invoicing, and a customer asks: "Does it support Factur-X 2026?"

If you're not familiar with Factur-X, here's the reality: as of January 1, 2026, Factur-X is no longer optional in France—it's the default invoice format for all businesses. For a construction SaaS targeting French SMBs, this isn't a nice-to-have feature. It's table stakes.

The problem? Most developers have never heard of it. Tutorials are sparse. And the EU standards documentation reads like tax code, not a technical spec. This guide cuts through the noise.

What Factur-X Actually Is

Factur-X (also called Zugferd 2.1.1 in the EU) is a hybrid PDF + XML invoice format. Here's the magic:

You take a standard PDF invoice (the human-readable part), and you embed a structured XML file inside it using the PDF/A-3 standard. The result is a single file that satisfies both:

  • Automated systems: accounting software, tax authority systems, and ERPs can parse the invoice without OCR
  • Humans: it still looks and feels like a regular PDF invoice

Why Should You Care?

  1. Tax compliance: DGFIP (Direction Générale des Finances Publiques) now requires Factur-X for all business-to-business invoicing in France
  2. No more manual data entry: Accounting departments can import invoices automatically
  3. Audit trail: Embedded XML is machine-verifiable, reducing audit risk for your customers
  4. International recognition: Zugferd/Factur-X is becoming the EU standard, so you future-proof your SaaS

The Common Misconception

Many devs confuse Factur-X with UBL (Universal Business Language) or think "we just export XML and we're done."

Wrong. Factur-X wraps UBL inside a PDF/A-3 container. If your billing system only exports UBL, you're 50% of the way there. You still need the PDF wrapper, the XSD schema validation, and PDF/A-3 compliance. Skip that, and tax authorities will reject it.

Core Fields That Trigger Compliance Checks

When you generate a Factur-X invoice for a construction company, these fields matter most:

Field Why It Matters Common Mistake
Seller SIRET DGFIP validates this against the official business registry. Wrong SIRET = rejection. Copy-paste errors from a business card. Always validate: 14 digits, no spaces.
Invoice Date Must logically match the project period, not the payment date. Dating invoices a month after work completion. DGFIP notices and audits.
Line Item Descriptions Tax authorities look for vague entries like "travaux BTP" (construction work). Be specific. Generic descriptions trigger random audits. Use UNSPSC codes (UN Standard Products and Services Code) for material categories.
Payment Terms "Net 30" in the invoice must match your sales contract. Mismatches raise flags. Saying "Net 30" in the invoice but billing "Net 45" in your contract. DGFIP compares both documents.
Reverse Charge Flag Only for B2B cross-border or EU transactions. Most construction SMBs never use it. Incorrectly flagging a domestic invoice as reverse-charge voids your tax treatment and creates compliance risk.

The Progress Billing Trap

Construction invoicing is never simple. You bill in stages: initial deposit, mid-project, final invoice, and sometimes levée de réserves (retention clearance after defect-free period).

Factur-X supports this, but you must link partial invoices using the InvoiceDocumentReference field. If you skip this:

  • The tax authority sees 3 separate invoices instead of 1 project
  • Customers can't reconcile the payments in their accounting system
  • Audit risk skyrockets

One missing InvoiceDocumentReference? Your customer now has compliance risk on their side too. Not great for product-market fit.

Building the Integration: Step-by-Step

Here's the real workflow for a construction SaaS like Anodos:

┌─ Jobsite Manager Creates Quote (mobile app)
│  └─ Voice AI fills in: site name, materials, labor hours
│
├─ System Generates Line Items
│  └─ Each item: description, qty, UNSPSC code, unit price
│
├─ Quote → Order (client approves in PDF)
│
├─ Generate Factur-X XML Payload
│  └─ Embed SIRET, invoice date, payment terms, linked invoices
│
├─ Create PDF/A-3 Wrapper
│  └─ Embed XML inside PDF using a library
│
├─ Sign Invoice (optional but recommended: XMLDSIG for non-repudiation)
│
└─ Upload to Customer Portal or Send via Email
   └─ DGFIP can validate the file directly
Enter fullscreen mode Exit fullscreen mode

Library Recommendations by Language

Python (recommended for speed):

pip install facturx
Enter fullscreen mode Exit fullscreen mode

The facturx library handles PDF/A-3 creation and XML embedding automatically. You just pass a PDF and an XML dict, and it does the rest. Minimal footprint.

Node.js (if you're Node-only):

npm install pdfplumber xml-builder
Enter fullscreen mode Exit fullscreen mode

More manual, but gives you control. You'll wrap the PDF yourself and validate the XML schema.

Java (enterprise grade):

<!-- Use iText 7 Community Edition with Factur-X add-on -->
Enter fullscreen mode Exit fullscreen mode

iText 7 handles Factur-X compliance out-of-the-box, but it's paid. Worth it if you're building at scale.

Common Failures & How to Debug Them

Error Root Cause Fix
"PDF is PDF/A-1, not PDF/A-3" Your PDF library defaulted to the wrong profile. Re-export with explicit PDF/A-3-B profile in your settings.
"XML schema validation failed" Missing a required Factur-X tag (e.g., InvoiceTypeCode). Run xmllint --schema against the embedded XSD and fix the missing field.
"SIRET not recognized by tax authority" Typo in seller SIRET, or you used SIREN (9 digits) instead of SIRET (14 digits). SIREN = company ID; SIRET = establishment ID. Always use SIRET. Validate format.
"Invoice shows as duplicate in accounting software" Missing InvoiceDocumentReference for progress billing. Link all partial invoices to the original quote ID.
"File opens in Acrobat but not in DGFIP portal" PDF metadata is missing or incorrectly formatted. Ensure your PDF creator stamps ISO 8601 dates and proper creator metadata.

Testing Checklist Before Production Deployment

Before you ship Factur-X invoicing to your customer base:

  • [ ] Generate a test invoice with a real SIRET (your own company or a test account)
  • [ ] Validate the file with DGFIP's official validator: https://www.dgfip.finances.gouv.fr/
  • [ ] Open the file in 3 different apps: Adobe Reader, LibreOffice, and your target accounting software
  • [ ] Extract the XML: unzip the PDF file (unzip invoice.pdf), check for facturx.xml or xfdf attachment
  • [ ] Verify that SIRET, invoice date, and line item descriptions are correctly embedded in the XML
  • [ ] For progress billing: create 2 linked invoices and confirm the InvoiceDocumentReference appears in the XML
  • [ ] Send a test invoice to a real accountant (beta customer) and ask them to import it into their accounting software. Get their feedback.

Pro tip: Set up a staging Factur-X pipeline and send test invoices to 3-5 construction SMBs in your beta program. Edge cases emerge fast: "Our accounting software rejects invoices with more than 50 line items." You want to know that before production.

Key Takeaways

  1. Factur-X is PDF + embedded XML, not just XML. Don't confuse it with UBL or think you're done if you export XML.
  2. SIRET validation, invoice dating, and line-item specificity are audit triggers. Get them right, or your customers face tax risk.
  3. Progress billing requires linked references. Missing InvoiceDocumentReference breaks the audit trail and looks suspicious to tax authorities.
  4. Use a library that handles PDF/A-3 natively. facturx in Python is battle-tested and worth every second you save.
  5. Test with DGFIP's validator and a real accountant before shipping to customers. Don't learn this in production.
  6. Construction invoices in France are now federally auditable via Factur-X. Compliance is non-negotiable.

Olivier Ebrahim – Founder of Anodos, a construction management SaaS for French SMBs built with Factur-X 2026 compliance from day one.

If you're building for the French construction industry and invoicing is a pain point for your customers, compliance is the feature that wins deals. Get it right.

Top comments (0)