Compliance

ZATCA E-Invoicing in Saudi Arabia: A Complete Practical Guide

Most ZATCA guides explain the rules. This one explains what the rules do to your software — where invoices actually fail, what onboarding really involves, and how to decide between replacing your ERP and wrapping it in an integration layer.

10 min readUpdated February 2026

Our ZATCA e-invoicing solution Talk to an engineer

On this page

  1. What ZATCA actually asks of your software
  2. Phase 1 and Phase 2: what changed
  3. Clearance vs reporting
  4. Anatomy of a compliant invoice
  5. EGS onboarding, CSID and the sandbox
  6. Common failure modes
  7. Replace the ERP or add an integration layer?
  8. How Inovsion helps
  9. Frequently asked questions

What ZATCA actually asks of your software

ZATCA — the Zakat, Tax and Customs Authority — runs Saudi Arabia's e-invoicing programme under the name Fatoora. At policy level it sounds like a documentation exercise: issue invoices electronically, include the right VAT fields, share them with the authority. At engineering level it is something else. Fatoora asks your billing system to produce a specific XML document, sign it with a key ZATCA issued to that system, chain it cryptographically to the invoice before it, and — for a whole class of invoices — obtain approval before the buyer may see the document at all.

That last point catches teams out. E-invoicing gets filed under "finance and tax", so it lands with the finance team as a reporting obligation. But a rule that inserts an external API call between "user presses Save" and "customer receives invoice" is not a reporting obligation. It is a change to your transaction path, with every availability, latency and failure-handling question that implies.

The framing that helps. Treat ZATCA compliance as a distributed systems problem with a tax deadline attached, not a tax problem with some code attached. Every hard part — ordering, retries, idempotency, key custody — is a systems problem wearing a compliance label.

The upside is worth stating honestly. E-invoicing will not transform your finance function on its own. What it delivers is a structured, machine-readable record of every sale, validated at source, with a tamper-evident chain behind it. Reconciliation gets faster, VAT returns stop being archaeology, and disputes are settled by pointing at a signed document. Teams that later invest in business intelligence or data analytics find the groundwork already done.

Phase 1 and Phase 2: what changed

The programme arrived in two stages, and the distinction still matters because plenty of systems in the field satisfy the first and not the second.

Phase 1, "Generation", applied from 4 December 2021. It required invoices to be issued and stored electronically in a structured format, simplified invoices to carry a QR code, and mandatory VAT fields to be present. Notably, it did not require you to talk to ZATCA at all — a compliant Phase 1 system could be entirely self-contained. That is precisely why the step to Phase 2 is larger than the numbering suggests.

Phase 2, "Integration", applied from 1 January 2023 and has rolled out in waves defined by revenue thresholds. Your E-invoicing Generation Solution must now integrate with the Fatoora platform itself. Invoices become UBL 2.1 XML (or PDF/A-3 with the XML embedded), each carrying a cryptographic stamp, a UUID, an invoice hash and the previous invoice hash. The stamp uses a cryptographic stamp identifier — a CSID — obtained by onboarding the generating unit with ZATCA.

On waves and thresholds. ZATCA has advanced the wave schedule repeatedly, and each wave has its own threshold and compliance date. We deliberately name no "current" wave anywhere on this site, because such a claim is wrong within months. Taxpayers in scope are notified directly. Confirm your position against ZATCA's published guidance and your own notification — the only source authoritative on the day you read it.

Clearance vs reporting

Phase 2 splits invoices down a line that determines your architecture. Getting this wrong is expensive, because the two models have opposite failure characteristics.

Clearance covers standard tax invoices — broadly B2B and B2G. The invoice goes to Fatoora and must be cleared by ZATCA before you share it with the buyer. This is synchronous, and it sits on your critical path.

Reporting covers simplified tax invoices — broadly B2C. The buyer gets the invoice immediately; you report it within 24 hours. This is asynchronous and forgiving of transient failure, which is what a retail till needs.

 Clearance (standard)Reporting (simplified)
Typical useB2B and B2G invoicesB2C, point of sale
TimingBefore the buyer receives itWithin 24 hours of issue
Call patternSynchronous, on the critical pathAsynchronous, queued
If ZATCA is unreachableInvoice cannot be issued yet — needs a queue and a clear operational ruleTill keeps trading; queue drains later
Buyer seesThe cleared documentThe stamped document with QR
Main engineering riskLatency and availability couplingBacklog and ordering in the queue

Most businesses of any size issue both. A distributor with a trade counter, or a clinic billing insurers and walk-in patients, runs clearance and reporting side by side — one codebase carrying two delivery models. Operators hitting this from the POS side should read our restaurant POS notes alongside this guide, since offline tolerance at the till is where the two models collide hardest.

Anatomy of a compliant invoice

Strip away the acronyms and a Phase 2 invoice is a structured document plus some cryptographic bookkeeping.

The PIH deserves a moment. Chaining makes invoice ordering a correctness property, not a convenience. You cannot regenerate invoice 500 once 501 exists, let two instances issue against one EGS identity concurrently, or restore a database to yesterday and carry on. Any system whose numbering was "whatever the sequence gives us" now has a real consistency requirement — one ordinary application design handles fine, but only if you know it is there before you build.

EGS onboarding, CSID and the sandbox

An EGS — E-invoicing Generation Solution — is whatever unit actually produces invoices. Not your company, and not your ERP as an abstract product: the concrete generating unit. A till. A branch instance. A company code. A billing microservice. Each is onboarded individually and receives its own CSID, binding it to your VAT registration so every stamped invoice is attributable to a known source.

