<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Timo Kleemann</title>
    <description>The latest articles on DEV Community by Timo Kleemann (@timokleemann).</description>
    <link>https://dev.to/timokleemann</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4265118%2Fa1c33f5a-ad83-436f-9b3e-7da685c4a932.jpeg</url>
      <title>DEV Community: Timo Kleemann</title>
      <link>https://dev.to/timokleemann</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/timokleemann"/>
    <language>en</language>
    <item>
      <title>E-invoicing (XRechnung, ZUGFeRD) explained, with examples</title>
      <dc:creator>Timo Kleemann</dc:creator>
      <pubDate>Wed, 25 Nov 2026 16:34:17 +0000</pubDate>
      <link>https://dev.to/timokleemann/e-invoicing-xrechnung-zugferd-explained-with-examples-3he1</link>
      <guid>https://dev.to/timokleemann/e-invoicing-xrechnung-zugferd-explained-with-examples-3he1</guid>
      <description>&lt;p&gt;If your program issues or accepts invoices, you will want to support one or both common formats. Here are some notes on this area and some example files.&lt;/p&gt;

&lt;p&gt;I am the founder of BillingEngine, which generates many of these files, so the examples are taken from there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Definition of e-invoices
&lt;/h2&gt;

&lt;p&gt;Simply emailing a PDF does not qualify. E-invoices conform to EN 16931 and so consist of machine-readable information. In reality there are only 2 variations: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;XRechnung: XML only. A German specification based on EN 16931, required by (most) government offices.&lt;/li&gt;
&lt;li&gt;ZUGFeRD: a human-readable PDF plus machine-readable information. Known as Factur-X in France. However, ZUGFeRD "MINIMUM" and "BASIC WL" are explicitly excluded from being e-invoices.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both UBL and CII are valid representations of EN 16931. Both may be used for XRechnung, but only CII is applicable to ZUGFeRD. I have only shown CII below. &lt;/p&gt;

&lt;h2&gt;
  
  
  When is it required?
&lt;/h2&gt;

&lt;p&gt;When invoicing other companies in Germany: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;from 1 January 2025 all companies must be able to accept them;&lt;/li&gt;
&lt;li&gt;until 31 December 2026 invoices can still be sent on paper or, if the recipient agrees, in other formats;&lt;/li&gt;
&lt;li&gt;until 31 December 2027 this also applies if revenue in the previous year was no more than 800,000 EUR;&lt;/li&gt;
&lt;li&gt;thereafter all companies must send e-invoices. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Various exclusions apply, such as for invoices of 250 EUR or less, or §19 UStG companies issuing invoices. I am of course not a tax advisor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contents
&lt;/h2&gt;

&lt;p&gt;In CII, all information is under a top-level CrossIndustryInvoice element. You may want to start by identifying which profile applies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;ram:GuidelineSpecifiedDocumentContextParameter&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;ram:ID&amp;gt;&lt;/span&gt;urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0&lt;span class="nt"&gt;&amp;lt;/ram:ID&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;/ram:GuidelineSpecifiedDocumentContextParameter&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Many values are identified with a "BT" number in the specification. Some of the more useful: &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Location&lt;/th&gt;
&lt;th&gt;BT&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Invoice ID&lt;/td&gt;
&lt;td&gt;ExchangedDocument/ID&lt;/td&gt;
&lt;td&gt;BT-1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Type&lt;/td&gt;
&lt;td&gt;ExchangedDocument/TypeCode&lt;/td&gt;
&lt;td&gt;BT-3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Buyer reference&lt;/td&gt;
&lt;td&gt;ApplicableHeaderTradeAgreement/BuyerReference&lt;/td&gt;
&lt;td&gt;BT-10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total tax&lt;/td&gt;
&lt;td&gt;.../TaxTotalAmount&lt;/td&gt;
&lt;td&gt;BT-110&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gross total&lt;/td&gt;
&lt;td&gt;.../GrandTotalAmount&lt;/td&gt;
&lt;td&gt;BT-112&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Payable&lt;/td&gt;
&lt;td&gt;.../DuePayableAmount&lt;/td&gt;
&lt;td&gt;BT-115&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Pitfalls
&lt;/h2&gt;

&lt;p&gt;Buyer reference: required in XRechnung. Government offices will provide a routing ID (Leitweg-ID); otherwise some other appropriate information should be supplied when invoicing other businesses.&lt;/p&gt;

&lt;p&gt;0% tax: as well as the obvious 0 percentage and calculated amount, you should specify the applicable category and an exemption reason:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;ram:ApplicableTradeTax&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;ram:CalculatedAmount&amp;gt;&lt;/span&gt;0.00&lt;span class="nt"&gt;&amp;lt;/ram:CalculatedAmount&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;ram:TypeCode&amp;gt;&lt;/span&gt;VAT&lt;span class="nt"&gt;&amp;lt;/ram:TypeCode&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;ram:ExemptionReason&amp;gt;&lt;/span&gt;Gemäß § 19 UStG wird keine Umsatzsteuer berechnet.&lt;span class="nt"&gt;&amp;lt;/ram:ExemptionReason&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;ram:BasisAmount&amp;gt;&lt;/span&gt;380.00&lt;span class="nt"&gt;&amp;lt;/ram:BasisAmount&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;ram:CategoryCode&amp;gt;&lt;/span&gt;E&lt;span class="nt"&gt;&amp;lt;/ram:CategoryCode&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;ram:RateApplicablePercent&amp;gt;&lt;/span&gt;0&lt;span class="nt"&gt;&amp;lt;/ram:RateApplicablePercent&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;/ram:ApplicableTradeTax&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reversing amounts: the relevant invoice should be left intact. Instead you create another invoice, specifying 381 as the type, with positive amounts and a reference to the original invoice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;p&gt;I have created various example files, available &lt;a href="https://github.com/billingengine/e-invoice-examples" rel="noopener noreferrer"&gt;here&lt;/a&gt;. All information relating to customers, companies, products, and so on, is invented. As well as "normal" invoices with 1 or 2 rates of tax and a discount, there is a 0% tax example as above, a cancellation, and one where the customer has no postal code and city.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validation
&lt;/h2&gt;

&lt;p&gt;You can run validation locally using &lt;a href="https://github.com/itplr-kosit/validator" rel="noopener noreferrer"&gt;KoSIT's program&lt;/a&gt;, with &lt;a href="https://github.com/itplr-kosit/validator-configuration-xrechnung" rel="noopener noreferrer"&gt;configuration&lt;/a&gt; to check for conformance to XRechnung. Online, we offer &lt;a href="https://www.billingengine.com/en/tools/e-invoice-validator" rel="noopener noreferrer"&gt;our e-invoice validator&lt;/a&gt; and &lt;a href="https://www.billingengine.com/en/tools/e-invoice-viewer" rel="noopener noreferrer"&gt;our e-invoice viewer&lt;/a&gt;, which displays the contents of the XML.&lt;/p&gt;

&lt;p&gt;Are there particular aspects you have found difficult to implement?&lt;/p&gt;

</description>
      <category>einvoicing</category>
      <category>xml</category>
      <category>germany</category>
      <category>api</category>
    </item>
  </channel>
</rss>
