ZATCA Compliance

Rejected ZATCA Invoices: What to Do (and Why You Must Never Delete Them)

Why a rejected ZATCA Phase 2 document must never be deleted, how ICV and PIH hash chains behave after rejection, and exact steps to fix B2B Clearance vs B2C Reporting rejections.

Qeemah Team • Published: • Updated: • 8 min read
Rejected ZATCA Invoices: What to Do (and Why You Must Never Delete Them)

Summarize or verify this guide with AI:

Opens your preferred AI assistant with this article and ZATCA compliance context pre-loaded.

Quick Answer: Why a Rejected ZATCA Document Must Never Be Deleted

In Saudi Arabia’s ZATCA Phase 2 (Fatoora) e-invoicing framework, a rejected invoice or note must never be deleted from your database or invoice sequence. Every generated document is assigned a sequential Invoice Counter Value (ICV, KSA-16) and a cryptographic SHA-256 hash (PIH, KSA-13). Deleting a rejected record creates a broken numbering gap during a ZATCA tax audit and corrupts the cryptographic hash chain for subsequent invoices.

Instead, your ZATCA-compliant ERP must retain the rejected record in an immutable audit log and remediate it based on whether it was a Standard (B2B Clearance) or Simplified (B2C Reporting) document.


B2B Clearance Rejection vs. B2C Reporting Rejection: Exact Remediation Steps

Document FlowLegal Status After ZATCA RejectionShould You Delete It?Correct Remediation Workflow
Standard Tax Invoice (B2B 0100000 — Clearance API)Not legally issued. Buyer cannot claim input VAT until cleared.Never delete. Preserve immutable status (REJECTED).Fix the failing field (e.g., Buyer National Address, VAT number, SupplyDate KSA-5), re-hash/re-sign, and re-submit for Clearance—or mark void in audit log and issue a new sequential invoice.
Simplified Tax Invoice (B2C 0200000 — Reporting API)Already issued to buyer at POS. Must be reported within 24 hours.Never delete. Preserve original XML & hash.If XML/signature failed technically without changing amounts, fix technical signing and re-report; if tax/total values were wrong, issue a linked Credit Note (381) and a corrected invoice.

What Happens to ICV and PIH After a Rejection?

One of the most frequent developer mistakes occurs when an invoice fails at /invoices/clearance/single or /invoices/reporting/single and the ERP rolls back the database transaction:

  • If you roll back ICV and PIH after saving or after another branch already chained off that hash: Your next invoice will fail with PIH mismatch or duplicate ICV errors.
  • Best Practice: Validate all BR-KSA-* business rules before assigning the final sequential ICV/PIH and signing the XML. Once an ICV and PIH are persisted, treat the record as permanent—even if ZATCA returns REJECTED.

Top 4 Causes of ZATCA Rejections (and How to Prevent Them)

  1. BR-KSA-31 — Invalid Invoice Hash: XML was formatted or modified after computing the canonicalized SHA-256 hash. View BR-KSA-31 fix →
  2. BR-KSA-40 — Invalid QR Code Structure: Missing 9-tag TLV fields on Simplified (0200000) invoices. Verify with ZATCA QR Decoder →
  3. BR-KSA-08 / Buyer Identifier Missing: Standard B2B invoice missing Buyer VAT (3...3), CRN, or National Address fields. View BR-KSA-08 fix →
  4. Missing BillingReference or KSA-10 on Credit Notes: Issuing a 381 Credit Note without linking the original invoice ID and reason. Read Credit Note Guide →

Eliminate ZATCA Rejections Before Submission with Qeemah Cloud

Qeemah Cloud validates every mandatory KSA field (SupplyDate, Buyer National Address, VAT math, and BillingReference) before locking your ICV/PIH sequence or calling ZATCA’s API—so rejections don’t corrupt your ledger or stall your cashiers.

Frequently Asked Questions

Why must a rejected ZATCA document never be deleted?

Under ZATCA Phase 2 controls, every generated e-invoice or note consumes a sequential Invoice Counter Value (ICV, KSA-16) and participates in the cryptographic Previous Invoice Hash (PIH, KSA-13) chain. Deleting a rejected document creates a gap in your audit sequence and can break PIH continuity if subsequent invoices already chained off its hash.

What is the difference between a B2B Clearance rejection and a B2C Reporting rejection?

For Standard B2B invoices (Clearance), a rejected invoice is NOT legally issued—you must preserve the audit record, correct the underlying data error (such as missing buyer VAT/address or SupplyDate KSA-5), and re-submit. For Simplified B2C invoices (Reporting), the receipt was already handed to the customer; if ZATCA rejects it, you must remediate the technical error and issue a linked Credit Note (381) plus a corrected invoice if financial/tax values changed.

How do I find out why ZATCA rejected my invoice?

Inspect the ZATCA Fatoora API response validationResults.errorMessages array for BR-KSA-* codes, or paste your XML into Qeemah's free ZATCA XML Validator and look up the error code in our ZATCA Error Codes Directory.

Works Cited & Technical References

  1. Zakat, Tax and Customs Authority (ZATCA) — Electronic Invoicing Resolution, Controls & Detailed Technical Guidelines.
  2. ZATCA — XML Implementation Standard & Invoice Counter Value (ICV) / Previous Invoice Hash (PIH) Controls.

Recommended next steps

Share this article