The practical consequence surprises people. Forty tills across a dozen branches is not one onboarding; it is forty, each with a certificate to install, renew and eventually revoke. You now operate a small PKI estate — an operational commitment, not a project task, and it needs an owner. Where those units run on cloud infrastructure, design the key custody story deliberately alongside your AWS or Azure setup.

ZATCA provides a sandbox, and our consistent advice is to get into it earlier than feels comfortable — ideally before the ERP work is scoped. The sandbox is where you discover that your credit notes reference the original invoice in a way the profile rejects, that line-level discounts do not reconcile to the header, or that a customer's VAT number has a stray space in it. Cheap findings in month one; expensive ones in the week before your compliance date. Nothing in the specification is difficult — the difficulty lives entirely in the gap between the specification and the data you already have.

Common failure modes

The same handful of problems recur. None are exotic; all are avoidable if you know to look.

Replace the ERP or add an integration layer?

This is the decision most Saudi businesses actually face, and it is often presented dishonestly — usually by whoever sells the replacement. So, plainly: in most cases you do not need to replace your ERP to comply with ZATCA Phase 2.

An integration layer sits beside your existing system. It reads invoice data, generates the UBL 2.1 XML, applies the stamp, manages the PIH chain, handles clearance or reporting, and gives you a console for failures. Your ERP keeps doing what it does. The requirements are modest: invoice data must be accurate and reachable — an API, a database view, even a scheduled export will do.

ConsiderationIntegration layerReplace the ERP
Scope of changeInvoicing path onlyFinance, operations, reporting, training
Typical timelineWeeksMonths, often across a fiscal boundary
Risk profileContained; original system stays as fallbackMigration risk across the whole business
Fixes bad source data?No — surfaces it, does not repair itOnly if you genuinely re-model the data
Sensible whenERP data is sound and reachableERP is end of life, or invoice data is structurally unreliable
Main trapLayer papering over data quality nobody fixesCompliance deadline driving a decision that should be strategic

The honest exception: if your invoice data is structurally unreliable — VAT treatment decided by whoever raises the invoice, free-text discounts, the same customer existing five times — no integration layer will save you. It will faithfully transmit the mess and ZATCA will reject it. That is a data problem, and it wants fixing regardless. It may justify a broader ERP programme — but make that call on its own merits, not because a compliance date forced your hand. Our construction ERP and clinic ERP notes cover the same trade-off by sector.

How Inovsion helps

Inovsion has built and delivered an ERP-integrated ZATCA e-invoice solution: EGS onboarding and integration, broad ERP compatibility, and automated compliance and validation. It is a real product, and we work with clients in Saudi Arabia — RiyadhPharma among them — alongside our engineering work across the UAE and India.

What that means in practice:

For the product view, see our ZATCA e-invoicing solution. If you are weighing a wider programme in the Kingdom, our Saudi Arabia engineering page covers how we work there, and our work shows what we have delivered — from ClueMaster's IoT-enabled escape room platform to the Rising Walls property portal.

Frequently asked questions

What is the difference between ZATCA clearance and reporting?

Clearance applies to standard tax invoices, typically B2B and B2G. The invoice must be sent to the Fatoora platform and cleared by ZATCA before you share it with the buyer, so clearance sits inside your invoicing flow. Reporting applies to simplified tax invoices, typically B2C. The invoice is given to the buyer immediately at the point of sale and reported to ZATCA within 24 hours, so reporting can be handled asynchronously.

What is an EGS and why does it need onboarding?

An EGS, or E-invoicing Generation Solution, is the unit that actually generates invoices — a POS till, a billing module, an ERP company code or a branch instance. Each EGS unit is onboarded individually so it can obtain its own cryptographic stamp identifier, or CSID. Onboarding binds a specific device or instance to your VAT registration, which is what allows ZATCA to attribute every stamped invoice to a known source.

What is PIH and why do invoices break because of it?

PIH is the previous invoice hash. Each invoice carries the hash of the invoice issued before it by the same EGS, forming a chain that makes silent deletion or insertion detectable. Chains break when invoices are generated out of order, when a database is restored from a backup, when a queue retries and duplicates an invoice, or when two instances share one EGS identity. Recovery requires establishing which invoice is genuinely last for that EGS and resuming the chain from it.

Does ZATCA Phase 2 mean we have to replace our ERP?

Usually not. If your ERP holds accurate VAT data and can expose invoices through an API, database view or scheduled export, an integration layer can handle UBL 2.1 generation, stamping, PIH chaining, clearance and reporting without touching your core system. Replacement is worth considering only when the underlying invoice data itself is unreliable, or when the ERP is already at end of life for other reasons.

Which ZATCA wave applies to my business?

Waves are announced by ZATCA against revenue thresholds and have advanced repeatedly since Phase 2 began, so any wave named in an article will date quickly. Taxpayers in scope are notified directly by ZATCA. Confirm your wave, threshold and compliance date against ZATCA's published guidance and your own notification rather than against third-party summaries.

How long does a ZATCA Phase 2 integration usually take?

In our experience the engineering work is rarely the long pole. A single EGS with clean invoice data can move through sandbox to production in a few weeks. Timelines stretch when VAT data needs cleaning, when many branches or tills must each be onboarded, or when returns, credit notes and discounts have been modelled inconsistently. Starting in the sandbox early is the most reliable way to discover which of these apply to you.

Work out where you actually stand

Send us how you invoice today — the ERP or POS, roughly how many generating units, and whether you issue standard invoices, simplified invoices or both. We will tell you honestly whether this is an integration layer or something larger, and what we would check first.

Contact Inovsion See the ZATCA solution

[email protected]+91 9845870246