# Validate a German invoice

Check the German invoice fields, buyer reference and amounts before submission. Use the returned validation errors to correct a rejected GETS payload.

## Checks before submission

The required fields depend on whether you send a tax invoice, credit note or debit note and on any modifiers. Use the [Germany field reference](https://docs.complyance.io/countries/de/fields/) for GETS paths; these name the standard invoice fields, not elements in the generated XML.

In the field reference’s **Table** view, check **Requirement**, **Type**, **Description** and **Enums**. **Requirement** covers all document types, modifiers and variants; read **Description** for conditional requirements. Choose **List with sample request** to select your document type, modifiers and variant and see the applicable fields beside a sample request.

| Check | What to correct |
| - | - |
| Invoice identity | Supply an invoice number, issue date, currency and the envelope’s `documentType`. Complyance copies the envelope’s document type into `payload.header.documentType`, replacing any value there. Use an invoice number you have not already sent. |
| Parties | Include seller and buyer names, countries, cities and postal codes. Supply the seller contact’s name, email and phone; enter a seller tax identifier when the VAT treatment requires one. |
| Buyer reference | Supply the buyer reference (BT-10 Buyer reference): `extensions.peppol_buyerAccountingReference` on a B2B invoice, or the Leitweg-ID in `extensions.de_leitwegId` on a B2G invoice (`BR-DE-15`). For an invoice to a German public authority, get the **buyer’s** Leitweg-ID and send it in `extensions.de_leitwegId`; the buyer uses it for routing. A domestic B2B invoice generally does not require a Leitweg-ID. |
| Items and totals | Supply each line’s identity, description, quantity, unit, net price, tax category, tax amount and line total. `lineTotal` is the line’s net amount, before VAT. Check that line values, tax and invoice totals agree; supply a positive tax rate for a standard-rated (`S`) line. |
| Payment | Include a payment method. A bank-transfer payment needs the payee’s account identifier; direct debit needs its applicable account and creditor details. |

These checks reflect the fields and conditions you send through GETS. The e-invoice Complyance produces is Peppol BIS Billing 3.0, checked against the [EN 16931 rules](https://docs.peppol.eu/poacc/billing/3.0/rules/ubl-tc434/) and the [Peppol rules](https://docs.peppol.eu/poacc/billing/3.0/rules/ubl-peppol/), which include Germany’s national `DE-R-*` rules for a German seller. Check the recipient’s submission requirements as well; passing the API’s validation is not proof that a public-sector recipient has accepted the invoice.

## Read a rejection

If `POST /api/v3/unify` returns HTTP `422`, inspect every entry in `errors`. `getsPath` names the field to correct in GETS; `payloadPath` points to your submitted payload. `message` describes the problem, and `code` identifies a published rule when one is available. For example, if `totals.amountDue` is missing, add the amount payable and check it against the invoice totals before retrying. See [Unify errors](https://docs.complyance.io/api-reference/unify/errors/) for the response fields and other statuses.

If the API returns `200`, retain `documentId` and [follow the document status](https://docs.complyance.io/api-reference/unify/submit-and-retrieve/) to learn whether delivery succeeds.

Source: https://docs.complyance.io/countries/de/validation-rules/
