DEV Community

Olivier EBRAHIM
Olivier EBRAHIM

Posted on

Factur-X 2026 Implementation Guide for SMB Construction

Factur-X 2026 Implementation Guide for SMB Construction

Introduction: Why Factur-X Matters for Your Chantier

If you're running a small to medium-sized construction firm in France, you've probably heard the buzz: Factur-X 2026 is coming, and it's not optional. Starting January 2026, French law (LEC—Loi d'Échange et de Consultation) mandates that all B2B invoices be issued in Factur-X format to ensure interoperability with government e-invoicing platforms.

Panic? Don't. This guide walks you through the technical reality: what Factur-X is, why it matters for your bottom line, and how to implement it without rebuilding your entire billing stack.

What is Factur-X? (And Why It's Not as Scary as It Sounds)

Factur-X is a hybrid XML + PDF invoice standard maintained by the French FNFE-MPE (Federation of Digital Economy). It combines:

  • PDF layer: A human-readable invoice you print or email (the familiar part).
  • XML layer: Structured, machine-readable metadata embedded in the PDF (the new part).

The Why

The French government wants to automate invoice processing. Instead of manual data entry or OCR (which introduces errors), government systems and large enterprises can parse Factur-X's XML backbone directly. This reduces payment cycles, cuts fraud, and improves supply chain visibility.

For you, as an SMB: if your invoices aren't Factur-X by 2026, B2B customers (especially public works contracts) can legally refuse them. Ouch.

The What

A Factur-X invoice looks identical to a PDF invoice to the human eye. But underneath:

<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100">
  <ExchangedDocumentContext>
    <GuidelineSpecifiedDocumentContextParameter>
      <ID>urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended</ID>
    </GuidelineSpecifiedDocumentContextParameter>
  </ExchangedDocumentContext>
  <ExchangedDocument>
    <ID>INV-2026-001</ID>
    <IssueDateTime>
      <DateTimeString format="102">20260115</DateTimeString>
    </IssueDateTime>
    <!-- More structured data: buyer, seller, line items, taxes, totals... -->
  </ExchangedDocument>
</Invoice>
Enter fullscreen mode Exit fullscreen mode

This XML is embedded in the PDF's metadata stream. A PDF reader ignores it; a government system extracts it.

Why Your Current Invoicing Software Might Not Be Ready

Most legacy construction invoicing tools (Excel macros, older QuickBooks, even some French SaaS) generate PDF-only invoices. They're not Factur-X-compliant.

Red flags:

  • Your software doesn't mention "Factur-X" or "e-invoice" in its roadmap.
  • Your invoice PDFs don't have visible metadata or XML attachments.
  • You're still manually re-entering invoice data into customer ERPs.

Solution space:

  1. Upgrade to a natively Factur-X-capable invoicing SaaS (many modern platforms like Anodos handle this out-of-the-box).
  2. Integrate a Factur-X generation library into your existing stack.
  3. Use a dedicated e-invoice conversion service (Chorus Pro integration, etc.).

Option 1 is usually easiest for SMBs. Option 2 works if you have a dev team and custom billing logic.

Technical Deep Dive: Implementing Factur-X from Scratch

If you're integrating Factur-X into existing software, here's the developer's checklist:

Step 1: Choose a Library

JavaScript/Node.js:

  • factur-x (npm) — mature, supports full Factur-X spec
  • invoice-xml — lighter weight, EN 16931 compliant

Python:

  • factur-x (PyPI) — official reference implementation
  • lxml + Factur-X schema — if you're rolling your own

Java:

  • mustangproject — robust, used by enterprises

PHP:

  • Factur-X/factur-x-php — wraps the Python library via subprocess

Pick one that's maintained and has > 100 stars on GitHub. Avoid 2-year-old abandoned repos.

Step 2: Generate XML from Your Invoice Data

Factur-X requires specific fields:

Seller info: company name, VAT ID, address, bank account
Buyer info: company name, VAT ID, address
Invoice lines: product/service, quantity, unit price, VAT rate
Totals: net, VAT, gross
Payment terms: due date, bank transfer details (BIC/IBAN)
Enter fullscreen mode Exit fullscreen mode

If your invoicing system already captures this (which it should), you'll serialize it to XML:

const facturX = require('factur-x');

const invoiceData = {
  invoiceNumber: 'INV-2026-001',
  issueDate: '2026-01-15',
  dueDate: '2026-02-15',
  seller: {
    name: 'Maçonnerie Dupont SARL',
    vatId: 'FR12345678901',
    address: '123 Rue de la Paix, 75000 Paris',
    bankAccount: 'FR1420041010050500013M02606'
  },
  buyer: {
    name: 'Constructa S.A.S.',
    vatId: 'FR98765432109',
    address: '456 Av. des Champs, 92100 Boulogne'
  },
  lines: [
    {
      description: 'Gros œuvre - fondations',
      quantity: 50,
      unit: '',
      unitPrice: 450.00,
      vatRate: 20
    },
    {
      description: 'Main d\'œuvre - pose',
      quantity: 80,
      unit: 'h',
      unitPrice: 65.00,
      vatRate: 20
    }
  ]
};

const xml = facturX.generateXml(invoiceData);
Enter fullscreen mode Exit fullscreen mode

Step 3: Embed XML in the PDF

This is where it gets fun. You need a PDF library that can write metadata streams:

const PDFDocument = require('pdfkit');
const fs = require('fs');

const doc = new PDFDocument();
const pdfStream = fs.createWriteStream('invoice.pdf');

doc.pipe(pdfStream);

// Render the visual invoice (as you normally would)
doc.fontSize(16).text('FACTURE', { align: 'center' });
doc.fontSize(12).text(`Numéro: ${invoiceData.invoiceNumber}`);
doc.text(`Date: ${invoiceData.issueDate}`);
// ... more PDF content ...

// Embed the Factur-X XML metadata
const xmlBuffer = Buffer.from(xml, 'utf8');
doc._writeObject({
  Type: 'EmbeddedFile',
  Subtype: 'application/xml',
  Length: xmlBuffer.length,
  DecodeParms: { Predictor: 12, Columns: 4 }
}, xmlBuffer);

doc.end();
Enter fullscreen mode Exit fullscreen mode

Most PDF libraries (iText, PDFSharp, Reportlab) support this. It's a one-time setup.

Step 4: Validate Against the Schema

Before shipping, validate your generated Factur-X against the official XSD schema:

xmllint --schema facturx_extended_schema.xsd invoice.xml
Enter fullscreen mode Exit fullscreen mode

Online validators also exist (Chorus Pro, CFCA validator) if you don't want to install xmllint locally.

Step 5: Integrate with Chorus Pro (French e-Invoice Hub)

Once Factur-X-ready, you can optionally submit invoices directly to Chorus Pro, France's national e-invoicing platform. This is required for public contracts by 2026, optional for private B2B today.

Chorus Pro API is SOAP/REST-based. Most modern accounting SaaS abstracts this away (you just toggle a checkbox to "submit to Chorus Pro automatically").

Common Gotchas

  1. VAT Rate Mismatch: Factur-X is strict about VAT. If your PDF says 19.6% but XML says 20%, validation fails. Use 20% for most French goods/services.

  2. Character Encoding: Always UTF-8. Non-ASCII characters (é, ç, à) must be properly encoded in XML or you'll get parsing errors.

  3. Timezone Issues: Invoice dates must be ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Timezones matter for audit trails.

  4. Missing IBAN/BIC: If you're doing bank transfers, Factur-X mandates both IBAN and BIC. If you leave them blank, government systems may reject the invoice.

  5. PDF Corruption: Embedding XML metadata can corrupt PDFs if done carelessly. Always test with Adobe Reader and standard PDF validators.

Migration Path: From Legacy to Factur-X

If you have thousands of invoices in your current system:

  1. Don't panic. You only need Factur-X going forward. Old invoices stay as-is.
  2. Test first. Generate 5-10 test invoices in Factur-X, have your accountant review them, submit to Chorus Pro sandbox.
  3. Soft launch. Start issuing Factur-X to customers who request it; make it opt-in for 3 months.
  4. Hard launch. January 1, 2026: all invoices Factur-X. Business as usual.

For platforms like Anodos that already handle Factur-X natively, migration is literally flipping a setting and reissuing your next invoice.

Bottom Line

Factur-X 2026 is real, mandatory, and closer than you think. But it's not a technical nightmare. If you're on modern SaaS, you're likely fine. If you're still on legacy or spreadsheets, now's the time to move.

The payoff: faster B2B payments, zero manual invoice reentry, and compliance with French law without a sweat.


Olivier Ebrahim, founder of Anodos — building construction SaaS for French SMBs.

Top comments (0)