PEPPOL BIS Billing 3.0 Validator V2
Validate a UBL invoice (Invoice or CreditNote) against EN 16931 and the OpenPEPPOL business rules, without sending a single byte beyond the browser.
Paste a UBL invoice conforming to PEPPOL BIS Billing 3.0 to validate it.
Embedded rule set: 45 business rules
(BR-*, BR-CO-* calculation, PEPPOL-*, UBL-CR-*),
57 EN 16931 Business Terms,
77 PEPPOL EAS codes,
1 profile. Sources:
docs.peppol.eu,
PEPPOL Schematron rules
and EN 16931-1:2017.
How it works
The validator runs three passes:
- XML well-formedness: your document is parsed by the
browser's native
DOMParser. Any mismatched tag or invalid XML character is reported first (E_XML_NOT_WELL_FORMED). - UBL root element: the root must be
<Invoice>or<CreditNote>in the UBL 2.1 namespace. Otherwise:E_NOT_UBL_ROOT. - PEPPOL BIS Billing 3.0 business rules: the
BR-NNandPEPPOL-EN16931-RNNNcodes listed below are checked against the document structure. Each diagnostic surfaces the EN 16931 Business Term (BT-1,BT-24, etc.) and the XPath of the offending element.
Implemented rules
The V2 validator targets 45 rules from the ~300 in the official
PEPPOL-EN16931-UBL.sch Schematron, grouped into four families:
Core EN 16931 — BR-01 → BR-20
BR-01— Specification identifier (BT-24) is PEPPOL BIS Billing 3.0.BR-02— Invoice number (BT-1).BR-03— Issue date (BT-2).BR-04— Invoice type code (BT-3) is 380, 381, 384, or 389 (CreditNote: 381, 396).BR-05— Currency code (BT-5) is ISO 4217.BR-06,BR-07— Seller (BT-27) and Buyer (BT-44) name.BR-08,BR-09— Country codes (BT-40, BT-55) ISO 3166-1.BR-10,BR-11— Electronic addresses (BT-34, BT-49) withschemeIDfrom the OASIS code list.BR-12,BR-13,BR-14,BR-15—LegalMonetaryTotaltotals (BT-106, BT-112, BT-109, BT-115).BR-16— At least one invoice line (BG-25).BR-17,BR-18,BR-19,BR-20— Payee name and tax representative party fields when present.
Calculation overall — BR-CO-*
Calculation rules check the arithmetic consistency of totals across lines, allowances, charges, and VAT categories. Default tolerance: ±0.011 (cent level) to absorb double-rounding.
BR-CO-3—TaxPointDate(BT-7) andInvoicePeriod/DescriptionCode(BT-8) are mutually exclusive.BR-CO-9— VAT category tax amount = base × rate ÷ 100 (BT-117 = BT-116 × BT-119/100).BR-CO-10— BT-106 (sum of lines) = arithmetic sum of BT-131.BR-CO-11— BT-107 (document allowances total) = sum of BT-92.BR-CO-12— BT-108 (document charges total) = sum of BT-99.BR-CO-13— BT-110 (total VAT) = sum of BT-117.BR-CO-14— BT-112 (total with VAT) = BT-109 + BT-110.BR-CO-15— BT-109 (total without VAT) = BT-106 − BT-107 + BT-108.BR-CO-16— BT-115 (amount due) = BT-112 − BT-113 + BT-114.BR-CO-17— BT-116 (VAT category taxable amount) ≥ 0.BR-CO-18— At least one VAT breakdown (BG-23 /cac:TaxTotal/cac:TaxSubtotal).BR-CO-19— Ifcac:InvoicePeriod(BG-14) is present, BT-73 and/or BT-74 must be filled, with BT-73 ≤ BT-74.BR-CO-25— Payment instructions when BT-115 > 0.
PEPPOL Schematron — PEPPOL-EN16931-R*
PEPPOL-EN16931-R001— No emptycbc:*elements.PEPPOL-EN16931-R002—cbc:Notemust not be the first child.PEPPOL-EN16931-R003—BuyerReference(BT-10) OROrderReference(BT-13) required.PEPPOL-EN16931-R004—CustomizationIDmust be the exact PEPPOL URN.PEPPOL-EN16931-R005,R007— Monetary amounts capped at 2 decimals.PEPPOL-EN16931-R006—cbc:ProfileID(BT-23) required.
PEPPOL UBL Customisation — UBL-CR-* (forbidden elements)
UBL-CR-001—cbc:UBLVersionIDforbidden (implied by the namespace).UBL-CR-002—cbc:ProfileExecutionIDforbidden (covered bycbc:ProfileID).UBL-CR-003—cbc:CopyIndicatorforbidden (transport-layer concern).UBL-CR-004—cbc:UUIDforbidden (BT-1 is the unique identifier).UBL-CR-005—cbc:IssueTimeforbidden (BT-2 is date precision).
Privacy
Limitations
The validator is not — yet — a 1:1 replacement for the official Schematron. Out of scope for this MVP:
- Full VAT rules (BR-AE-*, BR-E-*, BR-IC-*, BR-O-*, BR-S-*, BR-Z-*) that cross-check VAT category, exemption, rate, and country.
- Strict UBL 2.1 XSD validation (child cardinalities, XSD types) — we focus on Business Terms.
- Reference resolution across lines,
AllowanceCharge, andTaxTotal. -
Second-tier code-list rules:
UnitOfMeasure, UNTDID 4461PaymentMeansCode, UNTDID 5305 VAT category. -
DocumentReferencelinking and MIME types (BG-24).
For a production pipeline, running the official
PEPPOL-EN16931-UBL.sch Schematron remains the recommended
approach.
Related documentation
- PEPPOL — the network overview, four-corner model, and 2026 mandate calendar.
- EN 16931 — the European semantic model for the core elements of an electronic invoice.
- cXML Validator — same approach for Ariba / SAP Business Network documents.