Skip to content

E-invoicing

E-invoicing: XRechnung and ZUGFeRD

Create, receive and check e-invoices in SAPUGO. XRechnung (CII and UBL) and ZUGFeRD, checked against the official rules, with the XML kept as the original.

An e-invoice is an invoice in a structured format that software can read without retyping: an XML file that follows the European standard EN 16931. In Germany the formats are XRechnung and ZUGFeRD. A PDF sent by email is not an e-invoice, even when it looks like one.

SAPUGO creates, reads and checks both formats in workflows. Every file is checked against the official rules before it goes out, and the XML is kept as the original.

Note: This page explains how SAPUGO handles e-invoices. It is not tax advice. Ask your tax adviser which rules apply to your business.

The dates in Germany#

FromWhat applies
1 January 2025Every business must be able to receive e-invoices from other businesses in Germany.
1 January 2027Businesses with more than €800,000 turnover in the previous year must send e-invoices to other businesses.
1 January 2028Every business must send e-invoices to other businesses.

Invoices up to €250 and travel tickets are exempt. Small businesses under § 19 UStG (Kleinunternehmer) do not have to send e-invoices, but they must be able to receive them.

What SAPUGO supports#

FormatCreateReadNotes
XRechnung, CII syntaxYesYesThe German standard. Required by public buyers.
XRechnung, UBL syntaxYesYesThe same content in the other syntax.
ZUGFeRD EN 16931YesYesA PDF with the XML inside. People read the PDF, software reads the XML.
ZUGFeRD EXTENDEDYesYesEN 16931 plus extra fields.
ZUGFeRD XRECHNUNGYesYesAn XRechnung inside a ZUGFeRD PDF.
ZUGFeRD BASICNoYesRead and checked.
ZUGFeRD MINIMUM and BASIC WLNoYesRead, but flagged: they carry no invoice lines and are not e-invoices under German law.

Invoices and credit notes work in every format.

Which format to send#

  • Public buyers (authorities, municipalities): XRechnung. They give you a Leitweg-ID, which goes into the buyer reference.
  • Businesses that want to read the invoice as a PDF too: ZUGFeRD EN 16931.
  • Businesses that only process XML: XRechnung in the syntax they ask for, usually CII.

Store the format on each customer, for example in a single select property, and pass it to Generate E-Invoice. One workflow can then send each customer the format they want.

Send an e-invoice#

  1. Add Generate E-Invoice. Connect the invoice number, the dates, the seller, the buyer and the lines from your invoice record. Set format from the customer.
  2. Keep check_official on. The step computes line amounts, the VAT breakdown and the totals, checks the required details, then checks the file against the official rules.
  3. Continue from Valid. For ZUGFeRD, add Generate Document with your invoice template, then Embed E-Invoice in PDF with that PDF and the XML from Generate E-Invoice.
  4. Store the file on the invoice record with Upload Attachment, in a Files property such as "E-invoice".
  5. Send it with Send Email. See Attach files to an email.
  6. On Invalid, write the problems to the record and stop. Send nothing.
Warning: Never send from the Invalid branch. An invalid e-invoice counts as not sent, and the buyer may reject it.

Lines, seller, buyer and payment are structs. Build them with Make Struct, or ask the assistant in the workflow editor to wire them from your tables.

The details an e-invoice needs#

DetailPinNeeded for
Invoice number, issue date, document type, currencynumber, issue_date, type_code, currencyAll formats
Due date or payment terms, when an amount is duedue_date, payment.termsAll formats
Seller name and address with countrysellerAll formats
Seller VAT ID or tax number, when VAT is chargedseller.vat_id, seller.tax_numberAll formats
Buyer name and address with countrybuyerAll formats
For each line: name, quantity, unit, net price, VAT category and ratelinesAll formats
Buyer reference (for public buyers, the Leitweg-ID)buyer_referenceXRechnung
Seller contact: name, phone, emailseller.contactXRechnung
Seller and buyer city and postcodeseller.address, buyer.addressXRechnung
Seller and buyer electronic addressseller.electronic_address, buyer.electronic_addressXRechnung
Payment means, and the IBAN for a transferpayment.means, payment.ibanXRechnung

A missing detail is reported on validation with the pin it belongs to, such as buyer.address.city, before the official check runs.

VAT categories#

CategoryUse forRate
standardNormal VAT, such as 19 % or 7 %The rate
zero_ratedGoods and services taxed at 0 %0
exemptExempt supplies, and small businesses under § 19 UStG0, and set exemption_reason
reverse_chargeThe buyer pays the VAT (§ 13b UStG)0
intra_communitySupplies to businesses in other EU countries0
exportExports outside the EU0
not_subjectOutside the scope of VATnone

For exempt, set exemption_reason on Generate E-Invoice, for example "Kleinunternehmer gemäß § 19 UStG". The other zero-rate categories get the standard reason automatically.

Credit notes#

Set type_code to credit_note and preceding_invoice to the invoice number and date the credit note corrects. Enter amounts as positive numbers, as on the original invoice.

Receive e-invoices#

Suppliers send e-invoices by email. Set up a shared inbox and a rule that starts a workflow for each incoming email.

  1. In the workflow, add Break Email and loop over its attachments with For Each.
  2. Add Download Attachment for each attachment, then Read E-Invoice with the file.
  3. On Valid, create the supplier invoice record from result, and store the xml output in a Files property. That XML is the original.
  4. Add Show E-Invoice as PDF to store a readable copy next to it, for the people who approve the invoice.
  5. On Invalid, create the record too, but mark it, and send the problems back to the supplier.
  6. On Not an e-invoice, the attachment was a plain PDF or another file. Put it on a list for someone to handle.

Read E-Invoice reads XRechnung in both syntaxes and every ZUGFeRD and Factur-X PDF, including older ZUGFeRD 2 files.

Check an e-invoice and fix problems#

Check E-Invoice checks a file you already have, such as one a customer says they could not process. For a ZUGFeRD PDF it checks the XML and the PDF.

In a test run, click the step to see the E-invoice check: whether the file is valid, whether the official rules ran, and each problem with its rule and where it is.

RuleWhat it meansWhat to fix
BR-DE-15The buyer reference is missing.Ask the buyer for it. Public buyers give a Leitweg-ID.
BR-DE-3 to BR-DE-9An address part or the seller contact is missing.Fill the city, postcode, contact name, phone and email.
BR-CO-25An amount is due, but there is no due date and no payment terms.Set due_date or payment.terms.
BR-S-02VAT is charged, but the seller has no VAT ID or tax number.Set seller.vat_id or seller.tax_number.
BR-AE-02Reverse charge without the buyer's VAT ID.Set buyer.vat_id.
BR-E-10Exempt lines without a reason.Set exemption_reason.
SAPUGO-REQUIREDA detail the format needs is empty.The location names the pin.
SAPUGO-NOT-EINVOICEThe file is not an e-invoice.Ask the sender for XRechnung or ZUGFeRD.
SAPUGO-PROFILEThe file is ZUGFeRD MINIMUM or BASIC WL.Ask the sender for EN 16931 or XRechnung.

Keep the originals#

The XML is the legal invoice, also inside a ZUGFeRD PDF. Store it unchanged in a Files property on the invoice record, and lock the record once the invoice is issued, for example with a guard rule. Keep invoices for the retention period your tax adviser names. In Germany that is currently eight years.

Stuck, or found something missing? Ask the community.

Ask the community

View as MarkdownSuggest an improvement

E-invoicing: XRechnung and ZUGFeRD · Docs · SAPUGO Community