> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gobl.org/llms.txt
> Use this file to discover all available pages before exploring further.

# German XRechnung 3.X

Key: `de-xrechnung-v3`

Module: [github.com/invopop/gobl.de.xinvoice](https://github.com/invopop/gobl.de.xinvoice)

Support for the German XRechnung version 3.X standard for electronic invoicing.
XRechnung is based on the European Norm (EN) 16931 and is mandatory for business-to-government
(B2G) invoices in Germany. This addon provides the necessary structures and validations to
ensure compliance with the XRechnung specifications.

For more information on XRechnung, visit [www.xrechnung.de](https://www.xrechnung.de/).

## Validation Rules

Validation rules check each struct against a set of assertions and report any
failures with a unique code and message.
[Read more about validation](https://docs.gobl.org/overview/validation.md).

> [accordion] bill.Invoice
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `tax.ext` | <ul><li>Ext 'untdid-tax-category' in \[326, 380, 384, 389, 381, 875, 876, 877]</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-01` Tax ext must have a valid UNTDID document type code (BR-DE-17) |
> | `preceding` | <ul><li>Invoice type in \[corrective, credit-note]</li><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-02` Preceding documents are required for corrective and credit note invoices (BR-DE-26) |
> | `supplier` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-03` Supplier is required |
> | `supplier` | <ul><li>Has telephones</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-09` Either party.telephones or party.people\[0].telephones is required (BR-DE-6) |
> | `supplier` | <ul><li>Has emails</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-10` Either party.emails or party.people\[0].emails is required (BR-DE-7) |
> | `supplier.people` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-04` Supplier people is required (BR-DE-5) |
> | `supplier.addresses` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-05` Supplier addresses is required (BR-DE-2) |
> | `supplier.addresses` | <ul><li>Has locality</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-06` Supplier first address must have a locality (BR-DE-3) |
> | `supplier.addresses` | <ul><li>Has code</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-07` Supplier first address must have a postal code (BR-DE-4) |
> | `supplier.inboxes` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-08` Supplier inboxes are required (PEPPOL-EN16931-R020) |
> | `customer` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-11` Customer is required |
> | `customer.addresses` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-12` Customer addresses are required (BR-DE-8) |
> | `customer.addresses` | <ul><li>Has locality</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-13` Customer first address must have a locality (BR-DE-9) |
> | `customer.addresses` | <ul><li>Has code</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-14` Customer first address must have a postal code (BR-DE-10) |
> | `customer.inboxes` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-15` Customer inboxes are required (PEPPOL-EN16931-R010) |
> | `payment` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-16` Payment is required (BR-DE-1) |
> | `payment.instructions` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-17` Payment instructions are required (BR-DE-1) |
> | `payment.instructions.credit_transfer` | <ul><li>Has credit-transfer key</li><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-18` Credit transfer is required for credit-transfer payments (BR-DE-23) |
> | `payment.instructions.credit_transfer[*].number` | <ul><li>No IBAN</li><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-19` Account number is required when IBAN is not provided (BR-DE-19) |
> | `payment.instructions.card` | <ul><li>Has card key</li><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-20` Card details are required for card payments (BR-DE-24) |
> | `payment.instructions.direct_debit` | <ul><li>Has direct-debit key</li><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-21` Direct debit details are required for direct-debit payments (BR-DE-25) |
> | `payment.instructions.direct_debit.ref` | <ul><li>Has direct-debit key</li><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-22` Direct debit mandate reference is required (BR-DE-29) |
> | `payment.instructions.direct_debit.creditor` | <ul><li>Has direct-debit key</li><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-23` Direct debit creditor identifier is required (BR-DE-30) |
> | `payment.instructions.direct_debit.account` | <ul><li>Has direct-debit key</li><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-24` Direct debit account is required (BR-DE-31) |
> | `delivery.receiver` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-25` Delivery receiver is required |
> | `delivery.receiver.addresses` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-26` Delivery receiver addresses are required |
> | `delivery.receiver.addresses` | <ul><li>Has locality</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-27` Delivery receiver first address must have a locality (BR-DE-11) |
> | `delivery.receiver.addresses` | <ul><li>Has code</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-28` Delivery receiver first address must have a postal code (BR-DE-12) |
> | `ordering` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-29` Ordering is required (BR-DE-15) |
> | `ordering.code` | <ul><li>Present</li></ul> | `GOBL-DE-XRECHNUNG-BILL-INVOICE-30` Ordering code is required (BR-DE-15) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.