1. EN 16931 semantic model versus national XML syntaxes
European standard EN 16931-1 defines a single semantic data model of business terms (BT-*, such as BT-1 Invoice number, BT-2 Issue date, BT-31 Seller VAT identifier) and business groups (BG-*) originally created for B2G public procurement under Directive 2014/55/EU and now adopted as the backbone of European B2B e-invoicing.
Two normative XML syntax bindings implement EN 16931: OASIS UBL 2.1 (Invoice / CreditNote) and UN/CEFACT Cross-Industry Invoice (CII D16B). Alongside pure EN 16931 profiles (CIUS), several EU Member States operate national fiscal-integrity or central-clearance schemas with additional fields:
- Peppol BIS Billing 3.0 (UBL 2.1): Cross-border CIUS requiring Electronic Address Scheme (
EAS) participant identifiers (cbc:EndpointID/@schemeID), ISO 4217 currencies, UN/ECE Recommendation 20 unit codes (C62,H87,HUR) and strict Schematron validation. - XRechnung & ZUGFeRD 2.x / Factur-X (Germany & France): Germany's B2B e-invoice receipt obligation (phased from 1 January 2025 under the
Wachstumschancengesetz) acceptsEN 16931-conformant formats including XRechnung (requiringBT-10buyer reference /Leitweg-IDon public contracts) and ZUGFeRD (PDF/A-3 embeddingfactur-x.xmlCII). - Spain Veri*factu (
Real Decreto 1007/2023&Orden HAC/1177/2024): Targets billing software integrity (SIF) under Spain's Anti-Fraud Law (Ley 11/2021) rather than Peppol UBL: each invoice record (RegistroAlta) computes a SHA-256 chain hash linking to the prior record, embeds a verifiableAEATQR URL, and can be remitted immediately inVERI*FACTUmode. - Poland KSeF (
Krajowy System e-Faktur): Centralised clearance platform using Poland's nationalFAstructured XML schema (FA(2)/FA(3)), where legal issuance ties to KSeF validation and assignment of a unique KSeF identification number.
2. Why Schematron rejects invoices that pass XSD validation
Validating an XML invoice against the W3C XSD grammar only proves that XML tags appear in the permitted sequence and data types. Every EN 16931 and Peppol Access Point gateway runs a second, stricter layer: XSLT / Schematron business rules.
The most common rejection reason in ERP exports is mixing per-line tax rounding with document-level VAT calculation. Under EN 16931: BT-106 (Sum of Invoice line net amounts) must equal the exact sum of every BT-131 (cbc:LineExtensionAmount, rounded to 2 decimals per line); BT-109 (Invoice total without VAT) equals BT-106 - BT-107 (allowances) + BT-108 (charges); and each BG-23 VAT breakdown group computes BT-117 = round(BT-116 × rate, 2) at the category subtotal level.
<cac:TaxTotal>
<cbc:TaxAmount currencyID="EUR">238.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="EUR">1252.63</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="EUR">238.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>19.00</cbc:Percent>
<cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:LegalMonetaryTotal>
<cbc:LineExtensionAmount currencyID="EUR">1252.63</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="EUR">1252.63</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="EUR">1490.63</cbc:TaxInclusiveAmount>
<cbc:PayableAmount currencyID="EUR">1490.63</cbc:PayableAmount>
</cac:LegalMonetaryTotal>3. Generating and validating structured XML deterministically
Our engine exposes two stateless operations for finance and ERP teams: POST /api/v1/engines/einvoice/build (1 credit unit, deterministic, zero LLM involvement) serialises a typed invoice object into peppol-bis-3, xrechnung, zugferd, verifactu or ksef XML and immediately runs rule checks; POST /api/v1/engines/einvoice/validate (0 credit units) validates an existing XML document and returns { valid, violations: { rule, severity, message, location }[] }.
Important boundary: XML construction and validation confirm technical syntax and EN 16931 / national schema rules. Determining whether a cross-border supply is standard-rated, zero-rated export (K intra-Community supply / G export) or subject to reverse charge (AE), and transmitting records using your organisation's qualified tax certificate or Peppol Access Point, remain with your finance team and accountant.