Tool

XRechnung Validator (KoSIT)

Definition

The XRechnung Validator is a command-line tool developed by KoSIT and released as open source for checking XRechnung documents for conformity. It validates both XML schema validity (XSD) and content-level business rules via Schematron. The tool is regularly updated when new XRechnung versions are released and serves as the reference implementation for validation.

Background & context

The KoSIT validator is the official reference implementation for checking electronic invoices in Germany. It is available as an open-source Java tool and is configuration-driven: the actual check rules are not in the validator itself but in a separate 'validator-configuration' (for XRechnung: validator-configuration-xrechnung) that bundles the XSD schemas and Schematron rules of a particular standard version. Checking runs in two stages: first the validator checks the XML schema validity (XSD) — is the document a well-formed, structurally correct UBL or CII file at all? Then it evaluates the Schematron rules, i.e. the content-level business rules of EN 16931 (BR-, BR-CO-, BR-S- …) and the German extension (BR-DE-). The result is a machine-readable validation report with the overall verdict 'conformant' or 'not conformant' plus a list of violated rules including their location. Since the receiving platforms ZRE and OZG-RE use the same logic, the validator can be used to check in advance whether an invoice would be accepted there.

In practice — a worked example

Before sending, a developer checks the generated XRechnung locally with the KoSIT validator and the current XRechnung configuration. The report flags a violation of BR-DE-2 (missing buyer reference). The developer adds the Leitweg-ID in BT-10 and checks again; now the result is 'conformant'. Only then does it transmit the file via Peppol to the authority — thus avoiding a later rejection by the receiving portal.

Common mistakes

  • Running the validator with an outdated configuration: after an XRechnung update, previously valid invoices may fail.
  • 'conformant' means technical conformity, not factual correctness — wrong but formally valid amounts are not detected by the validator.

Frequently asked questions

Does a 'conformant' verdict replace the business review?

No. The validator checks structure and business rules, but not whether the invoice content is factually correct. A formally valid invoice can still be substantively wrong.

Which configuration do I need for XRechnung?

The validator-configuration-xrechnung in the version matching the XRechnung release accepted by your recipient. It contains the appropriate XSD and Schematron rules.

Related terms

XRechnungXRechnung is the German standard for structured electronic invoices in public sector procurement (B2G). It is based on the European standard EN 16931 and is available in two syntaxes: UBL 2.1 and UN/CEFACT CII. Since 27 November 2020, federal public buyers have been required to accept electronic invoices in XRechnung format, and state and municipal authorities have been progressively included.KoSIT (Coordination Office for IT Standards)The Coordination Office for IT Standards (KoSIT) is an institution of the Free Hanseatic City of Bremen that develops and maintains IT standards for public administration on behalf of the IT Planning Council of Federal and State Governments. KoSIT is responsible, among other things, for maintaining the XRechnung standard, the open-source Validator tool, and operating the national Peppol infrastructure in Germany.SchematronSchematron is a rule-based validation language for XML documents, based on XPath expressions. In the context of XRechnung and EN 16931, Schematron rules are used to perform content-level plausibility checks that go beyond pure schema validation (XSD). The official Schematron rules for XRechnung are maintained by KoSIT and are part of the open-source Validator.EN 16931EN 16931 is the European standard that defines the semantic data model of a core invoice. It specifies the mandatory and optional fields (Business Terms), their meaning, and the validation rules that apply to all conforming electronic invoices in the EU. Nationally implemented standards such as XRechnung, ZUGFeRD (EN 16931 profile), and Factur-X must comply with this standard.