Toolkit reference
Toolkit reference documentation
Shared rule packs, validation response schema, CLI exit codes and licence notices across the PHP SDK, GitHub CI Action and self-hosted validator.
Rule pack 2026.11.1
Both the PHP SDK and the self-hosted validator pin the exact same upstream rule artefacts as the hosted W System API (KoSIT XRechnung release 2026-08-31, SHA-256 2530cd107c414511c5d0462ec10f886910395abfca820db82e83d70bf01221a8). Peppol BIS Billing 3.0 rules (PEPPOL-EN16931-*) are not included.
| Component | Version | Licence | Upstream |
|---|---|---|---|
| KoSIT XRechnung validator configuration | 3.0.2 (2026-08-31) | Apache-2.0 | itplr-kosit/validator-configuration-xrechnung |
| CEN/TC 434 EN 16931 validation artefacts | 1.3.16 | EUPL-1.2 (unmodified) | ConnectingEurope/eInvoicing-EN16931 |
| KoSIT XRechnung Schematron | 2.4.0 | Apache-2.0 | itplr-kosit/xrechnung-schematron |
Saxon-HE (saxonche / SaxonC-HE) | 13.x | MPL-2.0 | Saxonica Ltd |
lxml, pypdf | 6.x / 7.x | BSD-3-Clause | PyPI |
Validation JSON output shape
Every toolkit component produces the same validation shape as POST /einvoice/validate:
{
"valid": false,
"container": "xml",
"syntax": "ubl",
"profile": "XRechnung 3.0",
"error_count": 1,
"warning_count": 0,
"checked": {
"xsd": true,
"EN16931": true,
"XRechnung": "3.0",
"PeppolBIS3": false
},
"errors": [
{
"rule_id": "BR-DE-15",
"severity": "error",
"ruleset": "XRechnung",
"message": "The Element 'Buyer reference' (BT-10) must be provided.",
"location": "/ubl:Invoice",
"business_terms": [
"BT-10"
],
"line": 12
}
],
"warnings": [],
"rule_pack": "2026.11.1",
"disclaimer": "Technical check against the official EN 16931 / XRechnung rule sets. A technically valid file is not tax or legal advice."
}CLI exit codes (wsv and wsv-pro)
| Exit code | Meaning |
|---|---|
0 | All matched files are valid (or only warnings when --fail-on-warnings is unset) |
1 | At least one invoice is invalid or unreadable |
2 | Usage error or no input files matched |
3 | Rule files missing |
4 | Requested rule pack not available (wsv-pro) |
PHP SDK rules scope (CoreRules vs official Schematron)
In wsystem/einvoice, pure-PHP CoreRules + Xsd runs by default when no Schematron backend is available and sets checked.EN16931 = "core-subset" (fast pre-check only, not full conformance). Full official EN 16931 / XRechnung conformance requires optional SaxonC, the self-hosted W System validator (Command / local Http), or the hosted W System API (Http). See the PHP SDK rules matrix.
Offline licence key format (wsv-pro)
Commercial keys use signed tokens WSV1.<base64url(claims)>.<base64url(Ed25519 sig)> verified against public keys baked into the image. States are valid, grace (30 days after expiry, still operational with a warning header), expired (pro endpoints disabled, free CLI keeps running), and invalid. Rule packs released on or before updates_until remain loadable under perpetual fallback.
Licences, third-party notices and scope
- W System toolkit code:
wsystem/einvoice(PHP SDK) andwsystemdev/einvoice-validator(free CLI and container) are licensed under Apache-2.0.wsystemdev/einvoice-validate-actionv1 is MIT-licensed. - CEN/TC 434 EN 16931 artefacts (v1.3.16): included unmodified under the European Union Public Licence (EUPL-1.2) with upstream CEN notices preserved (ConnectingEurope/eInvoicing-EN16931).
- KoSIT XRechnung configuration (3.0.2 / 2026-08-31) and Schematron (2.4.0): included unmodified under Apache-2.0 with KoSIT NOTICE pass-through (itplr-kosit/validator-configuration-xrechnung).
- Saxon-HE (
saxonche/ SaxonC-HE): Mozilla Public License 2.0 (MPL-2.0). - Peppol BIS Billing 3.0 rules:
PEPPOL-EN16931-*rules are not shipped (pending OpenPeppol IPR clearance). Output marksPeppolBIS3: false.
Disclaimer: technical validation and document generation against the official EN 16931 and XRechnung rule sets. A technically valid file is not tax or legal advice.