Skip to main content

E-Invoicing Germany

ESR.DDto Fields​

NameDescriptionFormatExample for DDto
Email
(B2B)
Email address of the receiverRegex"j.doe@efsta.eu"
Leitweg ID (B2G)The Leitweg ID is an identifier of an electronic invoice for the unique addressing of public contracting authorities in GermanyRegex"0204:991-33333TEST-33"

Business-to-Business E-Invoicing (B2B)​

B2B E-Invoices must be created in the XRechnung format, just like B2G E-Invoices in Germany.

After receiving the valid B2B Invoice data via the EFR API, the EFR will forward it to our E-Invoicing service which creates the XRechnung and sends it to the buyer’s email address. The XRechnung can also be downloaded by the taxpayer directly from the efsta E-Invoicing view in the efsta Portal.

Example Request
{
"Tra": {
"ESR":
{"D": "2024-06-01T08:30:15", "TL": "001", "TT": "1", "TN": "1", "T": "8.38", "Opr": "101", "OprN": "Mario Rossi", "OprTIN": "xxx", "TP": "Table 1",
"DT": "INVOICE", "DD": "DE", "DDto": "john.doe@example.com",
"Ctm": { "TaxId": "DE123456789", "Nam": "Buyer Company", "Adr": "Teststreet 3", "Zip": "60306", "City": "Frankfurt", "Ctry": "DE" },
"PosA": [
{ "_": "Pos", "PN": "1", "IN": "9521234510017", "Dsc": "Example Item", "TaxG": "A", "Amt": "3.98", "Qty": "2", "QtyU": "Pc.", "Pri": "1.99", "Cat": "10", "CatN": "Example Category 10"},
{ "_": "Pos", "PN": "2", "IN": "9521234510208", "Dsc": "Example Item", "TaxG": "B", "Amt": "1.50", "Cat": "11", "CatN": "Example Category 11" },
{ "_": "Lin", "Dsc": "Subtotal", "LAmt": "5.48" },
{ "_": "Pos", "PN": "3", "IN": "9521234510307", "Dsc": "Example Item", "TaxG": "A", "Amt": "2.90", "Cat": "12", "CatN": "Example Category 12" }
],
"PayA": [
{ "_": "Pay", "Dsc": "Example Payment", "PayG": "cash", "Amt": "10.00" },
{ "_": "Pay", "Dsc": "Example Change", "PayG": "change", "Amt": "-1.62" }
]
}
}
}

Business-to-Government E-Invoicing (B2G)​

B2G E-Invoices are transmitted through the Peppol-Network using our own efsta Peppol Access Point.

Example Request
{
"Tra": {
"ESR":
{"D": "2024-06-01T08:30:15", "TL": "001", "TT": "1", "TN": "1", "T": "8.38", "Opr": "101", "OprN": "Mario Rossi", "OprTIN": "xxx", "TP": "Table 1",
"DT": "INVOICE", "DD": "DE", "DDto": "0204:991-33333TEST-33",
"Ctm": { "TaxId": "DE123456789", "Nam": "Buyer Company", "Adr": "Teststreet 3", "Zip": "60306", "City": "Frankfurt", "Ctry": "DE" },
"PosA": [
{ "_": "Pos", "PN": "1", "IN": "9521234510017", "Dsc": "Example Item", "TaxG": "A", "Amt": "3.98", "Qty": "2", "QtyU": "Pc.", "Pri": "1.99", "Cat": "10", "CatN": "Example Category 10"},
{ "_": "Pos", "PN": "2", "IN": "9521234510208", "Dsc": "Example Item", "TaxG": "B", "Amt": "1.50", "Cat": "11", "CatN": "Example Category 11" },
{ "_": "Lin", "Dsc": "Subtotal", "LAmt": "5.48" },
{ "_": "Pos", "PN": "3", "IN": "9521234510307", "Dsc": "Example Item", "TaxG": "A", "Amt": "2.90", "Cat": "12", "CatN": "Example Category 12" }
],
"PayA": [
{ "_": "Pay", "Dsc": "Example Payment", "PayG": "cash", "Amt": "10.00" },
{ "_": "Pay", "Dsc": "Example Change", "PayG": "change", "Amt": "-1.62" }
]
}
}
}

Field Mapping: ESR to XRechnung​

