Developers and ERP Teams
How do businesses implement Factur-X hybrid invoice generation?
Factur-X is a hybrid invoice format combining a human-readable PDF/A-3 with an embedded structured XML file conforming to EN 16931. Implementation requires: generating the XML invoice data from the ERP, embedding it into a PDF/A-3 using a PDF library, and ensuring the XML validates against the applicable Factur-X profile schema. Factur-X is the primary format accepted for the French e-invoicing mandate and ZUGFeRD in Germany.
Which Factur-X profile should businesses use?
Factur-X defines six conformance profiles with increasing data completeness:
- MINIMUM: Absolute minimum data set; sufficient for simple domestic invoices only
- BASIC WL: Without line items; header-level totals only; suitable for simple service invoices
- BASIC: Line-level detail without allowances and charges
- EN 16931: Full EN 16931 compliance with all mandatory and optional fields
- EXTENDED: Extended profile with additional optional fields for complex invoices
- XRECHNUNG: XRechnung-compatible profile for German public sector invoicing
- French mandate: The EN 16931 or EXTENDED profile is recommended for full French mandate compliance
Frequently Asked Questions
- What PDF library is used to embed XML in Factur-X?
- Factur-X embedding can be implemented using iText (Java/C#), PyPDF2 or reportlab (Python), Apache PDFBox (Java), or commercial libraries like PDFlib. The key requirement is that the output file is a valid PDF/A-3 document with the XML attached as an embedded file with the correct MIME type (application/xml) and AFRelationship of 'Data' or 'Alternative'. Open-source Python library 'factur-x' automates this process.
- How is Factur-X validated?
- Factur-X validation has two layers: PDF/A-3 compliance (validated by tools like VeraPDF) and XML schema validation against the applicable Factur-X profile XSD and Schematron rules. The French FNFE-MPE provides official Factur-X validation tools. Commercial validators and PDP services typically perform both layers automatically before invoice transmission.