BR-KSA-61: Previous invoice hash (PIH) is missing

A warning: the invoice is accepted with a note; fix the cause in the next invoices.

Official text

Previous invoice hash (KSA-13) must exist in an invoice.

Warning · Source: ZATCA E-Invoicing SDK 238-R3.3.8 · Electronic Invoice XML Implementation Standard v1.2, 19 May 2023, §13.3.1, p. 58 · Checked: 26 October 2026

What it means

Every invoice must carry the PIH reference, even the first one on a device (which carries the fixed value ZATCA published).

When it happens

How to fix it

  1. For the first invoice, use the fixed value given in the text of rule BR-KSA-26.
  2. Store each invoice's hash after it is accepted, somewhere that survives a reinstall.
  3. Add the PIH reference to every invoice and note.

Example

Wrong: raises BR-KSA-61
<cac:AdditionalDocumentReference>
  <cbc:ID>ICV</cbc:ID>
  <cbc:UUID>10</cbc:UUID>
</cac:AdditionalDocumentReference>
<!-- no PIH reference -->
Correct
<cac:AdditionalDocumentReference>
  <cbc:ID>ICV</cbc:ID>
  <cbc:UUID>10</cbc:UUID>
</cac:AdditionalDocumentReference>
<cac:AdditionalDocumentReference>
  <cbc:ID>PIH</cbc:ID>
  <cac:Attachment>
    <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">NWZlY2Vi…</cbc:EmbeddedDocumentBinaryObject>
  </cac:Attachment>
</cac:AdditionalDocumentReference>

We ran the wrong example through ZATCA's SDK 238-R3.3.8 on 26 October 2026 and it raised BR-KSA-61. The example is an excerpt of ZATCA's sample Simplified/Invoice/Simplified_Invoice.xml with one change; the sample without it does not raise the code.

Related codes

Terms on this page

Frequently asked questions

What does BR-KSA-61 mean?

Every invoice must carry the PIH reference, even the first one on a device (which carries the fixed value ZATCA published).

Is the invoice rejected when BR-KSA-61 appears?

A warning: the invoice is accepted with a note; fix the cause in the next invoices. This is its severity in ZATCA's SDK 238-R3.3.8.

How do I fix BR-KSA-61?

1. For the first invoice, use the fixed value given in the text of rule BR-KSA-26. 2. Store each invoice's hash after it is accepted, somewhere that survives a reinstall. 3. Add the PIH reference to every invoice and note.

Last updated: 26 October 2026 · What we don't do · Methodology · Correct us · Changelog

First published 2026-10-26 · Archived copy

First 500 restaurants, cafés, bakeries and sweet shops: a SAR 99 monthly cap.

Instead of SAR 149, per branch, for a full year. Free to join, no commitment.

Reserve your seat