# BR-CL-01 Invoice type code must come from UNTDID 1001

The invoice type code (BT-3) must be one of the invoice or credit note codes that EN 16931 takes from UNTDID 1001. In UBL, the Invoice and CreditNote documents each have their own list.

## Problem Description

> **ERROR**: EN 16931 code-list rule (BR-CL)

## Context and Significance

BT-3 tells the receiver whether to book the document as an invoice or as a credit note. In UBL, 381 is valid only in cbc:CreditNoteTypeCode: an ERP that exports every document as an Invoice with 381 fails this rule, while the same code passes in CII. Another cause is an internal document type such as "INV" or "RE" written instead of a code. Map every internal document type to a UNTDID 1001 code before export. XRechnung additionally limits the allowed codes (BR-DE-17).

## Solution

Set BT-3 to a valid code, e.g. 380 (commercial invoice), 326 (partial invoice), 384 (corrected invoice), 389 (self-billed invoice) or 875–877 (construction invoices). Send a credit note with code 381 as a UBL CreditNote (cbc:CreditNoteTypeCode), not as an Invoice. In CII, the code goes in rsm:ExchangedDocument/ram:TypeCode.

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

## Valid Examples

- BT-3 = 380 — commercial invoice (UBL Invoice)
- BT-3 = 381 — credit note (in UBL only in a CreditNote document)

## Invalid Examples

- BT-3 = 381 in cbc:InvoiceTypeCode of a UBL Invoice — credit note codes belong in a CreditNote
- BT-3 = INV — internal document type instead of a code
- BT-3 = 999 — not part of UNTDID 1001

## Code Examples

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

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

## Affected Fields

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

## Related Rules

- [BR-DE-17](/resources/kosit-validator-errors/br-de-17-invoice-type-code-should-be-xrechnung-supported)

## 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://docs.peppol.eu/poacc/billing/3.0/rules/ubl-tc434/)
- [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.