Which fields the partner system sends per invoice and the XRechnung business term (BT) each one feeds. B2B and B2G use the same XRechnung format. Only DDto and the delivery channel differ. Field definitions: EFR rule set and Additional Properties.

M mandatory · C conditional: mandatory under the stated condition · O optional · Partner sent in the request · derived set by efsta from what is sent

Document​

Header and references.

ESR fieldBusiness termReq.SourceBTSince
EFR
Rules
ESR.InvoiceNumberInvoice numberOPartnerBT-12.5.5The invoice number. Without InvoiceNumber, the document number ESR.DN is used. Without both, the fiscal number ESR.FN that the EFR assigns to the transaction is used.
ESR.DInvoice issue dateMPartnerBT-22.5.5ISO 8601 date-time, e.g. 2024-06-01T08:30:15.
sign of ESR.TInvoice type codeMderivedBT-32.5.5380 invoice. 381 credit note if the total ESR.T is negative, e.g. for a return or a void. The amounts of a credit note are shown as positive values.
ESR.RFNPreceding invoice referenceCPartnerBT-252.5.5Reference to the original invoice. Send it with every credit note: the fiscal number ESR.FN of the invoice that is referenced. The value is written to the e-invoice unchanged. If ESR.RD is sent, it is written as the issue date of the original invoice (BT-26).
Ctm.BuyerReferenceBuyer referenceOPartnerBT-102.5.5Mandatory in every XRechnung (BR-DE-15). If it is not sent, efsta fills it with ESR.DDto: the Leitweg-ID for B2G, the e-mail address for B2B.
ESR.OrderReferencePurchase order referenceOPartnerBT-132.5.5The buyer's purchase order number.
ESR.DueDatePayment due dateOPartnerBT-92.5.5Only if it differs from the configured terms of payment. YYYY-MM-DD.
ESR.PaymentTermsPayment termsOPartnerBT-202.5.5Only if it differs from the configured terms, e.g. "30 days net".

Buyer​

From ESR.Ctm and ESR.DDto.

ESR fieldBusiness termReq.SourceBTSince
EFR
Rules
Ctm.NamBuyer nameMPartnerBT-442.5.5Name of the buyer company.
Ctm.TaxIdBuyer VAT identifierCPartnerBT-482.5.5Mandatory for B2B. With country prefix, e.g. DE123456789. An invalid value rejects the request.
ESR.DDtoBuyer electronic addressMPartnerBT-492.5.5E-mail address for B2B, Leitweg-ID for B2G (table above). Missing or invalid: the request is rejected.
Ctm.Adr, Ctm.Zip, Ctm.CityBuyer address line, post code, cityMPartnerBT-50,
BT-53,
BT-52
2.5.5Post code and city: BR-DE-8/9.
Ctm.CtryBuyer country codeOPartnerBT-552.5.5ISO 3166-1 alpha-2 in upper case, e.g. DE. Without it, the country prefix of Ctm.TaxId is used, otherwise DE.

Delivery​

From ESR.Delivery.

ESR fieldBusiness termReq.SourceBTSince
EFR
Rules
Delivery.DActual delivery dateOPartnerBT-722.5.5The date on which the goods or services were delivered. YYYY-MM-DD.

Payment​

From ESR.PayA.

ESR fieldBusiness termReq.SourceBTSince
EFR
Rules
Pay.PayGPayment means type codeMderivedBT-812.5.5Derived from the payment group sent (ESR standard codes, see Payment Groups).

VAT Breakdown​

One Tax entry per tax group in ESR.TaxA.

ESR fieldBusiness termReq.SourceBTSince
EFR
Rules
Tax.TaxGVAT category codeMderivedBT-1182.5.5Derived from the rate of the tax group: S above 0 %, E at 0 %. The letter of the tax group is not written. At 0 % the German description of the tax group is sent as exemption reason (BT-120), e.g. "Umsatzsteuerfrei" for F.
Tax.PrcVAT category rateMderivedBT-1192.5.5Tax percentage, e.g. 19, 7, 0. BR-DE-14.
Tax.Net, Tax.TAmtVAT category taxable amount, VAT amountMderivedBT-116,
BT-117
2.5.5Net and tax amount per tax group, calculated from ESR.PosA. Net and tax amount must add up to the gross amount Tax.Amt.

Totals​

