Validate your XRechnung invoices with a free tool
E-Invoicing

Is My Invoice OK? How to Validate E-Invoices in an XRechnung Format

| | Consultant, econtea GmbH
KoSIT has brought out a free open source validator so you can check your XRechnung invoices before sending.

Since the European Directive on Electronic Invoicing for Public Sector Clients (EN 2014/55/EU) was passed into national law, public sector clients have been required to accept electronic invoices. In some cases, suppliers may only submit electronic invoices. In addition to ZUGFeRD, XRechnung is the standard format for creating and transmitting electronic invoices to public-sector customers.

To make it easier to work with XRechnung, KoSIT offers an open source validator for invoice issuers and recipients to validate invoices themselves. This makes it a lot simpler to find and correct any errors. If an invoice is rejected by a recipient, this tool can be used by either party to clarify what needs to be changed. This article includes a step-by-step guide on how to use KoSIT’s open source validator

Since November 27, 2020, suppliers to government bodies have been legally required to submit electronic invoices that at least adhere to directive EN16931. In Germany, this is usually done by using XRechnung, a format which fulfils the Core Invoice Usage Specification (CIUS) for EN16931. This means that for many companies, XRechnung is now a fixed component in their invoicing to federal and state governmental organisations. Even companies in the public sector who are part-owned by federal or state bodies require invoices submitted to them to be in XRechnung.

Unfortunately, from time to time, invoices are rejected by the recipient. This is usually due to missing or misunderstood XRechnung specifications. This may be on either side.  The validator is a neutral tool which can be used to check the rejected invoice and determine whether it is incorrect and why.

Error messages from a recipient’s system can be rather basic and vague. This means that the sender will need to analyse the invoice themselves before resending. This is where a validator, such as the open-source validator by KoSIT, is helpful. It runs a semi-automatic check on the invoice, checking it against the XRechnung specifications. It then highlights any errors in a test report.

The information in this report can either be used to correct the error, or as the basis of a discussion with the recipient who has rejected the invoice.  In either case, the report can give both parties useful pointers on how to avoid future errors or misunderstandings.

Since invoices always contain details covered by data protection laws, you may be interested in how to run validation checks locally from your in-house IT system. In the following, we’ll look at doing exactly that.

A simple guide to validating invoices on a local system

KoSIT provides an open-source validator to check that your XRechnung electronic invoices are technically sound.

Where can I get this validator?

The validator can be downloaded from GitHub. You will need the following components:

The KoSIT validator uses the schematron provided by the Connecting Europe Facility (CEF) for validating XRechnung invoices.

To use KoSIT’s validator on your XRechnung invoices, you will need to merge the schemas and the validator so that the validator has access to this when running an invoice checks KoSIT provides a pre-configured version of the validator so that you do not need to search for configurations from the CEF.

How to assemble the KoSIT validator

To begin with, you need to download both the validator and the configuration files from either of these links.

Now, both archives need to be unzipped and merged to allow you to use the validator.

Both archives need to be unzipped and merged to allow you to use the validator.
Figure 1: Both archives need to be unzipped and merged to allow you to use the validator.

Start by unzipping the archives. You should then have a screen which looks like this:

Step 1, unzipping the validator
Figure 2: Step 1, unzipping the validator
Steps 2, unzipping the validator
Figure 3.1: Steps 2, unzipping the validator
Steps 3, unzipping the validator
Figure 3.2: Steps 3, unzipping the validator

Copy the configuration files into the directory containing the validator. Your screen should then look like this:

The configuration files need to be in the same directory as the validator
Figure 4: The configuration files need to be in the same directory as the validator

Now you can set up sub-folders for input and output.

How do you start a test?

The KoSIT validation tool can be started via a simple terminal command. You will need to have Java installed on the computer for this. If the command does not work, you may need to add a path to Java.exe. The following parameters can be passed when calling the exe file validationtool-x.x.x-standalone.jar:

  • s; defines the scenario, this file in included in the pre-configured version from KoSIT
  • h; defines the XRechnung invoice to be tested
  • o; defines the folder path to which the results should be saved

/Markup/ ```shell path_to/java -jar path_to/validationtool-x.x.x-standalone.jar -s path_to/scenarios.xml -h ./path_to/XRechnung.xml -o ./path_to/output_folder ```

Once you have run this call, the result is delivered to your defined folder. This is an HTML page which can be opened in your browser.

What do the results mean?

There are three possible outcomes from the validator. The following shows KoSIT validator test reports for three separate invoices.

1. The invoice contains a terminal error. The validator recommends rejecting and returning the invoice.
A test report for an invoice with errors. As this invoice is still valid, the validator issues a warning.

2. The validator has discovered errors, but still considers the invoice to be valid. It therefore issues a warning. This may change in future KoSIT releases, so that these invoices are then no longer valid. In that case, you should fix the highlighted error. However, the error should not stop the invoice being paid.

A test report for an invoice with errors. As this invoice is still valid, the validator issues a warning.
Figure 5: A test report for an invoice with errors. As this invoice is still valid, the validator issues a warning.

3. A fully valid invoice which the validator recommends accepting.

An invoice declared to be error-free by the validator.
Figure 6: An invoice declared to be error-free by the validator.

For users looking for a simple, free solution to check their electronic XRechnung invoices, the open source validator by KoSIT is perfectly suitable. A more comprehensive solution, which also includes invoice validation, is SEEBURGER’s Invoice Delivery Service.

The Invoice Delivery Service (IDS) by SEEBURGER – more than invoice validation

The Invoice Delivery Service is a SEEBURGER invoicing package which includes a feature to validate your invoices. The IDS can connect to your ERP system and generate an electronic invoice in XRechnung (or another format) from existing invoice data.  Before the electronic invoice is sent off by e-mail or through Peppol, it undergoes a validation check. This is because the invoice recipient can reject invalid invoices and does not have to pay them.

The major German electronic invoice portals, such as the Zentrales Rechnungseingangsportal (ZRE) and the OZG-compliant inbound invoicing platform (), also validate invoices when they are received, and automatically reject invalid invoices. This is another important reason to check them yourself first, so that you don’t waste time having to reissue them.

SEEBURGER’s Invoice Delivery Service checks all invoices before they are issued using an integrated validation tool.

The SEEBURGER Invoice Delivery Service runs a validation test on all e-invoices before issuing them.
Figure 7: The SEEBURGER Invoice Delivery Service runs a validation test on all e-invoices before issuing them.

Our Invoice Delivery Service ensures that you are only sending valid electronic XRechnung invoices to your customers, giving them no reason not to settle them quickly!

Get in contact with us:

Please enter details about your project in the message section so we can direct your inquiry to the right consultant.

Share this post, choose your platform!

Twitter
Marvin Döring | econtea GmbH

Written by:

Marvin Döring is a consultant at econtea GmbH. He specialises in electronic invoicing (e-invoicing), electronic invoice validation and API integration. In 2016, after graduating in applied computer science in Stuttgart, he initially worked as a software engineer for toll collection. Always interested in creating and developing open source software, he has successfully turned one of his hobbies into his career. He also enjoys travelling, loves tenpin bowling and lets off steam on the badminton court.