E-Invoicing Germany
ESR.DDto Fields
| Name | Description | Format | Example for DDto |
|---|---|---|---|
| Email (B2B) | Email address of the receiver | Regex | "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 Germany | Regex | "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
- JSON
- XML
{
"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" }
]
}
}
}
<Tra>
<ESR D="2024-06-01T08:30:15" TL="001" TT="1" TN="1" T="8.38" Opr="101" OprN="Mario Rossi" OprTIN="12345678" 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" />
</PosA>
<PayA>
<Pay Dsc="Example Payment" PayG="cash" Amt="10.00" />
<Pay Dsc="Example Change" PayG="change" Amt="-1.62" />
</PayA>
</ESR>
</Tra>
Business-to-Government E-Invoicing (B2G)
B2G E-Invoices are transmitted through the Peppol-Network using our own efsta Peppol Access Point.
Example Request
- JSON
- XML
{
"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" }
]
}
}
}
<Tra>
<ESR D="2024-06-01T08:30:15" TL="001" TT="1" TN="1" T="8.38" Opr="101" OprN="Mario Rossi" OprTIN="12345678" 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" />
</PosA>
<PayA>
<Pay Dsc="Example Payment" PayG="cash" Amt="10.00" />
<Pay Dsc="Example Change" PayG="change" Amt="-1.62" />
</PayA>
</ESR>
</Tra>
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 field | Business term | Req. | Source | BT | Since EFR | Rules |
|---|---|---|---|---|---|---|
ESR.InvoiceNumber | Invoice number | O | Partner | BT-1 | 2.5.5 | The 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.D | Invoice issue date | M | Partner | BT-2 | 2.5.5 | ISO 8601 date-time, e.g. 2024-06-01T08:30:15. |
sign of ESR.T | Invoice type code | M | derived | BT-3 | 2.5.5 | 380 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.RFN | Preceding invoice reference | C | Partner | BT-25 | 2.5.5 | Reference 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.BuyerReference | Buyer reference | O | Partner | BT-10 | 2.5.5 | Mandatory 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.OrderReference | Purchase order reference | O | Partner | BT-13 | 2.5.5 | The buyer's purchase order number. |
ESR.DueDate | Payment due date | O | Partner | BT-9 | 2.5.5 | Only if it differs from the configured terms of payment. YYYY-MM-DD. |
ESR.PaymentTerms | Payment terms | O | Partner | BT-20 | 2.5.5 | Only if it differs from the configured terms, e.g. "30 days net". |
Buyer
From ESR.Ctm and ESR.DDto.
| ESR field | Business term | Req. | Source | BT | Since EFR | Rules |
|---|---|---|---|---|---|---|
Ctm.Nam | Buyer name | M | Partner | BT-44 | 2.5.5 | Name of the buyer company. |
Ctm.TaxId | Buyer VAT identifier | C | Partner | BT-48 | 2.5.5 | Mandatory for B2B. With country prefix, e.g. DE123456789. An invalid value rejects the request. |
ESR.DDto | Buyer electronic address | M | Partner | BT-49 | 2.5.5 | E-mail address for B2B, Leitweg-ID for B2G (table above). Missing or invalid: the request is rejected. |
Ctm.Adr, Ctm.Zip, Ctm.City | Buyer address line, post code, city | M | Partner | BT-50, BT-53, BT-52 | 2.5.5 | Post code and city: BR-DE-8/9. |
Ctm.Ctry | Buyer country code | O | Partner | BT-55 | 2.5.5 | ISO 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 field | Business term | Req. | Source | BT | Since EFR | Rules |
|---|---|---|---|---|---|---|
Delivery.D | Actual delivery date | O | Partner | BT-72 | 2.5.5 | The date on which the goods or services were delivered. YYYY-MM-DD. |
Payment
From ESR.PayA.
| ESR field | Business term | Req. | Source | BT | Since EFR | Rules |
|---|---|---|---|---|---|---|
Pay.PayG | Payment means type code | M | derived | BT-81 | 2.5.5 | Derived from the payment group sent (ESR standard codes, see Payment Groups). |
VAT Breakdown
One Tax entry per tax group in ESR.TaxA.
| ESR field | Business term | Req. | Source | BT | Since EFR | Rules |
|---|---|---|---|---|---|---|
Tax.TaxG | VAT category code | M | derived | BT-118 | 2.5.5 | Derived 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.Prc | VAT category rate | M | derived | BT-119 | 2.5.5 | Tax percentage, e.g. 19, 7, 0. BR-DE-14. |
Tax.Net, Tax.TAmt | VAT category taxable amount, VAT amount | M | derived | BT-116, BT-117 | 2.5.5 | Net 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 field | Business term | Req. | Source | BT | Since EFR | Rules |
|---|---|---|---|---|---|---|
sum of Tax.Net | Invoice total amount without VAT | M | derived | BT-109 | 2.5.5 | Sum over all tax groups. |
sum of Tax.TAmt | Invoice total VAT amount | M | derived | BT-110 | 2.5.5 | Sum over all tax groups. |
sum of Tax.Amt | Invoice total amount with VAT | M | derived | BT-112 | 2.5.5 | Sum over all tax groups. |
sum of Pay.Amt | Paid amount | O | derived | BT-113 | 2.5.5 | Sum of the payments, except open items (PayG="open" or PayG="8"). |
| – | Amount due for payment | M | derived | BT-115 | 2.5.5 | BT-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 field | Business term | Req. | Source | BT | Since EFR | Rules |
|---|---|---|---|---|---|---|
Pos.PN | Invoice line identifier | M | Partner | BT-126 | 2.5.5 | Position number. |
Pos.Dsc | Item name | M | Partner | BT-153 | 2.5.5 | Common name of the goods or services. |
Pos.Qty, Pos.QtyU | Invoiced quantity, unit of measure | M | Partner | BT-129, BT-130 | 2.5.5 | Quantity and its unit, e.g. Qty="2" and QtyU="kg". Both can be left out for one piece. |
Pos.Amt | Invoice line net amount, item net price | M | Partner | BT-131, BT-146 | 2.5.5 | Position amount (Qty × Pri), gross. The net values are derived from the line's tax group. |
Pos.TaxG | Invoiced item VAT category code and rate | M | Partner | BT-151, BT-152 | 2.5.5 | Tax group of the line, e.g. A. |
Pos.SvcStartD, Pos.SvcEndD | Invoice line period | O | Partner | BT-134, BT-135 | 2.5.5 | Start and end date of the service period, YYYY-MM-DD. |
Pos.OrderLineReference | Referenced purchase order line | O | Partner | BT-132 | 2.5.5 | Line of the buyer's purchase order. |
Optional References
| ESR field | Business term | Req. | Source | BT | Since EFR | Rules |
|---|---|---|---|---|---|---|
ESR.SellerOrderReference | Sales order reference | O | Partner | BT-14 | 2.5.5 | The seller's own order number, e.g. a reservation confirmation. Not a substitute for BT-10 or BT-13. |
ESR.ContractDocumentReference | Contract reference | O | Partner | BT-12 | 2.5.5 | The contract the invoice refers to. |
ESR.ProjectReference | Project reference | O | Partner | BT-11 | 2.5.5 | On credit notes sent as an additional document reference (type code 50). |
Ctm.AccountingReference | Buyer accounting reference | O | Partner | BT-19 | 2.5.5 | The cost centre the buyer books the invoice on. |
ESR.Metadata entry with Key="InvoiceNote" | Invoice note | O | Partner | BT-22 | 2.8.3 | Free text on invoice level, sent as the Value of the entry. |
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 property | Portal tab | Business term | Req. | BT | Rules |
|---|---|---|---|---|---|
Cmp.Nam | Company | Seller name | M | BT-27 | |
Cmp.label | Company | Seller trading name | O | BT-28 | Shown as the sender name of the XRechnung e-mail. If no label is set, the company name is used. |
Cmp.TaxId | Company | Seller VAT identifier | M | BT-31 | With DE prefix. A missing prefix is added. A VAT number in the profile takes precedence. BR-DE-16. |
Cmp.Adr, Zip, City, Ctry | Company | Seller postal address | M | BT-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 property | Portal tab | Business term | Req. | BT | Rules |
|---|---|---|---|---|---|
Doc.ContactName | e-Invoice | Seller contact point | M | BT-41 | BR-DE-5. |
Doc.ContactTelephone | e-Invoice | Seller contact telephone | M | BT-42 | BR-DE-6. |
Doc.ContactElectronicMail | e-Invoice | Seller contact e-mail | M | BT-43 | BR-DE-7. Also receives the correction e-mail when DDto or Ctm.TaxId is invalid. |
Doc – E-Invoicing: Payment
| Config property | Portal tab | Business term | Req. | BT | Rules |
|---|---|---|---|---|---|
Doc.AccountIBAN, AccountBIC, AccountName | e-Invoice | Payment account identifier, payment service provider, account name | C | BT-84, BT-86, BT-85 | AccountIBAN is mandatory for every invoice that is not paid by card. |
Doc.PaymentPeriod, PaymentTerms | e-Invoice | Payment due date, payment terms | O | BT-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. |
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.
| Outcome | HTTP | Body | What the partner does |
|---|---|---|---|
| Accepted | 200 | Result RC="OK" | Continue as usual. The e-invoice is generated and delivered, status in the Portal. |
| Rejected | 400 | Result 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 now | 406 | Result RC="NO" | Retry later. |
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.
| ErrorCode | Cause | What to check |
|---|---|---|
#CFG_MISS | Seller configuration incomplete, e.g. contact name, contact telephone or IBAN | Complete the company configuration in the Portal (see Company Configuration to XRechnung). |
#CFG_TAXID | Seller VAT identifier missing or invalid | The VAT number in the company configuration. |
#MISS | A mandatory value is missing, most often the recipient ESR.DDto | The message in Warning names the field. Always send DDto: the buyer's e-mail address (B2B) or Leitweg-ID (B2G). |
#INVALID | A value is not valid, most often the buyer VAT number or the format of the recipient ID | The 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. |
#ParticipantNotFound | B2G: the Leitweg-ID is valid, but nobody is registered under it in the Peppol network | Confirm the Leitweg-ID with the public authority before invoicing. |
#DIFF | Net and tax amount of a tax group do not add up to its gross amount | Amounts 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:
| Situation | Field corrected | Flow | How the partner prevents it |
|---|---|---|---|
| No recipient no buyer e-mail address or Leitweg-ID | ESR.DDto | B2B, B2G | Always 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.DDto | B2B, B2G | B2G: 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.DDto | B2G | Confirm the Leitweg-ID with the public authority before invoicing. |
| Buyer VAT number invalid fails the format or validation check | ESR.Ctm.TaxId | B2B, B2G | Send 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.