How to Create an XRechnung: Step by Step
Create and send an XRechnung with the correct Leitweg-ID, mandatory fields and validation using this practical guide for German public-sector invoices.
You have completed an order from an authority and should now submit your first invoice electronically - as XRechnung. Many companies fail not because of the service itself, but because of mandatory fields, the Leitweg-ID or a validation error in the XML file. This guide will take you step by step through the process: from preparation to successful shipping.
You can find the basics about the format in our article What is an XRechnung? and on the overview page XRechnung. For the broader context of electronic invoicing, we also recommend the guide Write an invoice and the page E-Invoicing.
Requirements: What you need to clarify before you start
Before you create an XRechnung, the following points should be clarified:
Received from client
| Information | Why important |
|---|
| Leitweg-ID | Clear assignment in the authority system |
| Invoice receipt platform | Correct transmission path (ZRE, OZG-RE, Peppol) |
| Order or contract number | Often a mandatory field in the invoice |
| Contact person/processing | For questions and rejections |
Present in your company
- Complete company details (name, address, USt-IdNr. or tax number)
- Bank details for payment information
- Consecutive invoice number according to your number range
- Description of services, quantities, prices, tax rates
Without a Leitweg-ID, you should not send XRechnung to a public client. Request the ID in writing - it is often found in procurement documents, in the contract or on the authority's website.
Step 1: Enter billing information as usual
The content of the work hardly differs from a classic calculation. Capture:
- Invoice header – number, date, service period, if necessary reference to order
- Recipient – Authority with full address
- Items – individually with net amount, tax rate and tax amount
- Totals – Subtotals, VAT, Gross Amount
- Payment conditions – due date, discount, IBAN
Pay attention to arithmetic consistency: The sum of the line items must agree with net and gross. Rounding differences are a common validation error.
Practical tip: Use the same data as in your accounting. If the ERP and the XRechnung tool show different amounts, you will have problems later with checks and payment reconciliation.
Step 2: Enter Leitweg-ID correctly
The Leitweg-ID is the most important recipient-specific field in XRechnungen to the public sector. It consists of several parts (e.g. federal state, authority, department) and is assigned by the client.
How to check the Leitweg-ID
- Compare character by character with the official information
- Do not add spaces or special characters
- If there are several possible IDs: use the one valid for your contract/order
More background on this in our article Leitweg-ID explained.
Step 3: Create XRechnung in the software
Writing XML manually is impractical for everyday use. Use an invoicing software or a specialized module that exports XRechnung.
Typical process in the software
- Create invoice (customer = authority with Leitweg-ID)
- Select format XRechnung or CII-XML
- Prepare export or direct transfer to portal
- Run validation in the tool
Quotavo and comparable solutions guide you through the mandatory fields and generate a file-compliant XML structure. How to avoid typical schema errors.
Alternative: Conversion from ZUGFeRD
Some systems first generate ZUGFeRD and derive a pure XML invoice from it. For authorities, however, explicitly XRechnung is often required - check the client's specifications.
Step 4: Perform validation
Before sending, the file must be validated against the XRechnung checking rules. Validators check, among other things:
| Test area | Example of errors |
|---|
| Required fields | missing invoice number |
| Codes and Lists | invalid tax rate code |
| Sum logic | Gross ≠ Net + Tax |
| Leitweg-ID | wrong format |
| Party details | incomplete seller address |
What to do if there are validation errors?
- Read the error message carefully (field name and rule)
- Correct data in the source invoice
- Regenerate and validate XML
- Only send after “green”.
Some portals reject even small deviations - rework costs time and delays payment.
Step 5: Transmission to the public client
The XRechnung is usually submitted via a central entry platform, not via private email.
Common transmission channels
| way | Typical users |
|---|
| ZRE (Central invoice receipt platform) | Federal authorities |
| OZG-RE / state portals | States and municipalities |
| Peppol | partly authorities and companies |
| Authorities' own portal | according to local specifications |
Register in the designated portal in good time. If necessary, test with a test environment if offered.
Transmission process
- Log in to the portal (company account)
- Upload XRechnung file or transfer from software
- Save confirmation and process number
- Track the status of the invoice in the portal
Keep proof of the upload time and confirmation - analogous to a registered letter for paper invoices.
Step 6: Archiving and internal documentation
After shipping, the work is not finished:
- Archive original XML unchanged (note GoBD)
- Save a copy of the human-readable invoice (PDF from your system).
- Assign Leitweg-ID, portal confirmation and payment receipt
- If rejected: Document error log and corrected new version
Electronic invoices are subject to the same retention requirements as paper ones - you should clarify details with your tax advisor. General information can be found in the FAQ.
Special features by industry and order type
Skilled trades and construction
Often long performance periods, advance and final invoices. Each partial invoice needs its own XRechnung with correct reference to the order and, if necessary, previous deductions.
IT and consulting
Time recording in hours, if necessary travel costs as separate items. Uniform descriptions make inspection by the authority easier.
Delivery of goods
Pay attention to the delivery date, units of measure and, if applicable, order references from the award.
XRechnung and the e-invoicing requirement in B2B
The obligation to send XRechnungen to authorities is already a reality for many companies. In addition, e-invoicing in B2B business is coming into focus - with its own deadlines and exceptions. Whether your company is obliged to do so from 2026 or later depends on its size, turnover and role (exhibitor or recipient). Have your situation legally reviewed; our overview E-Invoicing Mandatory 2026 quotes an initial orientation.
For B2B customers, ZUGFeRD or another EN 16931 format is often sufficient - for authorities, XRechnung remains the standard.
Checklist: Create and send XRechnung
Use this list for every government invoice:
Software selection: what to pay attention to
When choosing a solution for Write an invoice and XRechnung, you should consider:
- XRechnung export with current specification
- Built-in validation before export
- Leitweg-ID as a fixed recipient field
- Interfaces to portals or Peppol (if required)
- Easy to use for employees without XML knowledge
Quotavo combines classic quotation and invoice processes with modern invoicing software functionality - so you don't have to maintain two separate worlds.
Common questions when creating
Can I correct an XRechnung later?
In the event of errors, a cancellation invoice and a new correct invoice are usually required - not simply resending the old XML file. Coordinate the procedure with the authorities and your accounting department.
Is PDF sufficient in addition to XRechnung?
The XRechnung is the relevant version for automatic processing. A PDF can be helpful internally, but does not replace the XML obligation towards the public client.
Does every position have to have the same tax?
No, mixed tax rates are possible - then totals must be shown correctly for each tax rate.
Further answers: FAQ and XRechnung.
Conclusion
Creating an XRechnung is not rocket science if you have the data, Leitweg-ID and tool correct. Work in clear steps: capture, generate XML, validate, transmit, archive. With the right software, you can avoid most technical stumbling blocks and can concentrate on content and deadlines.
Start early with portal access and test invoice - then the first real government invoice will be much more relaxed. If you have any questions about the format, obligation and software, take a look at E-Invoicing, XRechnung and our FAQ.