# BR-DEX-05 Legal registration identifier scheme must use an ISO 6523 code

Any scheme identifier on a legal registration identifier (Seller BT-30, Buyer BT-47, Payee BT-61) must be coded using one of the ISO 6523 ICD code list entries.

## Problem Description

Any scheme identifier on a legal registration identifier (Seller BT-30, Buyer BT-47, Payee BT-61) must be coded using one of the ISO 6523 ICD code list entries.

> **ERROR**: XRechnung 3.0

## Context and Significance

This XRechnung Extension rule fires only in the Extension scenario, which relaxes the core severity to permit additional ISO 6523 scheme codes for legal registration identifiers.

## Solution

Set the @schemeID on cac:PartyLegalEntity/cbc:CompanyID to a valid ISO 6523 ICD value. If you do not need Extension registration schemes, the standard XRechnung CIUS profile avoids this rule.

- validate
- convert

## Valid Examples

- <cbc:CompanyID schemeID="0002">12345678900</cbc:CompanyID>

## Invalid Examples

- <cbc:CompanyID schemeID="LOCAL">12345</cbc:CompanyID> — LOCAL is not ISO 6523

## Code Examples

### Valid XML
```
<cac:PartyLegalEntity>
  <cbc:CompanyID schemeID="0002">12345678900</cbc:CompanyID>
</cac:PartyLegalEntity>
```

### Invalid XML
```
<cac:PartyLegalEntity>
  <cbc:CompanyID schemeID="LOCAL">12345678900</cbc:CompanyID>
</cac:PartyLegalEntity>
```

## Affected Fields

- [BT-30 Seller legal registration identifier](/resources/xrechnung/bt-30-seller-legal-registration-identifier)
- [BT-47 Buyer legal registration identifier](/resources/xrechnung/bt-47-buyer-legal-registration-identifier)
- [BT-61 Payee legal registration identifier](/resources/xrechnung/bt-61-payee-legal-registration-identifier)

## Related Rules

- [BR-DEX-04](/resources/kosit-validator-errors/br-dex-04-party-identifier-iso-6523-scheme)
- [BR-DE-21](/resources/kosit-validator-errors/br-de-21-specification-identifier-syntax)

## Validation Tools

- [Official KoSIT Validator](https://erechnungsvalidator.service-bw.de/): Validate your XRechnung files against all BR-DE rules.
- [Convert PDF to XRechnung](/pdf-to-xrechnung): Automatic validation error fixes when converting.

## Related Resources

- [Official Specification](https://xeinkauf.de/xrechnung/)
- [Test Suite](https://github.com/itplr-kosit/xrechnung-testsuite)
- [Complete Error List](/resources/kosit-validator-errors): Overview of all German XRechnung validation rules.