From ESR.TaxA and ESR.PayA.

ESR fieldBusiness termReq.SourceBTSince
EFR
Rules
sum of Tax.NetInvoice total amount without VATMderivedBT-1092.5.5Sum over all tax groups.
sum of Tax.TAmtInvoice total VAT amountMderivedBT-1102.5.5Sum over all tax groups.
sum of Tax.AmtInvoice total amount with VATMderivedBT-1122.5.5Sum over all tax groups.
sum of Pay.AmtPaid amountOderivedBT-1132.5.5Sum of the payments, except open items (PayG="open" or PayG="8").
–Amount due for paymentMderivedBT-1152.5.5BT-112 minus BT-113: 0.00 for an invoice paid in full at the point of sale.

Invoice Lines​

One Pos per line in ESR.PosA.

ESR fieldBusiness termReq.SourceBTSince
EFR
Rules
Pos.PNInvoice line identifierMPartnerBT-1262.5.5Position number.
Pos.DscItem nameMPartnerBT-1532.5.5Common name of the goods or services.
Pos.Qty, Pos.QtyUInvoiced quantity, unit of measureMPartnerBT-129,
BT-130
2.5.5Quantity and its unit, e.g. Qty="2" and QtyU="kg". Both can be left out for one piece.
Pos.AmtInvoice line net amount, item net priceMPartnerBT-131,
BT-146
2.5.5Position amount (Qty × Pri), gross. The net values are derived from the line's tax group.
Pos.TaxGInvoiced item VAT category code and rateMPartnerBT-151,
BT-152
2.5.5Tax group of the line, e.g. A.
Pos.SvcStartD, Pos.SvcEndDInvoice line periodOPartnerBT-134,
BT-135
2.5.5Start and end date of the service period, YYYY-MM-DD.
Pos.OrderLineReferenceReferenced purchase order lineOPartnerBT-1322.5.5Line of the buyer's purchase order.

Optional References​

Additional Properties.

ESR fieldBusiness termReq.SourceBTSince
EFR
Rules
ESR.SellerOrderReferenceSales order referenceOPartnerBT-142.5.5The seller's own order number, e.g. a reservation confirmation. Not a substitute for BT-10 or BT-13.
ESR.ContractDocumentReferenceContract referenceOPartnerBT-122.5.5The contract the invoice refers to.
ESR.ProjectReferenceProject referenceOPartnerBT-112.5.5On credit notes sent as an additional document reference (type code 50).
Ctm.AccountingReferenceBuyer accounting referenceOPartnerBT-192.5.5The cost centre the buyer books the invoice on.
ESR.Metadata entry with Key="InvoiceNote"Invoice noteOPartnerBT-222.8.3Free text on invoice level, sent as the Value of the entry.
Which EFR version do I have?

Fields marked with a minimum version are only passed on to the e-invoice from that EFR version onwards. Check the installed version with GET /state (field version) and update the EFR before sending these fields.

Company Configuration to XRechnung​

Seller data is written to every XRechnung from the company configuration (Cfg – Base data), maintained in the efsta Portal (Quick Start › Configuration). The merchant, or the partner on their behalf, sets it. efsta does not configure it. Nothing from this table is sent per invoice. If a value is set in both the location and the company configuration, the location value is used. If several companies share one EFR, ESR.TaxId must be sent in every request to select the company.

Cmp – Company​

Or Loc – Location.

Config propertyPortal tabBusiness termReq.BTRules
Cmp.NamCompanySeller nameMBT-27
Cmp.labelCompanySeller trading nameOBT-28Shown as the sender name of the XRechnung e-mail. If no label is set, the company name is used.
Cmp.TaxIdCompanySeller VAT identifierMBT-31With DE prefix. A missing prefix is added. A VAT number in the profile takes precedence. BR-DE-16.
Cmp.Adr, Zip, City, CtryCompanySeller postal addressMBT-35,
BT-38,
BT-37,
BT-40
Street and house number in Adr. Post code and city: BR-DE-3/4.

Doc – E-Invoicing: Seller Contact​

Mandatory in XRechnung (BR-DE-2).

