BR-KSA-56: Credit and debit notes must reference the original invoice (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
- BR-04 · Every invoice needs an invoice type code (BT-3)
- BR-55 · A billing reference must give the preceding invoice number (BT-25)
- BR-KSA-05 · Invoice type code must be 388, 383, 381 or 386
- BR-KSA-17 · Credit and debit notes need a reason for issuing
- BR-KSA-73 · Prepaid amount (BT-113) requires full prepayment reference on lines
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