Documentation
How to model, validate, convert and ship an EN 16931 European e-invoice with the en16931 Rust crates — from a first invoice to XRechnung, Peppol BIS Billing 3.0, UBL, CII and ZUGFeRD.
Start at Getting started if you want a verdict in five minutes. Start at The semantic model if you want to understand why the model is shaped the way it is before you build on it.
Every page here is about the crates. For the standard itself, the normative text is EN 16931-1:2017+A1:2019, and the artefacts are CEN’s on GitHub.
Getting started
Install the en16931 crates or the CLI, build your first EN 16931 invoice, reconcile the totals and read the validation report.
The semantic model
EN 16931's business terms and groups as Rust types: fixed-point amounts, calendar dates, per-cent percentages, signed quantities, and eighteen generated code lists.
Validation
The 334 EN 16931 business rules as Rust: the nine VAT category families, four tolerance regimes, severity from the authority, and reports in JSON or SVRL.
Profiles
XRechnung 3.0, Peppol BIS Billing 3.0 and the XRechnung Extension as EN 16931 profiles — CIUS versus Extension, restrictions as data, and the typed Validated<P> proof.
Syntaxes: UBL and CII
Read, write and convert UBL 2.1 and UN/CEFACT CII D16B through the EN 16931 semantic model — one call per task, generated element order, 1 218 prohibitions, and nothing dropped silently.
ZUGFeRD and Factur-X
Extract the CII payload from a ZUGFeRD or Factur-X hybrid PDF, embed a validated invoice into a PDF/A-3 file, compare the PDF's XMP metadata against the payload, and know which profiles are not EN 16931 invoices at all.
The command line
en16931-cli: validate, receive, convert, extract, embed, inspect and explain European e-invoices from one static binary, with exit codes a CI job can branch on.
Bridging a billing engine
Turn a derived billing document and a header into an EN 16931 invoice in one call — every amount read from the accessor of its business term, nothing recomputed — and render a BT-20 Skonto that BR-DE-18 accepts.
Conformance and performance
What is measured rather than claimed: CEN's unit tests, KoSIT's mutation suite, 59 published invoices, 500 documents round-tripped and crossed, and the benchmarks.
Contributing
Set up the en16931 workspace: fetch the CEN, KoSIT and Peppol artefacts, run the full CI gate locally, and regenerate the tables derived from the standard.