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.

ComponentVersionLicenceUpstream
KoSIT XRechnung validator configuration3.0.2 (2026-08-31)Apache-2.0itplr-kosit/validator-configuration-xrechnung
CEN/TC 434 EN 16931 validation artefacts1.3.16EUPL-1.2 (unmodified)ConnectingEurope/eInvoicing-EN16931
KoSIT XRechnung Schematron2.4.0Apache-2.0itplr-kosit/xrechnung-schematron
Saxon-HE (saxonche / SaxonC-HE)13.xMPL-2.0Saxonica Ltd
lxml, pypdf6.x / 7.xBSD-3-ClausePyPI

Validation JSON output shape

Every toolkit component produces the same validation shape as POST /einvoice/validate:

json
{
  "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 codeMeaning
0All matched files are valid (or only warnings when --fail-on-warnings is unset)
1At least one invoice is invalid or unreadable
2Usage error or no input files matched
3Rule files missing
4Requested 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) and wsystemdev/einvoice-validator (free CLI and container) are licensed under Apache-2.0. wsystemdev/einvoice-validate-action v1 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 marks PeppolBIS3: 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.