Skip to content
Fatooraz

Invoices and documents

Previous invoice hash (PIH)

The previous invoice hash (PIH) is the digital fingerprint of the invoice issued just before the current one. Each Phase 2 invoice stores it, which chains your invoices together so that a later change to an earlier invoice becomes visible.

What it means

A hash is a short code calculated from the content of a document. Change a single letter in the document and the code changes. Each Phase 2 invoice stores the hash of the invoice before it, so the second invoice holds the fingerprint of the first, the third holds the fingerprint of the second, and so on. The result is a chain. That is why a hash is described as a fingerprint: it identifies a document the way a fingerprint identifies a person.

The chain matters because it makes the history of your sales hard to rewrite. If someone edited an old invoice after the fact, its fingerprint would no longer match the one stored in the next invoice. That protects honest businesses too: a clean chain shows that your invoices stand as issued, and it is one more reason never to patch invoices behind the system's back.

You do not calculate hashes. The invoicing software works one out for every new invoice and keeps it in the invoice data. Your part is to keep the system consistent: issue invoices only through it, leave its records intact, and try a few invoices in the simulation environment before your wave begins. None of this needs technical knowledge on your part.

In practice

  • Issue every invoice through your invoicing system so the chain stays unbroken.
  • Never edit invoice files or database records directly after an invoice is issued.
  • Fix errors with a credit note or debit note instead of changing what came before.
  • Ask your provider how the chain continues when you replace a till or restore a backup.

Questions about Previous invoice hash (PIH)

What does PIH stand for?

PIH stands for previous invoice hash: the hash, or digital fingerprint, of the invoice issued before this one. Each Phase 2 invoice stores it, and that link between two consecutive invoices is what forms the chain. With the counter value and the UUID, it is one of the technical elements of Phase 2 invoices.

What happens to the chain if I need to correct an invoice?

You do not alter the earlier invoice. You issue a credit note or a debit note, which are e-invoices that refer to the original and give a reason. The correction becomes a new link at the end of the chain, so the history stays complete, the original remains as it was issued, and anyone reviewing your records sees the whole story.

Issue correct invoices without the guesswork

Try Fatooraz free for 90 days in ZATCA’s simulation environment. No credit card needed.