DEV Community

Olivier EBRAHIM
Olivier EBRAHIM

Posted on

Factur-X 2026: Implementation Guide for Construction SMBs

Factur-X 2026: Implementation Guide for Construction SMBs

Introduction

In May 2026, the French government will mandate electronic invoicing (Factur-X) for all B2B transactions above a certain threshold. For construction SMBs, this shift represents both compliance necessity and an opportunity to modernize their financial workflows. Unlike previous e-invoicing standards, Factur-X combines machine-readable XML with a PDF carrier, making it human-readable while preserving data richness.

This guide walks developers and product teams through the concrete steps of implementing Factur-X 2026, based on lessons learned from equipping 50+ construction sites with modern billing infrastructure.

Understanding Factur-X Structure

Factur-X (officially EN 16931 XML) encodes invoice data in a standardized format that French tax authorities (DGFIP) can audit directly. Unlike simple PDF invoicing, Factur-X includes:

  • Structured invoice metadata (invoice number, date, amounts)
  • Line-item detail (service/material description, unit price, tax calculations)
  • Party information (seller SIRET, buyer details, payment terms)
  • Attachments (delivery notes, timesheet proofs, photos from jobsite)

The format is version-agnostic: you generate 2026-compliant Factur-X the same way you would for 2024 compliance, with validation rules applied server-side.

Why This Matters for Construction

Construction invoices are inherently complex. A typical SMB plumbing contractor might invoice:

  • Material costs (aggregated from supplier invoices)
  • Labor hours (from GPS-tracked timesheets)
  • Subcontractor work (outsourced tasks)
  • Change orders (scope additions approved by site manager)

Factur-X forces clarity: every line must specify unit, quantity, and tax code. This reduces disputes with customers and accelerates payment cycles because banks can parse invoices automatically.

Step 1: Choose a Factur-X Library

You don't need to hand-code XML. Established libraries exist for most stacks:

Node.js / TypeScript:

  • factur-x (npm) — French open-source, actively maintained
  • zugferd — broader German/French support, heavier but more features

Python:

  • facturx — reference implementation by the EU, ~2K lines
  • ubl-py — UBL (UN/CEFACT) compatibility, good for cross-border

C# / .NET:

  • ZugferdNet — battle-tested, commercial support available

PHP:

  • codeliner/php-invoice-generator + ZugferdLib

For a construction SaaS targeting French SMBs, we recommend Node.js + factur-x because:

  1. Modern API (async/await friendly)
  2. Active French maintainer
  3. Built-in validation against DGFIP test schemas
import FacturX from 'factur-x';

const invoice = new FacturX.Invoice({
  documentNumber: 'INV-2026-001',
  issueDate: new Date('2026-01-15'),
  seller: {
    name: 'SARL Constructions Martin',
    siret: '12345678901234', // 14 digits
    address: '42 Rue du Chantier, 75001 Paris'
  },
  buyer: {
    name: 'SARL Renovation Moderne',
    siret: '98765432109876',
    address: '10 Av. des Travaux, 75002 Paris'
  },
  lines: [
    {
      description: 'Installation tuyauterie étage 2 (8h)',
      quantity: 8,
      unit: 'HUR', // Hours
      unitPrice: 65.00,
      taxPercent: 20
    }
  ]
});

const pdfBuffer = await invoice.generatePDF();
Enter fullscreen mode Exit fullscreen mode

Step 2: Map Your Data Model

Before invoicing, audit your internal data structure. Factur-X mandates clarity on:

  • Line-item classification: Is this labor, material, or service? Tax codes differ.
  • Quantity units: Hours (HUR), days (DAY), kilograms (KGM), units (C62). Use ISO 20957.
  • Tax handling: VAT is 20% for most construction work, but materials bought by the customer are 0%. Track the seller's role.
  • Payment terms: Net 30? Net 60? Immediate? Factur-X documents this explicitly.

For Anodos, a jobsite management platform, the data flows like this:

Timesheet (GPS-tracked hours)
    ↓
Material log (from supplier invoice API)
    ↓
Change order (photo-proof, approved by MOE)
    ↓
Anodos Invoice Generator
    ↓
Factur-X XML + PDF
    ↓
DGFIP validation
Enter fullscreen mode Exit fullscreen mode

This enforces correctness: you can't invoice 8 hours if only 6 are logged; you can't add materials not on the jobsite.

Step 3: Handle Validation & Error Cases

