Test an E-Invoice Before Sending: A Four-Level Test Plan
How to test an e-invoice before sending it to a German customer: schema, business rules, content and the recipient portal, with test files and a log template.
Key takeaways
- A complete test covers four levels: XML schema, EN 16931 and XRechnung business rules, invoice content under § 14(4) UStG, and delivery to the recipient.
- The official KoSIT XRechnung test suite (release 2026-08-31) contains 86 reference files in UBL and CII for positive tests.
- For a negative test, use a deliberately broken file that produces exactly 10 findings in the KoSIT validator: 9 fatal and 1 warning.
- Germany's federal invoice platform OZG-RE runs a separate test environment; test invoices never go to production and real invoices never go to the test system.
- A written test log with file, rule version and result makes onboarding with each new German customer faster.
On this page
To test an e-invoice before sending it to a German customer, run one real invoice from your system through four checks: the XML schema, the business rules of EN 16931 and XRechnung, the invoice content required by § 14(4) UStG, and the delivery route to the recipient, for example the test environment of the federal platform OZG-RE.
This plan is written for foreign suppliers of German companies and authorities, for ERP and finance teams rolling out e-invoicing, and for software vendors onboarding customers. You end up with a test plan, suitable test files and a log template you can reuse for every new recipient.
What do you need before you start?
- An invoice from your production system with real master data (legal name, address, VAT ID or German tax number, bank details), marked as a test or addressed to a fictitious buyer.
- The recipient's requirements: format (XRechnung in UBL or CII syntax, or ZUGFeRD/Factur-X), delivery channel (e-mail, portal, Peppol) and, for public-sector buyers, the Leitweg-ID (buyer reference, BT-10).
- A validator with the current rule configuration from KoSIT (Koordinierungsstelle für IT-Standards, the German body that maintains XRechnung). As of October 2026 this is configuration 2026-08-31 for XRechnung 3.0.2; GitHub shows no newer release.
- One valid and one deliberately invalid test file, so you can see whether your check actually catches errors.
- A spreadsheet or document for the test log.
Which four levels does the test plan cover?
A validator covers only the first two levels. The other two are manual, and that is where many first invoices fail.
| Level | What is checked | Typical error | Tool |
|---|---|---|---|
| 1. Schema | Well-formed XML, structure per UBL 2.1 or CII D16B | wrong element order, wrong namespace | XSD check in the validator |
| 2. Business rules | EN 16931 rules (BR-, BR-CO-, BR-CL-) and XRechnung rules (BR-DE-) | BR-DE-15: "Buyer reference" (BT-10) missing | Schematron in the validator |
| 3. Content | Mandatory details under § 14(4) UStG, VAT rate, supply date, sequential number | 19 % instead of 7 %, service period missing | Manual review, checklist |
| 4. Delivery | Acceptance by the portal, Peppol access point or customer inbox | Portal rejects the file because the Leitweg-ID is wrong | Test environment or agreed test invoice |
The list of XRechnung mandatory fields shows which fields matter at level 2. How format errors, business rule errors and content errors differ for tax purposes is explained in our post on e-invoice format errors.
Step by step: how to test an e-invoice
- Pick a test case. Use your most common invoice type, for example two lines and one VAT rate. Result: a document you will produce every day.
- Generate the file. Export the invoice from your system as XRechnung or ZUGFeRD. Result: an
.xmlfile, or a PDF with embedded XML. - Check the identifier. Open the XML and find the specification identifier (BT-24). For XRechnung 3.0 it is
urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0. An outdated identifier means the validator finds no matching validation scenario at all. - Validate. Check the file against configuration 2026-08-31. Result: accept or reject, plus a list of rule codes.
- Fix errors at the source. Correct the master data or the template in your invoicing system, not the single XML file. Generate the invoice again and revalidate.
- Review the content. Walk through Section 14(4) of the German VAT Act (§ 14 UStG): names and addresses of both parties, tax number or VAT ID, issue date, invoice number, quantity and type of goods or services, supply date, net amount per VAT rate, VAT rate and VAT amount.
- Run a negative test. Validate a deliberately broken file. If your check reports no errors there, it is not checking what you think it is.
- Test delivery. Send the file to the recipient's test environment or as an agreed test invoice. Result: a receipt confirmation or an error message from the recipient.
- Log the result. Record file, rule version and outcome (template below).
Repeat steps 1 to 6 for every special case you actually issue: credit notes, corrected invoices, VAT-exempt supplies, reverse charge, discounts or early-payment terms (Skonto).
Which test files work for positive and negative tests?
Testing with a single valid file does not show whether your check detects errors. Combine both kinds.
| Test file | Type | Content | Source |
|---|---|---|---|
| XRechnung test suite, release 2026-08-31 | positive (reference messages) | 86 XML files: 66 standard business cases, 6 extension business cases, 12 technical CIUS cases, 2 technical CVD cases, in UBL and CII | KoSIT on GitHub (opens in a new tab) |
| XRechnung example | positive | valid XRechnung 3.0 in UBL for tracing each field | docutools.pro |
| XRechnung test file | negative | XRechnung 3.0 in UBL with 8 built-in errors; per the template description, 10 findings in the KoSIT validator (9 fatal, 1 warning) | docutools.pro |
According to its changelog, the KoSIT test suite is compatible with XRechnung 3.0. Its test-overview.md lists the business cases as positive test instances, for example "01.01: Standard invoice with 2 lines, 1 tax category, 1 payment means code 58". Pick the cases closest to your own invoices and compare your file field by field.
The broken test file includes a missing buyer reference (BR-DE-15), a credit transfer without an IBAN (BR-DE-23-a: if payment means code 30 or 58 is used, group BG-17 "CREDIT TRANSFER" must be present) and a BT-106 total that does not match the sum of the lines (BR-CO-10). How to fix messages like these is covered in fix XRechnung validation errors.
How do you test delivery to a German recipient portal?
A valid file can still be rejected, for example because the Leitweg-ID does not belong to the buyer or the channel is misconfigured. That is why delivery belongs in the test.
For invoices to the German federal administration, the FAQ on e-rechnung-bund.de (opens in a new tab) sets out these rules:
- The federal invoice platform OZG-RE has its own test environment. Suppliers are advised to register there and test invoice submission.
- Test invoices never go to the production platform, and real invoices never go to the test environment.
- If you use the "Weberfassung" (web form) or "Upload" channels, the platform validates your e-invoice and shows a validation report with formal errors before you submit.
- For other channels, a magnifier icon in the invoice overview leads to the detailed results of the formal check if the platform rejects an invoice.
- For Peppol tests, the FAQ publishes a dedicated Peppol receiver ID and Leitweg-ID for the reference environment. Production invoices should follow only once transmission works there.
- Fictitious IBANs may be used in the test environment.
For state and municipal portals, and for business customers with their own supplier portal, ask for a test environment or agree on a clearly marked test invoice. How the delivery channels work in detail is covered in how to send e-invoices in Germany.
Template: a test log for customer onboarding
A short log answers the later question of which rule version an invoice type was approved against. It also helps when a customer asks what was checked after a first rejection. The data in the example is fictitious.
| Field | Example |
|---|---|
| Recipient | Beispiel AG, purchasing |
| Format and syntax | XRechnung 3.0, UBL |
| Specification identifier (BT-24) | …:xrechnung_3.0 |
| Leitweg-ID or buyer reference (BT-10) | provided by the recipient |
| Test case | standard invoice, 2 lines, 19 % |
| File | RE-2026-0042.xml |
| Validator and rule version | validator with configuration 2026-08-31 |
| Result, levels 1 and 2 | accepted, 0 errors, 1 warning (record the code) |
| Result, level 3 | mandatory details complete, reviewed by M. Muster |
| Result, level 4 | receipt confirmed in the test portal on 24 October 2026 |
| Open issues | none |
Store the log with the test file. When the rule configuration changes, for example with XRechnung 4.0, test again and start a new log.
Common testing mistakes
| Mistake | Symptom | Fix |
|---|---|---|
| Only looked at the PDF | Invoice "looks fine", recipient rejects it | Always check the XML; extract it first for ZUGFeRD |
| Outdated rule configuration | Different results than the recipient's check | Record the configuration date in the log and compare |
| XML fixed by hand | The next invoice has the same error | Change master data or the template in your system |
| Warnings ignored | Recipient applies stricter rules | Assess every warning and record the decision |
| No negative test | Check never reports errors, even on broken files | Run the broken test file through the same check |
| Test invoice sent to production | Test document lands in the customer's books | Use only the test environment or an agreed test invoice |
How to test an e-invoice with docutools.pro
- Open the XRechnung validator and choose "Load sample invoice" to see the flow with a valid file. The sample has its own allowance and does not use up your uploads.
- Upload your own XML with "Select file". The file is sent to our server and checked the way the KoSIT validator does (configuration 2026-08-31). The free plan includes two uploads per day up to 500 KB; the quota resets at midnight UTC. The validator does not accept ZUGFeRD PDFs, so first extract the XML from the PDF.
- Read the result: "KoSIT-conformant / Valid XRechnung" or "Not KoSIT-conformant", the "Compliance score" and the list of findings with rule codes. The list of XRechnung error codes gives background on individual codes; the rule text in your result is what counts.
- For the negative test, download the broken test file and check it the same way. You should see the findings listed in the template description.
- For level 3, walk through the mandatory details with the "XRechnung/ZUGFeRD XML" mode of the German invoice requirements checker. On XML import it always marks the supply date, exemption note and discounts as missing; tick them by hand once you have checked them.
- If your system cannot produce e-invoices yet, use the XRechnung generator to create a test invoice without an account, as "XRechnung XML", "ZUGFeRD XML" or "ZUGFeRD PDF". It produces standard invoices (type 380) only, no credit notes or corrections.
The docutools.pro validator does not produce a report file to keep; the result is shown on the page only. For a report to attach to your log, also run the KoSIT validator itself. More articles are collected in our validation and error guides.
What should you check after the test passes?
- Validate the first production invoice to each new recipient again and ask for confirmation of receipt.
- Repeat one test case after every update of your invoicing software.
- Watch the KoSIT rule configuration date: XRechnung 3.0.2 applies today, and the pre-release of XRechnung 4.0 has been published since September 2026.
- Add every rejection from a recipient, with its rule code, to the log so the next test covers exactly that case.
Sources
- FAQ on e-invoicing in the federal administration: OZG-RE test environment and Peppol tests (German) (opens in a new tab)
- KoSIT XRechnung test suite on GitHub, release 2026-08-31 (opens in a new tab)
- KoSIT validator configuration for XRechnung on GitHub (opens in a new tab)
- § 14 UStG, issuing invoices (German VAT Act) (opens in a new tab)
Last reviewed: October 2026
This article is general information, not tax or legal advice.
Tools for this article
- XRechnung ViewerParse, validate & repair German e-invoices with GoBD-compliant audit trail.Open tool →
- KoSIT Error HubSearchable reference for all XRechnung validation error codes with fix guides.Open tool →
- E-Invoice GeneratorCreate compliant XRechnung XML and ZUGFeRD hybrid PDF invoices instantly.Open tool →
Frequently asked questions
How do I test an XRechnung?
Export an invoice from your own system with real master data and run the XML through a validator that uses the KoSIT configuration, currently version 2026-08-31 for XRechnung 3.0.2. Then check the content against the mandatory details in Section 14(4) of the German VAT Act, and send the file through the recipient's test environment where one exists. The test passes only when all four levels are clean.
Is there a test environment for e-invoices to the German federal government?
Yes. The federal invoice platform OZG-RE runs its own test environment where suppliers register and try out invoice submission. For Peppol tests, the FAQ on e-rechnung-bund.de publishes a dedicated test receiver ID. Test invoices must never be sent to the production platform, and real invoices must never be sent to the test environment. Fictitious IBANs are allowed for tests.
Does passing validation mean the invoice is correct?
No. A validator checks syntax and business rules, such as mandatory fields, code lists and calculation rules. It cannot know whether the VAT rate, the description of the service, the supply date or the invoice number are right. Section 14(4) of the German VAT Act requires those details, so your accounts team still has to check them. A green result only means the file is a processable XRechnung.
Where can I get an XRechnung test file?
KoSIT publishes valid reference files in its XRechnung test suite on GitHub, split into business cases and technical cases, each in UBL and CII syntax. A deliberately invalid file with eight built-in errors is available as a template on docutools.pro. Both are for testing only and must never be sent as a real invoice.
Do I test a ZUGFeRD or Factur-X invoice differently?
Partly. With ZUGFeRD or Factur-X you also need to check the PDF/A-3 container, and you have to extract the embedded XML before validating it. In the EN 16931 profile only the rules of the standard apply; the German BR-DE rules run only for the XRECHNUNG profile. Also confirm that the visible PDF shows the same amounts as the XML.