German E-Invoice Example: XRechnung XML Explained Line by Line
A fictional German B2B invoice shown as XRechnung XML and explained element by element: EN 16931 business terms, mandatory details under § 14 UStG and the ZUGFeRD equivalent.
If you have never seen a German e-invoice, the format can look abstract. This page shows a complete but fictional German B2B invoice as XRechnung XML and explains what each part means. You will see the EN 16931 business terms (BT codes) that appear in validation reports, the details German VAT law requires on every invoice, and how the same data looks in a ZUGFeRD file.
The example invoice at a glance
- Seller: Muster Software GmbH, Musterstraße 1, 10115 Berlin, Germany – VAT ID (USt-IdNr) DE123456789, tax number (Steuernummer) 30/123/45678
- Buyer: Beispiel Handels GmbH, Hafenstraße 5, 20095 Hamburg, Germany – VAT ID DE987654321
- Invoice number RE-2026-0042, issued on 15 October 2026, service delivered on 10 October 2026
- Buyer reference: PO-2026-118 (the buyer's purchase order number)
- Line 1: IT consulting, 8 hours at €120.00 = €960.00
- Line 2: Software licence, 1 unit at €240.00 = €240.00
- Net total €1,200.00 – VAT 19 % €228.00 – Gross total €1,428.00
- Payment by SEPA credit transfer within 30 days (due 14 November 2026)
All companies, numbers, e-mail addresses and the IBAN in this example are fictional. Do not reuse them on real invoices.
XRechnung XML example (CII syntax)
XRechnung is the German standard for e-invoices based on the European norm EN 16931. It can be written in two XML syntaxes: UBL and UN/CEFACT CII (Cross Industry Invoice). The content is the same in both. Below is a shortened CII version of the example invoice. The comments show the matching EN 16931 business terms; line 2 is left out to keep the snippet short.
<?xml version="1.0" encoding="UTF-8"?>
<rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
<rsm:ExchangedDocumentContext>
<ram:GuidelineSpecifiedDocumentContextParameter>
<!-- BT-24: specification identifier -->
<ram:ID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:ExchangedDocumentContext>
<rsm:ExchangedDocument>
<ram:ID>RE-2026-0042</ram:ID> <!-- BT-1 -->
<ram:TypeCode>380</ram:TypeCode> <!-- BT-3: commercial invoice -->
<ram:IssueDateTime> <!-- BT-2 -->
<udt:DateTimeString format="102">20261015</udt:DateTimeString>
</ram:IssueDateTime>
</rsm:ExchangedDocument>
<rsm:SupplyChainTradeTransaction>
<ram:IncludedSupplyChainTradeLineItem> <!-- BG-25: invoice line -->
<ram:AssociatedDocumentLineDocument>
<ram:LineID>1</ram:LineID> <!-- BT-126 -->
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:Name>IT consulting</ram:Name> <!-- BT-153 -->
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
<ram:NetPriceProductTradePrice>
<ram:ChargeAmount>120.00</ram:ChargeAmount> <!-- BT-146 -->
</ram:NetPriceProductTradePrice>
</ram:SpecifiedLineTradeAgreement>
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="HUR">8</ram:BilledQuantity> <!-- BT-129/130 -->
</ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeSettlement>
<ram:ApplicableTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode> <!-- BT-151 -->
<ram:RateApplicablePercent>19</ram:RateApplicablePercent> <!-- BT-152 -->
</ram:ApplicableTradeTax>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
<ram:LineTotalAmount>960.00</ram:LineTotalAmount> <!-- BT-131 -->
</ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<!-- line 2: software licence, 1 x 240.00 = 240.00 (omitted) -->
<ram:ApplicableHeaderTradeAgreement>
<ram:BuyerReference>PO-2026-118</ram:BuyerReference> <!-- BT-10 -->
<ram:SellerTradeParty>
<ram:Name>Muster Software GmbH</ram:Name> <!-- BT-27 -->
<ram:DefinedTradeContact> <!-- BG-6: seller contact -->
<ram:PersonName>Anna Beispiel</ram:PersonName>
<ram:TelephoneUniversalCommunication>
<ram:CompleteNumber>+49 30 1234567</ram:CompleteNumber>
</ram:TelephoneUniversalCommunication>
<ram:EmailURIUniversalCommunication>
<ram:URIID>billing@muster-software.example</ram:URIID>
</ram:EmailURIUniversalCommunication>
</ram:DefinedTradeContact>
<ram:PostalTradeAddress>
<ram:PostcodeCode>10115</ram:PostcodeCode>
<ram:LineOne>Musterstraße 1</ram:LineOne>
<ram:CityName>Berlin</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:URIUniversalCommunication> <!-- BT-34 -->
<ram:URIID schemeID="EM">invoices@muster-software.example</ram:URIID>
</ram:URIUniversalCommunication>
<ram:SpecifiedTaxRegistration>
<ram:ID schemeID="VA">DE123456789</ram:ID> <!-- BT-31 -->
</ram:SpecifiedTaxRegistration>
</ram:SellerTradeParty>
<ram:BuyerTradeParty>
<ram:Name>Beispiel Handels GmbH</ram:Name> <!-- BT-44 -->
<ram:PostalTradeAddress>
<ram:PostcodeCode>20095</ram:PostcodeCode>
<ram:LineOne>Hafenstraße 5</ram:LineOne>
<ram:CityName>Hamburg</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:URIUniversalCommunication> <!-- BT-49 -->
<ram:URIID schemeID="EM">ap@beispiel-handel.example</ram:URIID>
</ram:URIUniversalCommunication>
<ram:SpecifiedTaxRegistration>
<ram:ID schemeID="VA">DE987654321</ram:ID> <!-- BT-48 -->
</ram:SpecifiedTaxRegistration>
</ram:BuyerTradeParty>
</ram:ApplicableHeaderTradeAgreement>
<ram:ApplicableHeaderTradeDelivery>
<ram:ActualDeliverySupplyChainEvent> <!-- BT-72 -->
<ram:OccurrenceDateTime>
<udt:DateTimeString format="102">20261010</udt:DateTimeString>
</ram:OccurrenceDateTime>
</ram:ActualDeliverySupplyChainEvent>
</ram:ApplicableHeaderTradeDelivery>
<ram:ApplicableHeaderTradeSettlement>
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode> <!-- BT-5 -->
<ram:SpecifiedTradeSettlementPaymentMeans>
<ram:TypeCode>58</ram:TypeCode> <!-- BT-81: SEPA credit transfer -->
<ram:PayeePartyCreditorFinancialAccount>
<ram:IBANID>DE00123456780000000000</ram:IBANID> <!-- BT-84 (fictional) -->
</ram:PayeePartyCreditorFinancialAccount>
</ram:SpecifiedTradeSettlementPaymentMeans>
<ram:ApplicableTradeTax> <!-- BG-23: VAT breakdown -->
<ram:CalculatedAmount>228.00</ram:CalculatedAmount> <!-- BT-117 -->
<ram:TypeCode>VAT</ram:TypeCode>
<ram:BasisAmount>1200.00</ram:BasisAmount> <!-- BT-116 -->
<ram:CategoryCode>S</ram:CategoryCode> <!-- BT-118 -->
<ram:RateApplicablePercent>19</ram:RateApplicablePercent> <!-- BT-119 -->
</ram:ApplicableTradeTax>
<ram:SpecifiedTradePaymentTerms>
<ram:Description>Payable within 30 days without deduction</ram:Description> <!-- BT-20 -->
<ram:DueDateDateTime> <!-- BT-9 -->
<udt:DateTimeString format="102">20261114</udt:DateTimeString>
</ram:DueDateDateTime>
</ram:SpecifiedTradePaymentTerms>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:LineTotalAmount>1200.00</ram:LineTotalAmount> <!-- BT-106 -->
<ram:TaxBasisTotalAmount>1200.00</ram:TaxBasisTotalAmount> <!-- BT-109 -->
<ram:TaxTotalAmount currencyID="EUR">228.00</ram:TaxTotalAmount> <!-- BT-110 -->
<ram:GrandTotalAmount>1428.00</ram:GrandTotalAmount> <!-- BT-112 -->
<ram:DuePayableAmount>1428.00</ram:DuePayableAmount> <!-- BT-115 -->
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
</rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>A real file contains a few more elements, for example the second invoice line and, in many cases, a business process identifier (BT-23). The structure, however, is exactly the one shown here.
What each element means (EN 16931 business terms)
Every piece of information in an e-invoice is linked to a business term (BT) or business group (BG) of EN 16931. Validators report errors using these codes, so it helps to know the most important ones.
Document header
- BT-24 – Specification identifier:
urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0tells the receiving software that the file follows XRechnung version 3.0. - BT-1 – Invoice number: RE-2026-0042. It must be unique and is usually sequential.
- BT-2 – Issue date: 15 October 2026, written as 20261015 (format 102 = YYYYMMDD).
- BT-3 – Invoice type code: 380 means a commercial invoice. A credit note uses 381.
- BT-5 – Currency: EUR.
- BT-10 – Buyer reference: mandatory in XRechnung. For German public authorities this is the Leitweg-ID (routing ID); between companies it is usually an agreed reference such as a purchase order number.
Seller and buyer
- BT-27 and BT-44 – Seller name and buyer name.
- BT-31 and BT-48 – Seller VAT ID and buyer VAT ID (scheme "VA").
- BT-34 and BT-49 – Electronic addresses of seller and buyer, here e-mail addresses (scheme "EM").
- BG-6 – Seller contact with name, telephone and e-mail, which XRechnung requires.
Invoice lines
- BG-25 – Invoice line: each line has an ID (BT-126), a description (BT-153), a quantity and unit (BT-129/BT-130, here HUR = hours), a net unit price (BT-146) and a net line amount (BT-131).
- BT-151 and BT-152 – VAT category and rate of the line: S (standard rate) and 19 %.
Totals and VAT
- BT-106 – Sum of net line amounts: €960.00 + €240.00 = €1,200.00.
- BT-109 – Total without VAT: €1,200.00 (no document-level discounts or charges).
- BG-23 and BT-110 – VAT breakdown and total VAT: 19 % of €1,200.00 = €228.00.
- BT-112 – Total with VAT: €1,428.00.
- BT-115 – Amount due for payment: €1,428.00 (no prepayments).
Payment
- BT-81 – Payment means code 58: SEPA credit transfer.
- BT-84 – Payee IBAN (fictional in this example).
- BT-9 and BT-20 – Due date and payment terms in text form.
Mandatory invoice details in Germany (§ 14 UStG)
The XML is only the container. The content must still meet the requirements of the German VAT Act (Umsatzsteuergesetz, UStG). Under § 14 (4) UStG, a full invoice must show:
- The full name and address of the supplier and of the customer.
- The supplier's German tax number (Steuernummer) or VAT ID (USt-IdNr).
- The date of issue.
- A unique, sequential invoice number.
- The quantity and type of goods, or the scope and type of the service.
- The date of supply or service.
- The net amount, broken down by VAT rate, and any agreed price reduction not already included.
- The VAT rate and VAT amount, or a note explaining why no VAT is charged (for example an exemption or the reverse charge).
Small invoices up to €250 gross (Kleinbetragsrechnungen) need fewer details. If you use the Kleinunternehmer scheme (small business exemption under § 19 UStG), you charge no VAT and add a note to that effect. Check special cases with a tax adviser.
XRechnung-specific requirements
XRechnung adds German business rules ("BR-DE" rules) on top of EN 16931. In practice, these are the points that most often cause validation errors:
- The buyer reference (BT-10) must be present.
- The seller contact (BG-6) needs a name, a telephone number and an e-mail address.
- The electronic addresses of seller (BT-34) and buyer (BT-49) must be filled in.
- Payment instructions, such as the IBAN for a credit transfer, must be complete.
If you want to understand the rules and their typical messages in detail, read our comparison XRechnung vs ZUGFeRD.
The same invoice as ZUGFeRD
ZUGFeRD is a hybrid format: a PDF/A-3 file that people can read like a normal PDF, with the structured XML embedded inside it. The XML uses the same CII syntax as the example above. In current ZUGFeRD versions the embedded file is called factur-x.xml, because ZUGFeRD 2.x is technically identical to the French Factur-X standard.
For our example, the differences would be small:
- The specification identifier (BT-24) names the ZUGFeRD profile, for example
urn:cen.eu:en16931:2017for the EN 16931 (Comfort) profile, or the XRechnung identifier if you use the XRECHNUNG profile. - The invoice data, BT codes and totals stay the same.
- The recipient additionally sees a printed invoice layout when opening the PDF.
For German B2B invoices, ZUGFeRD from version 2.0.1 is accepted as an e-invoice, except for the MINIMUM and BASIC-WL profiles, which do not contain enough data. Public authorities usually ask for XRechnung. Which format you need, and from when, is explained in our guide to Germany's e-invoicing mandate.
How to view and validate an example yourself
- Save the XML as a file, for example example-invoice.xml, or use a real XRechnung you have received.
- Open it in the free XRechnung viewer to see it as a readable invoice. No account is needed. More tips are in our guide on how to open an XRechnung.
- Check it with the free XRechnung validator. The report lists every problem with its BT code or business rule. Because the snippet above is shortened and uses fictional data, expect some messages, for example about the missing second line or the IBAN check digits.
If your invoices are currently PDFs, you do not need to write XML by hand. You can convert a PDF invoice to ZUGFeRD or XRechnung with the PDF converter, or create new invoices directly in XRechnungs.de and export them as XRechnung, ZUGFeRD or Factur-X.
FAQ: German e-invoice example
Is there an official XRechnung example file?
Yes. KoSIT, the German coordination office responsible for XRechnung, publishes official test invoices together with each XRechnung version. The example on this page is shortened to make it easier to read.
Can I open an XRechnung in a web browser?
A browser only shows the raw XML code. To see a readable invoice, use an XRechnung viewer, which displays the data as a normal invoice layout.
Do I need a Leitweg-ID for a B2B invoice?
No. The Leitweg-ID is the routing ID of German public authorities. XRechnung always requires a buyer reference (BT-10), but between companies this can be an agreed reference such as a purchase order number.
Should I use UBL or CII for XRechnung?
Both syntaxes are allowed and carry the same information. Most invoicing software chooses one automatically. If your customer asks for a specific syntax, follow their request.
Can a foreign company use this example?
The structure of an EN 16931 invoice is the same across the EU, so the example is a useful reference. Whether you are required to issue e-invoices in Germany depends mainly on where your business is established. Our guide to the German mandate explains the rules.
Conclusion
A German e-invoice contains the same information as a traditional invoice, but every detail has a fixed place and a business term code. Once you know the key elements – header, parties, lines, VAT breakdown, totals and payment – XRechnung and ZUGFeRD files become easy to read and check. Software such as XRechnungs.de creates the XML for you, so you only enter the invoice data.
Next step: try XRechnungs.de free for 14 days – up to 50 documents, no credit card required. Plans are listed on the pricing page.