The most common Factur-X bugs arise from mismatched tax codes or missing fields:

Problem 1: Missing SIRET

Error: Seller SIRET required and must be 14 digits
Enter fullscreen mode Exit fullscreen mode

Solution: Fetch SIRET from INSEE API (free, rate-limited). Cache it server-side to avoid repeated lookups.

Problem 2: Quantity = 0

Error: Line item quantity must be > 0
Enter fullscreen mode Exit fullscreen mode

Solution: Validate at the UI layer (timesheet entry must show at least 0.5 hour), not just at generation.

Problem 3: Mismatched tax amounts

Generated XML: Total tax = €24.00
Expected: €20.00 (20% of €100)
Enter fullscreen mode Exit fullscreen mode

Solution: Always recalculate totals server-side, never trust client math. Use decimal types (not floats) for money.

// ❌ Bad: floating-point math
const total = 100 * 0.20; // 19.999999999

// ✅ Good: fixed-point arithmetic
const total = Math.round(100 * 20) / 100; // 20.00
Enter fullscreen mode Exit fullscreen mode

Step 4: Testing Before Production

DGFIP provides a free validator at https://www.chorus-pro.gouv.fr/ (French government procurement portal). Before sending real invoices:

  1. Generate a test Factur-X file with dummy data
  2. Upload to the DGFIP validator
  3. Fix reported errors (usually field format or missing optional fields)
  4. Re-generate and re-upload until "valid"

Key test cases:

  • Single line, simple invoice (baseline)
  • Multi-line with mixed tax rates (20% + 10%)
  • Invoice with discount applied
  • Invoice with prepayment deducted
  • Cross-border (buyer in Spain, seller in France — VAT reverse-charge)

Allocate 1-2 weeks for this cycle. Rushing validation leads to rejected invoices in production.

Step 5: Integration with Accounting Systems

Once Factur-X is generated, SMBs need to import it into their accounting software (Sage, Ciel, Compta-Evolution, etc.). Most modern systems support XML import via REST API or file drop.

For construction SMBs using Anodos, the workflow is:

Jobsite invoice created in Anodos
    ↓
Anodos generates Factur-X (auto, in background)
    ↓
User exports to accounting software (1-click)
    ↓
Accounting system auto-validates Factur-X
    ↓
Posted to tax authorities (via Chorus-Pro, quarterly or real-time)
Enter fullscreen mode Exit fullscreen mode

This removes manual re-entry and drastically reduces errors.

Step 6: Compliance & Audit Trail

Factur-X invoices are immutable once sent. DGFIP audit requirements:

  • Retention: Keep Factur-X XML + PDF for 6 years
  • Audit trail: Log who generated the invoice, when, from which jobsite
  • Digital signature (optional but recommended): Sign the XML to prove non-repudiation
  • Amendment: If an invoice contains an error, issue a credit note (negative invoice), never delete

For construction SMBs with dozens of jobsites, this demands a robust database:

CREATE TABLE invoices (
  id UUID PRIMARY KEY,
  jobsite_id UUID REFERENCES jobsites(id),
  invoice_number VARCHAR(50) UNIQUE,
  generated_at TIMESTAMP,
  generated_by_user_id UUID,
  factur_x_xml BYTEA,
  factur_x_pdf BYTEA,
  status ENUM('draft', 'sent', 'paid', 'disputed'),
  sent_to_authority_at TIMESTAMP,
  INDEX (jobsite_id, invoice_number)
);
Enter fullscreen mode Exit fullscreen mode

Conclusion

Factur-X 2026 is not a burden—it's a lever for construction SMBs to digitalize their cash flow. Developers who implement it cleanly gain a competitive edge: fewer invoicing disputes, faster payment cycles, and automatic compliance with French tax law.

Key takeaways:

  1. Use a library, don't hand-code XML.
  2. Map your data before building (clarity on units, tax codes, payment terms).
  3. Test rigorously with the DGFIP validator before going live.
  4. Automate as much as possible (fetch SIRET, calculate tax, generate PDFs in the background).
  5. Audit trail everything—six years of retention is the law.

Start with a single jobsite, get feedback, then scale. By 2026, Factur-X invoicing will be table stakes for any French construction tech platform.


Olivier Ebrahim, founder of Anodos — a jobsite management platform that auto-generates Factur-X invoices from GPS-tracked timesheets and material logs.

Top comments (0)