# BR-DE-17 Invoice type code should use the XRechnung supported code set

While the UN/ECE UNTDID 1001 code list contains dozens of commercial document types, XRechnung explicitly restricts and optimizes the supported invoice type codes (BT-3) to a defined set of recognized document types: 380 (Commercial invoice / Handelsrechnung), 381 (Credit note / Gutschrift), 384 (Corrected invoice / Berichtigte Rechnung), 389 (Self-billed invoice / Gutschrift im Gutschriftsverfahren), 326 (Partial invoice / Teilrechnung), 875 (Partial construction invoice / Abschlagsrechnung Bau), 876 (Partial final construction invoice / Teilschlussrechnung Bau), and 877 (Final construction invoice / Schlussrechnung Bau). Using unlisted codes triggers a KoSIT validator warning and may cause recipient enterprise billing systems to reject the document.

## Problem Description

> **WARNING**: German XRechnung rule (KoSIT, BR-DE) · XRechnung 3.0

## Context and Significance

Rule BR-DE-17 is a warning-level rule in the official KoSIT Schematron rulepack. However, public recipient portals may reject unsupported codes during downstream ERP document ingestion.

## Solution

Map your ERP document types to one of the official UNTDID 1001 codes supported by XRechnung: use 380 for standard commercial invoices, 381 for credit notes, 384 for corrected invoices, 389 for self-billed invoices, 326 for partial invoices, or 875/876/877 for German construction billing. In UBL 2.1 syntax, populate <cbc:InvoiceTypeCode> (or <cbc:CreditNoteTypeCode> for credit notes). In UN/CEFACT CII syntax, populate <ram:TypeCode> within <rsm:ExchangedDocument>.

- [Validate XML](/en/xrechnung-validator?source=resource&rule=BR-DE-17)
- [Convert invoice](/en/pdf-to-xrechnung?source=resource&rule=BR-DE-17)

## Valid Examples

- BT-3 = "380" (Commercial invoice)
- BT-3 = "381" (Credit note)
- BT-3 = "384" (Corrected invoice referencing previous invoice in BG-3)

## Invalid Examples

- BT-3 = "82" (Metered services invoice - unsupported code in XRechnung code list)
- BT-3 = "INV-01" (Free-text string instead of 3-digit UNTDID 1001 numeric code)

## Code Examples

### Valid XML
```
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
```

### Invalid XML
```
<cbc:InvoiceTypeCode>82</cbc:InvoiceTypeCode>
```

## Affected Fields

- [BT-3 Invoice type code](/resources/xrechnung/bt-3-invoice-type-code)

## Related Rules

- [BR-04](/resources/kosit-validator-errors/br-04-invoice-type-code-required)
- [BR-DE-26](/resources/kosit-validator-errors/br-de-26-preceding-invoice-reference-required)

## Validation Tools

- [Official KoSIT Validator](https://github.com/itplr-kosit/validator): Run the official KoSIT validator with the XRechnung configuration to check EN 16931 and XRechnung rules.
- [Convert PDF to XRechnung](/pdf-to-xrechnung): Find validation errors during conversion and review each correction.

## Related Resources

- [Official Specification](https://xeinkauf.de/xrechnung/)
- [Test Suite](https://github.com/itplr-kosit/xrechnung-testsuite)
- [All validation errors](/resources/kosit-validator-errors): Overview of the EN 16931, XRechnung and Peppol validation rules explained here.