Config propertyPortal tabBusiness termReq.BTRules
Doc.ContactNamee-InvoiceSeller contact pointMBT-41BR-DE-5.
Doc.ContactTelephonee-InvoiceSeller contact telephoneMBT-42BR-DE-6.
Doc.ContactElectronicMaile-InvoiceSeller contact e-mailMBT-43BR-DE-7. Also receives the correction e-mail when DDto or Ctm.TaxId is invalid.

Doc – E-Invoicing: Payment​

Config propertyPortal tabBusiness termReq.BTRules
Doc.AccountIBAN, AccountBIC, AccountNamee-InvoicePayment account identifier, payment service provider, account nameCBT-84,
BT-86,
BT-85
AccountIBAN is mandatory for every invoice that is not paid by card.
Doc.PaymentPeriod, PaymentTermse-InvoicePayment due date, payment termsOBT-9,
BT-20
Used when the invoice does not send ESR.DueDate or ESR.PaymentTerms, e.g. 30 and "30 days net". Without PaymentPeriod the due date is 30 days after the invoice date.
Important

Set the e-Invoice configuration in the efsta Portal. ContactElectronicMail must be filled so the seller is notified when an e-invoice cannot be delivered.

Response and the Most Common Errors​

Result codes follow the EFR rule set. The e-invoice is built and checked against the XRechnung rules while the EFR registers the transaction, so most errors are returned directly in the response.

OutcomeHTTPBodyWhat the partner does
Accepted200Result RC="OK"Continue as usual. The e-invoice is generated and delivered, status in the Portal.
Rejected400Result RC="BAD" ErrorCode="…" with the code of the failed check. All messages are in Warning.Correct the data and resend. Nothing is generated.
Not processable now406Result RC="NO"Retry later.
Not exhaustive

Validation runs in several modules and in the XRechnung validator, so this list covers the errors we see most with partners, not every possible error. Errors of the XRechnung validator carry the rule ID as ErrorCode, e.g. #BR-DE-15.

ErrorCodeCauseWhat to check
#CFG_MISSSeller configuration incomplete, e.g. contact name, contact telephone or IBANComplete the company configuration in the Portal (see Company Configuration to XRechnung).
#CFG_TAXIDSeller VAT identifier missing or invalidThe VAT number in the company configuration.
#MISSA mandatory value is missing, most often the recipient ESR.DDtoThe message in Warning names the field. Always send DDto: the buyer's e-mail address (B2B) or Leitweg-ID (B2G).
#INVALIDA value is not valid, most often the buyer VAT number or the format of the recipient IDThe message in Warning names the field. Send the VAT ID with its country prefix, e.g. DE123456789. Send the Leitweg-ID with its scheme, e.g. 0204:991-33333TEST-33.
#ParticipantNotFoundB2G: the Leitweg-ID is valid, but nobody is registered under it in the Peppol networkConfirm the Leitweg-ID with the public authority before invoicing.
#DIFFNet and tax amount of a tax group do not add up to its gross amountAmounts of the positions and tax groups.

Errors found after the request is accepted, when the XRechnung is built and delivered, are handled in one of two ways. Errors in the buyer data are sent to the merchant for correction. All other errors are shown in the Portal only.

Buyer data errors: correction e-mail​

The e-invoice is held and ContactElectronicMail receives an e-mail that explains the problem and links to a form where the merchant corrects the field and sends the e-invoice again (Use Cases › Correcting). For Germany these are:

SituationField correctedFlowHow the partner prevents it
No recipient
no buyer e-mail address or Leitweg-ID
ESR.DDtoB2B, B2GAlways send DDto: the buyer's e-mail address (B2B) or Leitweg-ID (B2G).
Recipient ID in the wrong format
not scheme:number, wrong check digit or unknown scheme
ESR.DDtoB2B, B2GB2G: send the Leitweg-ID with its scheme, e.g. 0204:991-33333TEST-33. B2B: send a valid e-mail address.
Recipient not reachable via Peppol
the ID is valid, but nobody is registered under it for this document type
ESR.DDtoB2GConfirm the Leitweg-ID with the public authority before invoicing.
Buyer VAT number invalid
fails the format or validation check
ESR.Ctm.TaxIdB2B, B2GSend the VAT ID with its country prefix, e.g. DE123456789.

The correction link is valid for 30 days. Without a ContactElectronicMail, these errors are shown in the Portal only.

Enduser Instructions​

Here you can find a guide specifically for endusers to properly set up their E-Invoicing system, available in english and german.