BR-KSA-56: Credit and debit notes must reference the original invoice (BT-25)

Explained by Matheel from ZATCA's rule text and the condition SDK 3.4.8 executes · Updated

Warning: accepted with a warningCredit and debit notesFields: BT-3, BT-25

When cbc:InvoiceTypeCode (BT-3) is 381 (credit note) or 383 (debit note), the document must have at least one cac:BillingReference, and each cac:BillingReference must contain a non-empty cac:InvoiceDocumentReference/cbc:ID (BT-25).

How to fix it

Add <cac:BillingReference><cac:InvoiceDocumentReference><cbc:ID>…</cbc:ID></cac:InvoiceDocumentReference></cac:BillingReference> with the original invoice number.

ZATCA's official text

[BR-KSA-56]-For credit notes ((BT-3) has the value of 381) and debit notes ((BT-3) has the value of 383), the billing reference ID (BT-25) is mandatory.
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules

Fails when (the condition ZATCA's SDK runs)

not(exists(./cac:InvoiceDocumentReference/cbc:ID) and (./cac:InvoiceDocumentReference/cbc:ID) != '')

Related rules

Validate your invoice against ZATCA's rules

Paste the XML and see every error and warning. It runs in your browser; the invoice goes nowhere.

Validate an invoice or try Matheel