Missing Invoice After Database Restore – ICV Mismatch (Invoice #118)

Description
Hello ZATCA developer community,

We’ve encountered the following scenario in our local system:

  1. We successfully issued Invoice #118, updated our local ICV to 118, and computed its hash.
  2. We submitted the invoice to the FATOORA platform and received its IRN and InvoiceHash.
  3. Our client’s database suffered a failure, and when we restored from an older backup:
    • The local ICV reverted to 117
    • Invoice #118 no longer exists in our database
    • We still have the original XML file for Invoice 118

As a result, there’s now a gap in our local invoice sequence, even though Invoice 118 is officially recorded on ZATCA’s side.


Questions

  1. Re‑submission:
    Can we re-send Invoice 118 using the existing XML, or will the platform reject it since it’s already registered?

  2. Local Recovery:
    What is the correct procedure to fill this sequence gap locally without breaking the ICV chain or risking penalties?

  3. Failure Notification:
    Should we file a “Failure Notification” via the Verify Taxpayer API for the affected period?

  4. Continuation:
    Once Invoice 118 is restored, how should we proceed with Invoice 119 regarding ICV and PIH?


Additional Details

  • Invoice 118 XML: We have the original XML with its IRN and InvoiceHash.
  • Previous PIH: Before the incident, PIH(118) = hash of Invoice 117.
  • The restore did not affect any other invoices or future IRNs/UUIDs.

Thank you!

2 Likes

My opinion in such these cases (server failor or windows problems …) is to revoke the existing CCSID and issue new one so start with counter = 1

1 Like

The safest approach is to revoke and issue a new CSID.
ZATCA says (from June?) they will keep submitted documents for 24 hours to avoid (and report) duplicate submissions.
If this process starts working, then we can get the last ICV details and won’t need to revoke.
I hope they show the list of documents submitted in the last 24 hours at fatoora.zatca.gov.sa.

1 Like

We have the last value of ICV, by the way.
As long as we have the XML files.

What about if the xml content was included in the missing database ?