# E-invoices (XRechnung, ZUGFeRD)

In a workspace in Germany every invoice is also an **e-invoice**, twice over: when you publish it,
docket writes an **XRechnung** (the German standard, EN 16931) next to the PDF, and the PDF itself
becomes a **ZUGFeRD** PDF, which carries the same data inside. It looks like any PDF; accounting
software that reads ZUGFeRD takes the figures from it. docket keeps both as they went out, and they
state the same lines, VAT and totals as the printed invoice, to the cent. German businesses must send
their invoices to other German businesses this way from 2027 (over 800,000 € turnover) or 2028
(everyone); either format counts.

## Where to find it

- The ZUGFeRD data is inside the invoice's PDF, wherever you download or send it.
- The XRechnung in the invoice: **E-invoice (XML)** next to **Preview**.
- In the billing cycle's list: **⋯ → Download e-invoice (XML)**.
- In the mail docket sends its followers when the invoice is published, as an attachment.
- In the workspace export, next to each invoice's PDF.

Invoices published before e-invoices existed keep their PDF only. Drafts are previewed as plain PDFs.

## What publishing asks for

An e-invoice must name more than a PDF does. Until it can be written, publishing an invoice is
refused with a list of what is missing.

**Administration → Settings → Invoicing:**
- **Company name**, **Street and number**, **Postal code** and **Town**: your letterhead prints them,
  the e-invoice names you as the seller with them. **Further letterhead lines** (e-mail, phone,
  website) are printed under them.
- **Tax Number** or **VAT No.**; EU reverse charge needs the VAT No.
- **IBAN** (and **BIC**): where the invoice asks to be paid.
- Under **E-invoice**, a **Contact name**, **Contact phone** and **Contact e-mail**: whom the
  customer's accounting can reach about an invoice.

**The customer's address** (Administration → Customers → Addresses): postal code, town, country and an
**Invoice e-mail**, where the customer receives e-invoices. Without one, the customer's own e-mail is
used.

## The buyer reference

Every XRechnung carries a **buyer reference**, so the customer can route it internally. docket uses,
in this order:

1. the address's own **Buyer reference**: for a public client the **Leitweg-ID** it gave you
   (the e-invoice then goes to that Leitweg-ID);
2. the billing cycle's PO number: a custom field named like "PO" or "Bestellnummer";
3. the customer number.

## Austria and Switzerland

There, only public clients require e-invoices, in formats docket doesn't send (ebInterface or Peppol in
Austria, eBill in Switzerland). docket still writes the EU standard's XML (EN 16931, without
Germany's XRechnung rules) when the invoice has what it needs: your **Company name**, **Postal
code** and **Town**, the **IBAN**, your **VAT No.** or **Tax Number**, and the customer's country.
It is then under **E-invoice (XML)** like in Germany; otherwise the invoice is published without it.
Nothing is ever refused for it, and the PDF stays a plain PDF.