# BR-55 Preceding invoice reference must carry a reference identifier

Each Preceding Invoice reference (BG-3) shall contain a Preceding Invoice reference (BT-25).

## Problem Description

Each Preceding Invoice reference (BG-3) shall contain a Preceding Invoice reference (BT-25).

> **ERROR**: XRechnung 3.0

## Context and Significance

This rule comes from the EN16931 core semantic model enforced by the KoSIT XRechnung 3.0.2 Schematron, ensuring invoices carry the mandatory data needed for automated processing.

## Solution

Add cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID with the identifier of the preceding invoice being corrected or referenced.

- validate
- convert

## Valid Examples

- BT-25 = "INV-2026-0007" referencing the corrected invoice

## Invalid Examples

- Billing reference group present with no InvoiceDocumentReference ID

## Code Examples

### Valid XML
```
<cac:BillingReference>
  <cac:InvoiceDocumentReference>
    <cbc:ID>INV-2026-0007</cbc:ID>
  </cac:InvoiceDocumentReference>
</cac:BillingReference>
```

### Invalid XML
```
<cac:BillingReference>
  <cac:InvoiceDocumentReference/>
</cac:BillingReference>
```

## Affected Fields

- [BT-25 Preceding Invoice reference](/resources/xrechnung/bt-25-preceding-invoice-reference)

## Related Rules

- [BR-52](/resources/kosit-validator-errors/br-52-supporting-document-reference-required)

## 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.
