Most ZATCA Phase 2 guides explain what the law requires. This one is for the people who have to make it work: the IT team wiring an ERP to the Fatoora platform and the finance team who will live with the results. It covers the onboarding steps, the cryptography, the integration options, testing and the failure points that cause most rejections.
Phase 2 requires your ERP to act as an onboarded E-Invoice Generation Solution: it generates UBL 2.1 XML, signs each document with a CSID, chains invoice hashes, keeps a counter that cannot be reset and sends documents to Fatoora. Standard B2B invoices must be cleared before they reach the buyer, and simplified B2C invoices must be reported within 24 hours. The next announced deadline is Wave 25, covering taxpayers with VAT-taxable revenue above SAR 187,500, who must integrate by 1 February 2027.
On this page
- What Phase 2 actually asks of your ERP
- The wave schedule: where things stand in November 2026
- The technical building blocks your IT team must get right
- Three integration approaches compared
- Testing: sandbox, simulation, then production
- Common failure points and how to handle them
- A step-by-step integration plan
- Go-live checklist for IT and finance
- Penalties and getting help
- FAQ

What Phase 2 actually asks of your ERP
Phase 1 (Generation) only required an electronic invoice with the right fields. Phase 2 (Integration) turns your ERP or POS into a connected E-Invoice Generation Solution (EGS). ZATCA's Detailed Guidelines for E-Invoicing (Version 2, May 2023) set out what that means in practice:
- Invoices and their credit and debit notes are generated as XML, or as PDF/A-3 with the XML embedded.
- The XML follows the Electronic Invoice XML Implementation Standard (dated 19 May 2023), which is built on UBL 2.1 and the EN 16931 semantic model, with KSA rules on top.
- Each EGS unit is onboarded to the Fatoora platform and holds its own Cryptographic Stamp Identifier (CSID).
- The solution must be tamper resistant: no invoice counter reset, no system date changes, no deletion or editing of stored XML, and no export of the private stamping key.
ZATCA treats B2B and B2C documents differently:
| Clearance (B2B) | Reporting (B2C) | |
|---|---|---|
| Documents | Standard tax invoices and their credit and debit notes | Simplified tax invoices and their notes |
| When ZATCA sees it | Before the invoice is shared with the buyer, in real time | Within 24 hours of issue |
| Who stamps it | ZATCA adds its cryptographic stamp and QR code to the cleared XML | Your EGS stamps it with its own CSID and builds the QR code |
| What the buyer gets | The cleared XML or PDF/A-3 returned by ZATCA | A printed copy straight away, or electronic if agreed |
| ERP impact | Invoice posting waits for an API response | Queue and batch upload, but the 24 hour clock must be monitored |
Both flows go to Fatoora as XML only, never as PDF/A-3. If your ERP issues both invoice types, you are building two integration paths, not one.
The wave schedule: where things stand in November 2026
Phase 2 has been enforced since 1 January 2023 in waves of taxpayers, selected by VAT-taxable revenue. ZATCA notifies each targeted taxpayer at least six months before its integration date. These are the most recent waves:
| Wave | VAT-taxable revenue above | Reference years | Integrate by | Source |
|---|---|---|---|---|
| 20 | SAR 1.5 million | 2022 or 2023 | 31 October 2025 | ZATCA |
| 21 | SAR 1.25 million | 2022, 2023 or 2024 | 30 November 2025 | ZATCA |
| 22 | SAR 1 million | 2022, 2023 or 2024 | 1 October to 31 December 2025 | EY alert |
| 23 | SAR 750,000 | 2022, 2023 or 2024 | 1 January to 31 March 2026 | EY alert |
| 24 | SAR 375,000 | 2022, 2023 or 2024 | 30 June 2026 | ZATCA |
| 25 | SAR 187,500 | 2022, 2023, 2024 or 2025 | 1 February 2027 | ZATCA |
Wave 25 was announced on 24 July 2026 and is the only announced wave with a deadline still ahead. At SAR 187,500 it reaches deep into the small business segment, where many companies run entry-level accounting software or a POS that has never talked to an API. If you are in Wave 25 and have not started, three months is a realistic but tight window for a native or middleware integration.
Until your wave starts, Phase 1 rules still apply. ZATCA allows voluntary early adoption of Phase 2.
The technical building blocks your IT team must get right
The E-invoicing Detailed Technical Guidelines and the Security Features Implementation Standards (19 May 2023) define the parts every integration needs.
1. CSR and the two CSIDs
Onboarding starts on the Fatoora portal, where an authorised user generates a one-time password (OTP) for each EGS unit. Each OTP is valid for one hour, and up to 100 can be requested at once. The ERP then generates a key pair, builds a Certificate Signing Request (CSR) with the mandatory fields and receives a Compliance CSID. The unit then submits test documents (an invoice, debit note and credit note for each invoice type it will issue). When these pass, ZATCA issues the Production CSID, which is what authenticates live clearance and reporting calls.
2. Cryptographic stamp
The stamp is an enveloped XAdES signature using ECDSA with SHA-256. The private key must be generated inside the solution and must not be viewable or exportable. CSIDs expire, the Fatoora portal sends renewal reminders, and they can be revoked if a device is lost, sold, compromised or majorly upgraded.
3. Invoice hash and hash chaining
Each document carries the hash of the previous document (field KSA-13). The XML Implementation Standard describes the method: remove the UBL extensions, QR and signature blocks, canonicalise with C14N11, hash with SHA-256 and Base64 encode. For the very first invoice, the previous hash is the Base64 encoded SHA-256 of the character "0". Each EGS unit keeps one single chain.
4. Invoice counter value (ICV)
Every document carries a counter (KSA-16) that contains only digits, increments for every invoice and note, and can never be reset. A counter value is never reused, even for a rejected document.
5. QR code
The QR code is Base64 encoded TLV, up to 700 characters, with nine tags, from seller name and VAT totals to the XML hash, ECDSA signature and public key. For standard invoices, ZATCA returns the QR string at clearance and your ERP only has to render it.
Three integration approaches compared
The right choice depends on your ERP, your volumes and how much of the cryptography you want to own.
| Approach | How it works | Best for | Watch out for |
|---|---|---|---|
| Native ERP module | The ERP vendor's own Phase 2 feature generates XML, signs, hashes and calls Fatoora directly | ERPs whose Saudi edition already supports Phase 2 | Feature depth for your document types, multi-branch setups and credit note handling |
| Middleware or connector | The ERP sends invoice data to an integration layer that builds the UBL XML, stamps it and manages CSIDs, counters and queues | Older on-premise ERPs, custom systems, groups with several ERPs | One more system to secure and monitor, and the counter and hash chain must stay unbroken across the handoff |
| Solution provider platform | A specialised e-invoicing provider hosts the EGS and returns cleared invoices to your ERP | Teams without in-house developers, high-volume POS estates | Data residency, service levels, and who holds the private key |
ZATCA publishes a Solution Providers Directory listing providers qualified for Phase 1 and Phase 2. It is an indicative list, not an approval or certification, and ZATCA states that a taxpayer meeting the requirements is compliant even if its provider is not listed. Treat it as a starting point for due diligence, not a guarantee.
For platform-specific detail, see our guides to Zoho Books and ZATCA, Odoo accounting for ZATCA and Dynamics 365 in Saudi Arabia.
Key takeaways
- Phase 2 turns your ERP into a connected EGS that generates UBL 2.1 XML, stamps it and talks to Fatoora through APIs.
- Standard B2B invoices are cleared by ZATCA before release, while simplified B2C invoices are reported within 24 hours.
- Onboarding runs OTP, CSR, Compliance CSID, compliance checks and then Production CSID for every EGS unit.
- Hash chaining and the invoice counter are where most integrations break, especially after a rejected document.
- Wave 25 covers VAT-taxable revenue above SAR 187,500 and must integrate by 1 February 2027.
- Test with the SDK, sandbox and Fatoora simulation portal before onboarding production units.
Testing: sandbox, simulation, then production
ZATCA gives you three environments. Use all of them in order.
- Developer Portal tools. The Compliance and Enablement Toolbox (SDK) validates XML and QR codes offline or from the command line. A web-based validator and the Integration Sandbox let developers simulate onboarding and submit test invoices using the published API (Swagger) files.
- Fatoora simulation portal. Reached from the Fatoora portal, it is an independent environment for end-to-end functional testing with its own onboarding, OTPs and API endpoints. Devices onboarded here are not onboarded in production.
- Fatoora production. Accessed with your ZATCA (ERAD) taxpayer credentials. Onboard each live EGS unit only when simulation tests pass.
Build a test pack from real data covering every document type you issue: credit notes against several invoices, advance payment adjustments, zero-rated and exempt lines. The guidelines list over 100 possible warning and error combinations.
Get your ERP Phase 2 ready
Talk to Shyphan about Fatoora onboarding, XML and CSID setup, simulation testing and go-live support for your ERP.
Common failure points and how to handle them
Build your error handling around the Fatoora API responses described in the Detailed Guidelines:
| Response | Meaning | What your ERP should do |
|---|---|---|
| 200 | Accepted | Store the cleared or reported XML and continue |
| 202 | Accepted with warnings | Accept, but log and fix. ZATCA says warnings may become rejections later |
| 303 | Clearance switched off | Submit the standard invoice through reporting instead |
| 400 | Rejected | Fix the data and submit as a new document |
| 401 | Unauthorised | Check the CSID certificate and secret |
| 413, 429, 500, 503, 504 | Not received | Resend, with a smaller payload for 413 |
Other common issues:
- Broken hash chains after a rejection. A rejected document stays in the chain. The corrected version is a new document with a new ICV and UUID, and its previous hash points to the last document generated, not the original.
- Treating a rejected invoice as cancellable. Invoices cannot be cancelled. A simplified invoice returned as NOT_REPORTED is invalid and is reversed with a credit note, then reissued.
- Counter gaps when one billing engine also produces out-of-scope documents.
- Credit notes without the original invoice reference, which breaches Article 54 of the VAT Implementing Regulations.
- Weak master data: missing buyer VAT numbers, addresses without the required parts, wrong exemption reason codes.
- Expired CSIDs because nobody owns the renewal reminders.
- Offline sites. Reporting must happen within 24 hours. If connectivity fails for longer, ZATCA expects you to notify it through the dedicated form and again on recovery.
A step-by-step integration plan
- Confirm your wave and date from your ZATCA notification and check your revenue against the thresholds above.
- Inventory every invoicing source: ERP, POS terminals, e-commerce, billing portals and any custom system. Each one that issues invoices is an EGS unit.
- Map document types to clearance or reporting, and list the special cases you issue.
- Choose the approach (native, middleware or provider) per source.
- Clean master data: customer VAT numbers, national addresses, item tax categories, exemption codes and Arabic names.
- Build or configure XML generation, signing, hashing, counters, QR rendering and the PDF/A-3 output.
- Validate with the SDK and web validator, then run end-to-end tests in the Fatoora simulation portal.
- Train finance users on rejections, warnings, credit notes and the 24 hour reporting window.
- Onboard production units with OTPs from the Fatoora portal and run a controlled first day.
- Monitor warnings, failed submissions and CSID expiry dates weekly after go-live.
For a broader, less technical walkthrough, read our ZATCA Phase 2 implementation guide.
Go-live checklist for IT and finance
- Every EGS unit is onboarded in production with a valid Production CSID, and renewal dates are tracked.
- Private keys are generated in the solution and cannot be exported.
- Counter reset, date changes and XML deletion are blocked for all users.
- Standard invoices are not released to buyers until ZATCA returns the cleared XML.
- Simplified invoices are queued and reported within 24 hours, with alerts for anything pending.
- Rejections create a new document with a new ICV, and the hash chain is verified after each test.
- The human-readable invoice is in Arabic (other languages may be added) and shows the QR code.
- Invoices are archived in XML, named by VAT number, timestamp and invoice reference number.
- A named owner handles 202 warnings, ZATCA notifications and CSID renewals.
Penalties and getting help
When ZATCA announced e-invoicing violations and fines in November 2021, it stated that failing to issue e-invoices starts at a fine of SAR 5,000 and deleting or amending invoices after issue starts at SAR 10,000. Omitting the QR code on simplified invoices, omitting the buyer's VAT number on tax invoices and failing to notify ZATCA of a malfunction start with a warning, with fines rising by violation type and repetition. ZATCA's VAT penalties page lists a maximum fine of SAR 50,000 for violating other VAT provisions, and a repeated violation within three years may be doubled.
Shyphan is a Zoho Premium Partner and the first AI Enabled Zoho Partner in the Middle East and Africa, with an office in Riyadh and 500+ projects delivered. Our team handles Phase 2 integration for ZATCA-compliant ERP software, from master data clean-up to simulation testing and production onboarding. Explore our Phase 2 e-invoicing services in Saudi Arabia or our ZATCA e-invoicing software options.
Sources
- ZATCA Phase 2 implementation guide
- ZATCA Fatoora Phase 2 with Zoho
- Zoho Books for ZATCA in Saudi Arabia
- Odoo accounting and ZATCA compliance
- Phase 2 e-invoicing services in Saudi Arabia
- ZATCA-compliant ERP software
- ZATCA e-invoicing software
- Dynamics 365 partner in Saudi Arabia
Frequently Asked Questions
What is the difference between a Compliance CSID and a Production CSID?
Can we use the same ERP we used for Phase 1?
Do simplified B2C invoices need ZATCA approval before we give them to customers?
What happens if a standard invoice is rejected by ZATCA?
Does our solution provider have to be on ZATCA's list?
Who is in Wave 25 and what is the deadline?
Is there a test environment before going live?
Related reading
- Shyphan featured in Zoho Partner Times, Q3 2026
- Shyphan recognised as a Q3 2026 Top Zoho Partner in MEA
- How Shyphan became a Zoho Premium Partner in 8 months
- AI agent development
- AI development company in the UAE
- Zoho Premium Partner in the UAE
- Zoho Premium Partner in Saudi Arabia
- AI chatbot development cost in 2026
- 10 Zoho CRM implementation mistakes to avoid
