Factur-X 2026: Implementation Guide for SMB Construction Software
When I started building invoicing systems for construction SMBs, I quickly discovered that French regulatory compliance isn't optional—it's the foundation. Factur-X 2026 is no longer a nice-to-have feature; it's a legal requirement for all French businesses issuing B2B invoices after January 1, 2026. This guide walks you through the technical implementation from a developer's perspective.
What is Factur-X and Why It Matters
Factur-X is an hybrid invoice format that embeds structured XML data within a PDF file. The XML follows the ORDC (OASIS Reutilizable Component) standard, while the PDF remains human-readable. For construction businesses tracking materials, labor hours, and subcontractor costs, this dual format solves a critical pain point: compliance without sacrificing usability.
Here's the catch: many construction SMBs still issue invoices via Excel, email PDFs, or fragmented spreadsheets. They'll have roughly 12 months to transition. If your SaaS targets this market, Factur-X implementation is now a competitive feature, not a novelty.
The Numbers
- Compliance deadline: January 1, 2026 for B2B invoices in France
- Current adoption: ~8% of French SMBs (as of mid-2025)
- Penalty risk: Up to €15,000 per non-compliant invoice if audited
- Integration complexity: Medium (2-4 weeks for a junior dev with documentation)
Technical Architecture: The Big Picture
Factur-X invoices consist of three layers:
- PDF Layer — the human-readable invoice (standard PDF structure)
- XML Layer — machine-readable invoice data (embedded in PDF metadata)
- Attachment Layer — optional files (certification docs, proof of delivery, technical specs)
The XML validates against the Factur-X UBL schema. You'll need:
- An XML library (e.g.,
lxmlin Python,System.Xmlin .NET,xml2jsin Node) - A PDF manipulation library (
pypdf,pdfkit,iText,PDFSharp) - Access to the official Factur-X standard documentation from the French e-invoicing authority (DGFIP)
Step 1: Generate the XML Payload
The XML contains invoice metadata: invoice number, dates, amounts, VAT, parties involved, and line items.
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
xmlns:udt="urn:un:unece:uncefact:data:model:datatypes:StructuredDatatypes:100">
<ExchangedDocumentContext>
<GuidelineSpecifiedDocumentContextParameter>
<ID>urn:factur-x.eu:1p0:extended</ID>
</GuidelineSpecifiedDocumentContextParameter>
</ExchangedDocumentContext>
<ExchangedDocument>
<ID>INV-2026-00142</ID>
<TypeCode>380</TypeCode>
<IssueDateTime>
<DateTimeString format="102">20260315</DateTimeString>
</IssueDateTime>
</ExchangedDocument>
<SupplyChainTradeTransaction>
<!-- Seller, buyer, line items, payment terms, etc. -->
</SupplyChainTradeTransaction>
</Invoice>
Key fields for construction invoicing:
-
TypeCode: 380 = commercial invoice, 381 = credit note -
LineItem/SpecifiedTradeProduct/Name: material or labor description -
LineItem/SpecifiedLineTradeAgreement/NetPriceProductTradePrice/ChargeAmount: unit cost -
LineItem/SpecifiedLineTradeSettlement/ApplicableTradeTax/CalculatedAmount: VAT per line -
SpecifiedTradePaymentTerms/Description: payment deadline, e.g., "Net 30"
For construction projects with subcontractor markup or material cost variations, you'll often have 10-50 line items. Structure your XML generation to loop through invoice line items and calculate VAT at each level.
Step 2: Embed XML into PDF
The XML must be attached to the PDF as a file attachment, and the PDF must reference it via metadata entries.
Using Python + pypdf + lxml:
from pypdf import PdfWriter
from pathlib import Path
# 1. Generate PDF (using ReportLab or wkhtmltopdf)
pdf_path = "invoice.pdf"
xml_content = generate_factur_x_xml(invoice_data)
# 2. Open PDF and attach XML
pdf_writer = PdfWriter()
pdf_reader = PdfReader(pdf_path)
for page in pdf_reader.pages:
pdf_writer.add_page(page)
# 3. Attach XML as embedded file
pdf_writer.add_attachment("factur-x.xml", xml_content)
# 4. Write output
with open("invoice_factur_x.pdf", "wb") as output_file:
pdf_writer.write(output_file)
Using Node.js + pdf-lib + pdfkit:
For more control over PDF metadata, consider iText (Java / .NET) or commercial libraries certified by the French e-invoicing authority. They handle the PDF/A-3 compliance layer automatically.
Step 3: Validate Against Factur-X Schema
Before sending an invoice to customers or archiving it, validate the XML:
from lxml import etree
# Load schema
schema_doc = etree.parse("facturx_schema.xsd")
schema = etree.XMLSchema(schema_doc)
# Validate
xml_doc = etree.fromstring(xml_content.encode())
is_valid = schema.validate(xml_doc)
if not is_valid:
print(schema.error_log)
Common validation failures:
- Missing mandatory fields (seller VAT ID, buyer name, invoice date, amounts)
- Amount mismatches (sum of line items ≠ total, VAT calculation error)
- Invalid VAT rates (France: 0%, 5.5%, 10%, 20% depending on goods/services)
- Malformed dates (must be YYYYMMDD in
DateTimeString)
Step 4: Handle Archival and Transmission
Factur-X invoices must be retained for 6 years per French tax law. Store them:
- In their native PDF form (human-readable, auditor-friendly)
- With a checksum or digital signature for integrity
For B2B transmission to large customers (e.g., government bodies, enterprises), many now require Factur-X. Your SaaS should offer:
- Download as PDF-A-3 (archival format)
- Email transmission (PDF attachment)
- Optional: API endpoint for direct B2B routing (via Chorus Pro, the French government e-invoicing portal)
Real-World Pitfalls
Pitfall 1: VAT Rounding
Construction invoices often split VAT by line item. If you sum line-item VATs and encounter rounding errors, your total VAT won't match the PDF total. Solution: calculate total first, then allocate per-line.
Pitfall 2: Subcontractor Reverse Charge
If your customer is a subcontractor invoicing a builder, VAT may be reverse-charged (invoiced at 0%, with the buyer paying VAT). Your XML must reflect this via ExemptionReason tags.
Pitfall 3: PDF/A-3 Compliance
Some workflows require PDF/A-3 (ISO 19005-3) archival standard. Regular PDFs fail validation. Use a certified library or get your PDF certified post-generation.
Pitfall 4: Test Data
The French tax authority publishes test VAT IDs and examples. Use them before going live. Real VAT IDs that fail validation will bounce in production.
Integration with Anodos
At Anodos, we handle Factur-X generation transparently—developers focus on business logic, not XML schemas. Our API generates compliant invoices with a single POST request, validates against DGFIP standards, and archives PDFs in your preferred cloud storage.
Conclusion
Factur-X 2026 compliance is now table-stakes for French construction SaaS. The technical lift is modest—4-6 weeks for a skilled team—but the regulatory stakes are high. Start with XML generation, move to PDF embedding, validate rigorously, and test with real VAT IDs before launch.
The construction industry will eventually thank you for this compliance layer. Your customers will thank you even sooner when audits become frictionless.
Olivier Ebrahim, founder of Anodos — SaaS for construction project management, invoicing, and field operations across France.
Top comments (0)