fakturai blog

Example & sample

E-invoice example (XML): what a German e-invoice looks like

Short answer: a German e-invoice is not a styled PDF — it is a structured data set per EN 16931. Every sample is built from the same blocks: header, seller and buyer, invoice lines, a VAT breakdown and the totals. Below is an annotated XRechnung XML excerpt with the key EN 16931 fields (BT/BG codes) — and how to turn it into a genuinely valid file.

The building blocks of an e-invoice (EN 16931)

Whether XRechnung (pure XML) or ZUGFeRD/Factur-X (PDF with embedded XML), both carry the same fields. EN 16931 groups them into Business Terms (BT-…) and Business Groups (BG-…). Every sample has to cover at least these:

XRechnung example (UBL XML, annotated)

The excerpt below shows an XRechnung in UBL syntax with the core mandatory blocks; the comments name each EN 16931 code. Important: this is a deliberately simplified teaching sample, not a fully valid file — a real XRechnung 3.0 requires further mandatory data (e.g. the seller's electronic address, payment terms, contact details).

<?xml version="1.0" encoding="UTF-8"?>
<ubl:Invoice
  xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
  xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
  xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">

  <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID>
  <cbc:ID>RE-2026-0042</cbc:ID>                              <!-- BT-1  Invoice number -->
  <cbc:IssueDate>2026-06-16</cbc:IssueDate>                  <!-- BT-2  Issue date -->
  <cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>             <!-- BT-3  Invoice type (380 = commercial invoice) -->
  <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>   <!-- BT-5  Currency -->
  <cbc:BuyerReference>04011000-12345-67</cbc:BuyerReference> <!-- BT-10 Leitweg-ID (B2G only) -->

  <cac:AccountingSupplierParty>                              <!-- BG-4  Seller -->
    <cac:Party>
      <cac:PartyName><cbc:Name>Muster GmbH</cbc:Name></cac:PartyName>
      <cac:PostalAddress>
        <cbc:StreetName>Musterstrasse 1</cbc:StreetName>
        <cbc:CityName>Berlin</cbc:CityName>
        <cbc:PostalZone>10115</cbc:PostalZone>
        <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>
      </cac:PostalAddress>
      <cac:PartyTaxScheme>
        <cbc:CompanyID>DE123456789</cbc:CompanyID>            <!-- BT-31 Seller VAT ID -->
        <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
      </cac:PartyTaxScheme>
    </cac:Party>
  </cac:AccountingSupplierParty>

  <cac:AccountingCustomerParty>                              <!-- BG-7  Buyer -->
    <cac:Party>
      <cac:PartyName><cbc:Name>Kunde AG</cbc:Name></cac:PartyName>
      <cac:PostalAddress>
        <cbc:StreetName>Kundenweg 2</cbc:StreetName>
        <cbc:CityName>Muenchen</cbc:CityName>
        <cbc:PostalZone>80331</cbc:PostalZone>
        <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>
      </cac:PostalAddress>
    </cac:Party>
  </cac:AccountingCustomerParty>

  <cac:TaxTotal>
    <cbc:TaxAmount currencyID="EUR">19.00</cbc:TaxAmount>     <!-- BT-110 Total VAT amount -->
    <cac:TaxSubtotal>                                        <!-- BG-23 VAT breakdown -->
      <cbc:TaxableAmount currencyID="EUR">100.00</cbc:TaxableAmount> <!-- BT-116 -->
      <cbc:TaxAmount currencyID="EUR">19.00</cbc:TaxAmount>          <!-- BT-117 -->
      <cac:TaxCategory>
        <cbc:ID>S</cbc:ID>                                  <!-- BT-118 VAT category (S = standard rate) -->
        <cbc:Percent>19.00</cbc:Percent>                    <!-- BT-119 VAT rate -->
        <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
      </cac:TaxCategory>
    </cac:TaxSubtotal>
  </cac:TaxTotal>

  <cac:LegalMonetaryTotal>                                   <!-- BG-22 Document totals -->
    <cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount> <!-- BT-106 -->
    <cbc:TaxExclusiveAmount currencyID="EUR">100.00</cbc:TaxExclusiveAmount>   <!-- BT-109 -->
    <cbc:TaxInclusiveAmount currencyID="EUR">119.00</cbc:TaxInclusiveAmount>   <!-- BT-112 -->
    <cbc:PayableAmount currencyID="EUR">119.00</cbc:PayableAmount>             <!-- BT-115 Amount due -->
  </cac:LegalMonetaryTotal>

  <cac:InvoiceLine>                                          <!-- BG-25 Invoice line -->
    <cbc:ID>1</cbc:ID>                                       <!-- BT-126 -->
    <cbc:InvoicedQuantity unitCode="C62">2</cbc:InvoicedQuantity>              <!-- BT-129 Quantity (C62 = piece) -->
    <cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount> <!-- BT-131 Line net amount -->
    <cac:Item>
      <cbc:Name>Consulting service</cbc:Name>               <!-- BT-153 Item name -->
      <cac:ClassifiedTaxCategory>
        <cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent>
        <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
      </cac:ClassifiedTaxCategory>
    </cac:Item>
    <cac:Price>
      <cbc:PriceAmount currencyID="EUR">50.00</cbc:PriceAmount>               <!-- BT-146 Net unit price -->
    </cac:Price>
  </cac:InvoiceLine>
</ubl:Invoice>

XRechnung vs ZUGFeRD: same data, different packaging

An XRechnung example is a single .xml file. A ZUGFeRD/Factur-X sample is a PDF/A-3 carrying the same data set as embedded CII XML — a readable invoice plus the machine-readable part in one file. Both meet the mandate as long as they use an EN 16931-compliant profile (for ZUGFeRD: COMFORT/EN 16931 or higher, not MINIMUM or BASIC-WL). Which one to pick: XRechnung or ZUGFeRD — which one you need.

From sample to a valid file

  1. Generate instead of hand-typing. fakturai builds a ZUGFeRD/Factur-X or XRechnung file from your data and checks it against a KoSIT-aligned accept gate before delivery — so you get a concrete, checked invoice rather than a sample.
  2. Validate an existing file. Already have a sample or real file? Upload it to the free validator and see, without an account, whether it meets EN 16931.

Validate an e-invoice for free

Common mistakes with samples

What fakturai does not replace

fakturai checks and generates the technical format and structural compliance per EN 16931 with a KoSIT-aligned accept gate. The content and tax correctness of the invoice, proper archiving and accounting treatment remain your responsibility. fakturai is not tax advice and makes no legal, tax or delivery guarantees.

Next step

Free German e-invoice validator · Create an API key

Related: XRechnung or ZUGFeRD · ZUGFeRD vs XRechnung vs EN 16931 · Leitweg-ID · Validation checklist

Free validator · Create API key · API docs