ZATCA E-Invoicing Software in Saudi Arabia: Features and Requirements
A ZATCA-compliant e-invoicing solution in KSA is an enterprise financial middleware platform that transforms transactional billing data from Enterprise Resource Planning (ERP) systems

A ZATCA-compliant e-invoicing solution in KSA is an enterprise financial middleware platform that transforms transactional billing data from Enterprise Resource Planning (ERP) systems (SAP, Oracle, Microsoft Dynamics 365, Odoo) and Point-of-Sale (POS) registers into cryptographically secured, machine-readable Universal Business Language (UBL 2.1) XML documents, validating them against ZATCA's Fatoora API in real time.
Executive summary: define the problem and answer the query
In Saudi Arabia's Phase 2 (Integration Phase) environment, enterprise compliance requires meeting complex cryptographic and operational mandates:
- The Regulatory Challenge: Invoicing is no longer a static PDF or thermal print operation. Every tax invoice must maintain an unbroken cryptographic hash chain (linking each document to the Previous Invoice Hash — PIH), calculate sequential Invoice Counter Values (ICV), apply W3C Canonical XML (C14N) transformations, and execute local digital signatures using ECDSA private keys issued via ZATCA's compliance portal.
- The Technical Bottleneck: Directly modifying core ERPs or POS databases to execute cryptographic signing creates severe database lock contention, slows down point-of-sale checkout lanes, and risks broken hash chains during high-concurrency transactions.
- The Solution: A dedicated e-invoicing middleware architecture. Acting as a secure buffer, it ingests raw billing JSON or flat files, manages sequential cryptographic hashing in sub-second intervals, generates compliant Phase 2 QR codes, routes B2B transactions for synchronous clearance, and queues B2C invoices for 24-hour reporting—shielding primary retail databases from compliance halts.
codeCode
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ SAUDI ENTERPRISE BILLING ENGINES │
│ Core ERPs (SAP/Oracle/D365/Odoo) │ Omnichannel Storefronts │ Retail POS Kiosks │
└───────────────────────────────────────────┬────────────────────────────────────────────┘
│ Raw Billing JSON / OData / DB Triggers
▼
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ REACHWARE FATOORA: ZATCA PHASE 2 MIDDLEWARE ENGINE │
│ │
│ ┌─────────────────────────┐ ┌─────────────────────────┐ ┌────────────────────────┐ │
│ │ Cryptographic Engine │ │ UBL 2.1 XML Generator │ │ Dual Routing Manager │ │
│ │ ECDSA secp256k1 signing,│ │ W3C C14N formatting, │ │ B2B Clearance vs. │ │
│ │ SHA-256 hash chaining │ │ 9-Tag Phase 2 Base64 QR │ │ B2C 24-hr Reporting │ │
│ └─────────────────────────┘ └─────────────────────────┘ └────────────────────────┘ │
│ │
│ ┌──────────────────────────────────────────────────────────────────────────────────┐ │
│ │ Security & Governance: In-Kingdom Cloud Hosting, CSID Renewal, 10-Yr WORM Archive│ │
│ └──────────────────────────────────────────────────────────────────────────────────┘ │
└───────────────────────────────────────────┬────────────────────────────────────────────┘
│ Synchronous Clearance & Queued Reporting
▼
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ ZATCA FATOORA GOVERNMENT PLATFORM │
│ API Endpoints: /invoices/clearance (B2B) │ /invoices/reporting (B2C) │
└────────────────────────────────────────────────────────────────────────────────────────┘
For finance and IT leadership preparing their organizational roadmap, deploying verified ZATCA e-invoicing integration in Saudi Arabia provides the foundational blueprint for compliance.
Solution Architecture Comparison: ERP Custom Scripting vs. Global Tax Engines vs. Dedicated ZATCA Middleware
Strategic Dimension | Native ERP Custom Development | Generic Global Tax Engine | Dedicated ZATCA Middleware (Reachware Fatoora) |
Implementation Lead Time | 4 to 8 months of custom ABAP/Java code. | 2 to 4 months of integration tuning. | 2 to 4 weeks via pre-built ERP connectors. |
Cryptographic Hashing (PIH) | High risk of broken hash chains under concurrency. | Queued, but lacks local edge resilience. | Deterministic sequence engine; 0% chain failure. |
Checkout Latency Impact | Adds 800ms–2,500ms to customer transactions. | Adds 500ms–1,200ms external cloud delay. | Sub-50ms local signing; zero register pauses. |
ZATCA Schema Update Agility | Requires costly ERP core code refactoring. | Dependent on vendor global release cycles. | Hot-swapped business rules; zero ERP code changes. |
Inbound AP XML Validation | None; requires manual review of supplier PDFs. | Often an expensive add-on module. | Built-in e-invoice receiving solution for AP. |
Data Sovereignty Compliance | Dependent on enterprise hosting setup. | Often routes payloads through overseas nodes. | 100% In-Kingdom cloud hosting (NCA/PDPL compliant). |
Organizations modernizing their fiscal infrastructure can implement a pre-certified ZATCA e-invoicing solution to automate tax compliance while safeguarding system throughput.
ZATCA-compliance requirements for solution selection
Selecting an enterprise e-invoicing platform requires verifying compliance against the technical specifications established by the Zakat, Tax and Customs Authority.
codeCode
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ ZATCA PHASE 1 VERSUS PHASE 2 EVOLUTION │
├────────────────────────────────────────────┬───────────────────────────────────────────┤
│ Phase 1: Generation Phase (Dec 4, 2021) │ Phase 2: Integration Phase (Jan 1, 2023+) │
├────────────────────────────────────────────┼───────────────────────────────────────────┤
│ • Offline, standalone invoice generation. │ • Real-time API integration with ZATCA. │
│ • Static Base64 TLV QR codes on receipts. │ • Dynamic 9-Tag cryptographic QR codes. │
│ • Basic PDF / thermal print output. │ • Machine-readable UBL 2.1 XML documents. │
│ • Anti-tampering software requirements. │ • Cryptographic Stamps (X.509 CSIDs). │
│ • No government API data transmission. │ • Sequential SHA-256 invoice hash chaining│
└────────────────────────────────────────────┴───────────────────────────────────────────┘
1. Cryptographic Device Onboarding (CSID Management)
Every E-Invoicing Generation Solution (EGS) unit—whether an ERP billing module, an e-commerce storefront, or a retail register—must be uniquely registered with ZATCA:
- Compliance CSID (CCSID): Used during testing to validate that the EGS correctly generates UBL 2.1 XML structures, handles error codes, and computes cryptographic hashes.
- Production CSID (PCSID): Issued after passing compliance checks, granting the unit authority to clear B2B invoices and report B2C transactions to ZATCA's production API.
- Cryptographic Security: Solutions must store ECDSA private keys (secp256k1 curve) inside secure Hardware Security Modules (HSM) or encrypted key vaults, preventing unauthorized key extraction as mandated by Article 53 of the VAT regulations.
2. Universal Business Language (UBL 2.1) & W3C Canonicalisation
Invoices must adhere to the international UBL 2.1 schema standard (Invoice-2.xsd). Before computing hashes or applying digital signatures, the document must undergo W3C Canonical XML (C14N) normalization to strip non-significant whitespace and standardize attribute ordering, ensuring deterministic SHA-256 digest calculations across different software environments.
Standard versus simplified invoice handling
A primary capability of enterprise e-invoicing software is managing the operational division between standard and simplified tax documents.
codeCode
ZATCA DOCUMENT CLASSIFICATION
│
┌──────────────────────────────────────┴──────────────────────────────────────┐
▼ ▼
[STANDARD TAX INVOICE: B2B / B2G] [SIMPLIFIED TAX INVOICE: B2C]
• Transaction Type: Wholesale, Commercial, Export • Transaction Type: Retail Checkout, Consumer E-Com
• Regulatory Mandate: SYNCHRONOUS CLEARANCE • Regulatory Mandate: ASYNCHRONOUS REPORTING
• Workflow: Invoice transmitted to ZATCA API; • Workflow: Signed locally by EGS; Phase 2 QR printed;
cleared XML + ZATCA stamp required before issuance. invoice reported to ZATCA within 24 hours.
1. B2B Standard Tax Invoices: Synchronous Clearance
- Application: Commercial trade, inter-company billing, government contracts, and wholesale distributions.
- Operational Flow: The transaction cannot be legally issued or delivered to the corporate buyer until ZATCA's API verifies the XML, embeds its own cryptographic stamp, and returns the approved document.
- Software Requirement: The software must execute low-latency API handshakes, capture clearance warnings, store the cleared XML, and generate dual-format PDF/A-3 documents with embedded XML for buyer distribution.
2. B2C Simplified Tax Invoices: Asynchronous Reporting
- Application: Consumer retail checkouts, restaurant POS, and direct-to-consumer e-commerce.
- Operational Flow: Customers cannot be kept waiting at checkouts while an external government API processes an invoice. The software signs the document locally using the merchant's private key, prints or displays the dynamic Phase 2 QR code in under 50 milliseconds, and queues the document for reporting to ZATCA within the statutory 24-hour window.
For comprehensive regulatory guidelines on managing digital tax lifecycles, review our resource on ZATCA Compliance & E-Invoicing
A practical evaluation checklist for Fatoora
Finance directors and enterprise architects should assess candidate e-invoicing solutions using this structured evaluation framework:
codeCode
┌──────────────────────────────────────┬────────────────────────────────────────────────────────┐
│ Architectural Category │ Essential Technical & Functional Capabilities │
├──────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ 1. Sequential Chaining Integrity │ In-memory sequence locks ensure deterministic Invoice │
│ │ Counter Values (ICV) and zero broken hash chains (PIH).│
├──────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ 2. Dual Routing Intelligence │ Automated document classification: sub-50ms local │
│ │ signing for B2C, alongside synchronous B2B clearance. │
├──────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ 3. Automated Error Remediation │ Pre-validation linting catches schema errors before │
│ │ dispatch; Dead Letter Queues prevent dropped filings. │
├──────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ 4. Inbound AP Document Validation │ Native **e-invoice receiving solution** that parses, │
│ │ cryptographically validates, and matches vendor XMLs. │
├──────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ 5. Statutory 10-Year Archiving │ Encrypted, Write-Once-Read-Many (WORM) storage inside │
│ │ Saudi Arabia, accessible for official ZATCA audits. │
└──────────────────────────────────────┴────────────────────────────────────────────────────────┘
To examine how e-invoicing architecture shields high-volume digital storefronts during peak sales campaigns, explore The Importance of E-Invoice Middleware in E-Commerce
Implementation blueprint and data flow (step by step)
The following blueprint details an enterprise ZATCA Phase 2 E-Invoicing Pipeline connecting an ERP system, a dedicated middleware engine, and ZATCA's Fatoora API endpoints.
End-to-End Operational Execution
codeCode
[Enterprise ERP / POS] ──> (1. Raw Billing Data: JSON/OData) ──> [Reachware Fatoora]
│
│ (2. W3C C14N Canonicalisation)
▼
┌──────────────────────────┐
│ UBL 2.1 XML Builder │
└────────────┬─────────────┘
│
┌──────────────────────────────────────────────────────┴──────────────────────────────────┐
│ (3. Calculate SHA-256 & Apply ECDSA Signature) │ (4. Construct 9-Tag Phase 2 QR)
▼ ▼
┌──────────────────────────┐ ┌──────────────────────────┐
│ Cryptographic Hash Chain │ │ Dynamic QR Generator │
│ ICV = n+1, Links to PIH │ │ Encodes Tags 1–9 Base64 │
└────────────┬─────────────┘ └────────────┬─────────────┘
│ │
└──────────────────────────────────────────────────────┬──────────────────────────────────┘
│
┌───────────────────────────────┴───────────────────────────────┐
│ (5. Evaluate Transaction Type) │
▼ ▼
[B2B: Synchronous Clearance] [B2C: Asynchronous Reporting]
Transmits to /invoices/clearance Issues receipt instantly (<50ms);
Captures ZATCA stamp & Cleared XML Buffers in queue for 24-hr report
│ │
└───────────────────────────────┬───────────────────────────────┘
│ (6. Store in Immutable 10-Yr WORM Archive)
▼
[Enterprise Financial Core]
Step-by-Step Technical Execution
Step 1: Data Ingestion and Validation
- An order or invoice is approved in the enterprise ERP (SAP, Oracle, Dynamics 365, or Odoo).
- The ERP sends billing details (line items, VAT rates, customer tax numbers, payment types) to Reachware Fatoora via secure REST API or direct database trigger.
Step 2: Canonical Transformation & UBL 2.1 XML Formatting
- The middleware converts the payload into standardized UBL 2.1 XML adhering to the urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 schema.
- W3C Canonical XML (C14N) rules are applied, stripping extraneous whitespace and standardizing namespace prefixes.
codeXml
<!-- Example: Compliant ZATCA Phase 2 UBL 2.1 XML Header Snippet -->
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<cbc:ProfileID>reporting:1.0</cbc:ProfileID>
<cbc:ID>INV-2026-99182</cbc:ID>
<cbc:UUID>c3a819b2-4d1e-4a88-92a1-88f921a48e11</cbc:UUID>
<cbc:IssueDate>2026-10-22</cbc:IssueDate>
<cbc:IssueTime>10:15:30</cbc:IssueTime>
<cbc:InvoiceTypeCode name="0200000">388</cbc:InvoiceTypeCode>
<!-- Document details, tax categories, and items continue -->
</Invoice>
Step 3: Sequential Hash Calculation & Digital Stamping
- The sequence engine increments the Invoice Counter Value (ICV) and retrieves the Previous Invoice Hash (PIH).
- A SHA-256 digest is generated across the canonical XML body.
- The middleware signs the digest using the merchant's ECDSA private key (secp256k1 curve), injecting the resulting signature value into the ds:SignatureValue block within the XML extensions.
Step 4: Dynamic Phase 2 QR Code Generation
The system builds the mandatory 9-tag binary TLV (Tag-Length-Value) structure and encodes it into Base64:
codeCode
┌───────┬─────────────────────────────┬────────────────────────────────────────────────────────┐
│ Tag │ Field Description │ Technical Content & Phase 2 Standard │
├───────┼─────────────────────────────┼────────────────────────────────────────────────────────┤
│ 1 │ Seller's Legal Name │ UTF-8 formatted commercial entity name │
│ 2 │ Seller's 15-Digit VAT Number│ Official Saudi tax registration number │
│ 3 │ Invoice Timestamp │ Combined ISO 8601 date and time (YYYY-MM-DDTHH:MM:SSZ) │
│ 4 │ Invoice Total (with VAT) │ Formatted decimal value matching total invoice amount │
│ 5 │ VAT Total Amount │ Exact calculated tax amount │
│ 6 │ Invoice Hash (SHA-256) │ Cryptographic hash computed over canonicalized XML body│
│ 7 │ Digital Signature │ ECDSA secp256k1 signature value │
│ 8 │ Public Key │ Public key corresponding to the registered EGS CSID │
│ 9 │ Certificate Authority Stamp │ ZATCA root-signed cryptographic stamp (B2B only) │
└───────┴─────────────────────────────┴────────────────────────────────────────────────────────┘
Step 5: Dual Pathway Clearance and Reporting Dispatch
- B2B Standard Invoices: Transmitted synchronously to ZATCA's /invoices/clearance endpoint. The platform captures the returned cleared XML and cryptographic stamp, archiving it before releasing the document to the corporate buyer.
- B2C Simplified Invoices: The receipt with the Phase 2 QR code is returned to the counter register in under 50 milliseconds. The XML payload is placed into a resilient background queue for scheduled dispatch to ZATCA's /invoices/reporting endpoint within 24 hours.
Step 6: 10-Year Immutable Archiving
- All canonical XML files, clearance receipts, and reporting responses are committed to encrypted, Write-Once-Read-Many (WORM) storage inside Saudi Arabia to satisfy statutory audit retention requirements.
Failure modes, security, governance and validation
Operating in Phase 2 requires proactive error-handling mechanisms to resolve API rejections, certificate expirations, and concurrency bottlenecks.
codeCode
┌───────────────────────────────────────┬───────────────────────────────────────────────────────┐
│ ZATCA Rejection Code / Failure Mode │ Technical Remediation in Integration Platform │
├───────────────────────────────────────┼───────────────────────────────────────────────────────┤
│ 1. Invalid Hash Chain │ Sequence engine rolls back lock, queries ledger for │
│ (Submitted PIH doesn't match API) │ the last accepted hash, and recalculates digest. │
├───────────────────────────────────────┼───────────────────────────────────────────────────────┤
│ 2. Invalid Cryptographic Signature │ Automated certificate health monitoring alerts before │
│ (Expired or revoked CSID) │ expiry; initiates automated CSID renewal workflow. │
├───────────────────────────────────────┼───────────────────────────────────────────────────────┤
│ 3. QR Hash Mismatch │ Pre-validation verifies Tag 6 hash matches canonical │
│ (Tag 6 doesn't match XML digest) │ XML SHA-256 digest before external dispatch. │
├───────────────────────────────────────┼───────────────────────────────────────────────────────┤
│ 4. VAT Rounding Discrepancies │ Financial engine enforces standard banking rounding │
│ (Line items differ from totals) │ (HALF_UP, 2 decimals) before building XML tax totals. │
├───────────────────────────────────────┼───────────────────────────────────────────────────────┤
│ 5. ZATCA Gateway Latency Timeout │ In-memory Dead Letter Queues (DLQ) buffer reporting │
│ (HTTP 504 Gateway Timeout) │ payloads, retrying with exponential backoff. │
└───────────────────────────────────────┴───────────────────────────────────────────────────────┘
1. Preventing Broken Hash Chains During Concurrency Surges
When hundreds of retail registers or e-commerce threads generate invoices simultaneously, two threads can attempt to use the same Previous Invoice Hash (PIH), causing ZATCA to reject subsequent submissions.
Reachware Fatoora deploys distributed sequence locks:
- A dedicated sequence manager assigns sequential numbers (ICV) and hashes atomically.
- Transactions are serialized in sub-millisecond memory queues, ensuring every invoice links to the exact hash of its predecessor with zero chain breaks.
2. Inbound Vendor Invoice Validation (Accounts Payable)
While compliance focuses on outgoing sales invoices, companies face tax liabilities if they claim input VAT deductions on invalid supplier invoices.
A comprehensive solution includes an e-invoice receiving solution:
- Ingests incoming supplier UBL 2.1 XML files directly.
- Decodes the supplier’s QR code and verifies that the cryptographic signature links to a valid ZATCA root certificate.
- Validates vendor VAT numbers and matches line-item amounts against internal purchase orders before posting to Accounts Payable.
Saudi Arabia use cases and measurable KPIs
Realistic Saudi Enterprise Case Study: Omnichannel Wholesale & Retail Distributor
- Enterprise Profile: A major industrial supplies and building materials distributor headquartered in Riyadh, operating 18 physical wholesale branches, a B2B corporate sales division, and an enterprise digital storefront.
- Core Technology Stack: SAP S/4HANA (Finance & Sales), custom point-of-sale registers, and an e-commerce storefront.
- Initial Compliance Challenge: The distributor attempted to customize their SAP S/4HANA environment with custom ABAP scripts for Phase 2 compliance. During testing, high checkout volumes broke sequential hash chains, custom XML canonicalisation failed ZATCA schema checks, and checkout lanes slowed by 3 seconds per transaction.
The Transformation: Dedicated E-Invoicing Middleware Integration
The distributor deployed Reachware Fatoora as an enterprise fiscal middleware layer:
- Decoupled Architecture: SAP and POS registers output standard transactional data over internal network connections to Reachware Fatoora.
- Sub-50ms Signing: The middleware executes XML formatting, cryptographic signing, and Phase 2 QR generation in under 35 milliseconds, keeping POS registers fast.
- Automated Dual Routing: B2B wholesale invoices clear synchronously with ZATCA's API, while B2C retail receipts are buffered and reported asynchronously within 24 hours.
Measurable Enterprise Performance KPIs
codeCode
┌──────────────────────────────────────┬────────────────────────┬────────────────────────┐
│ Strategic Performance Metric │ Custom ERP Scripting │ Reachware Fatoora State│
├──────────────────────────────────────┼────────────────────────┼────────────────────────┤
│ POS Register Receipt Print Latency │ +2,800ms overhead │ < 35ms (Local Signing) │
├──────────────────────────────────────┼────────────────────────┼────────────────────────┤
│ Sequential Hash Chain Failure Rate │ ~4.2% during surges │ 0.00% (Strict Queuing) │
├──────────────────────────────────────┼────────────────────────┼────────────────────────┤
│ ZATCA Phase 2 Schema Validation Rate │ 91.5% initial pass rate│ 100% (Pre-Validated) │
├──────────────────────────────────────┼────────────────────────┼────────────────────────┤
│ Monthly Tax Reconciliation Labor │ 45 hours / month │ < 1 hour / month │
├──────────────────────────────────────┼────────────────────────┼────────────────────────┤
│ Regulatory Schema Update Downtime │ 2 to 3 weeks per patch │ Zero downtime (Hot-fix)│
└──────────────────────────────────────┴────────────────────────┴────────────────────────┘
Where Reachware fits and when to request a demo
Purpose-Built Integration: Reachware Fatoora
Reachware Fatoora is an enterprise-grade ZATCA Phase 2 e-invoicing middleware platform engineered specifically for the regulatory and technical landscape of Saudi Arabia. Rather than requiring expensive, multi-month custom software projects inside core ERPs, Reachware acts as an intelligent, pre-certified integration bridge:
- Turnkey Enterprise ERP & POS Adapters: Pre-configured connectors for SAP S/4HANA, Oracle NetSuite, Microsoft Dynamics 365, Odoo, Foodics, Salla, and Zid.
- High-Performance Cryptographic Engine: Distributed sequencing that manages Invoice Counter Values (ICV) and Previous Invoice Hashes (PIH) without database locking.
- Automated Dual Routing: Real-time synchronous clearance for B2B transactions alongside sub-50ms local signing and queued reporting for B2C sales.
- Integrated Inbound AP Receiving: Complete e-invoice receiving solution that automatically parses, cryptographically validates, and 3-way matches incoming supplier XML invoices against purchase orders.
- Guaranteed In-Kingdom Cloud Hosting: High-availability infrastructure hosted within Saudi Arabia, fully compliant with NCA cybersecurity controls and the Saudi PDPL.
codeCode
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ REACHWARE FATOORA SUITE │
│ │
│ [ERP & POS CONNECTORS] [CRYPTOGRAPHY & ROUTING] [LOCAL SAUDI ECOSYSTEM] │
│ • SAP / Oracle / D365 • Sub-50ms ECDSA secp256k1 • In-Kingdom Cloud Hosting │
│ • Salla / Zid / Foodics • W3C Canonicalisation (C14N)• ZATCA Phase 2 Certified │
│ • Odoo / Custom REST APIs • Distributed Sequence Locks • AP Inbound XML Validator │
│ • Flat-File / DB Triggers • B2B Clearance & B2C Report • 10-Year WORM Audit Archive │
└────────────────────────────────────────────────────────────────────────────────────────┘
When to Request a Technical Evaluation
CFOs, tax directors, and IT leadership should consider scheduling an architecture review and platform demonstration when:
- Your designated ZATCA Phase 2 compliance wave is approaching and core ERP systems cannot natively handle UBL 2.1 C14N formatting or ECDSA digital stamping.
- Checkout lane latency or online storefront cart abandonment is rising due to slow invoice fiscalization dependencies.
- High transaction volumes are causing sequential hash errors (PIH) during sales campaigns.
- Accounts Payable teams spend hundreds of hours manually auditing and keying vendor PDF invoices instead of processing cryptographically validated XML feeds.
To evaluate your architecture and explore turnkey ZATCA Phase 2 integration blueprints, Explore Reachware Fatoora or request a tailored demo with our tax technology team.
Frequently asked questions (concise answers)
What is the difference between ZATCA clearance and reporting?
- Clearance applies to B2B Standard Tax Invoices. It is a synchronous mandate: the invoice must be transmitted to ZATCA's API and cleared with an official cryptographic stamp before it can be legally issued or delivered to the corporate buyer.
- Reporting applies to B2C Simplified Tax Invoices. It is an asynchronous framework: the invoice is signed locally by the merchant's certified device, issued to the consumer immediately at checkout with a Phase 2 cryptographic QR code, and transmitted to ZATCA within a statutory 24-hour window.
Which invoice data fields require validation?
Under ZATCA Phase 2, core validation fields include:
- Invoice Identification: Globally Unique Identifier (UUID), sequential Invoice Counter Value (ICV), and human-readable sequential Invoice Number.
- Cryptographic Elements: Previous Invoice Hash (PIH), SHA-256 Invoice Body Digest, and the Digital Signature.
- Tax Entities: 15-digit Seller VAT registration number, Group VAT number (if applicable), and Buyer tax registration / National ID for B2B transactions.
- Line-Item Financials: Exact unit pricing, item tax category codes (S, Z, E, O), explicit tax rates (e.g., 15%), calculated VAT amounts, and document-level totals adhering to standard 2-decimal banking rounding.
How can ERP and POS systems connect to e-invoicing?
ERPs and POS systems typically connect through one of three pathways:
- Direct Native Customization: Writing custom UBL 2.1 generation, C14N canonicalisation, ECDSA signing, and REST API handlers directly into the ERP core (resource-heavy and vulnerable to regulatory updates).
- Third-Party Foreign APIs: Forwarding transaction data over the public internet to international multi-tenant APIs (frequently presenting data sovereignty and latency challenges).
- Specialized E-Invoice Middleware (Recommended): Deploying a dedicated middleware layer (such as Reachware Fatoora) locally or in-kingdom. The ERP/POS outputs standard JSON or basic XML via REST API, while the middleware handles cryptographic stamping, sequential hashing, dynamic QR generation, ZATCA communication, and queuing without impacting system performance.
Regulatory References & Technical Standards
- Zakat, Tax and Customs Authority (ZATCA): E-Invoicing Detailed Technical Guidelines (Phase 2 Integration), Kingdom of Saudi Arabia.
- OASIS Standard: Universal Business Language (UBL) Version 2.1, ISO/IEC 19845:2015.
- W3C Recommendation: Canonical XML Version 1.0 (C14N), World Wide Web Consortium.
- Kingdom of Saudi Arabia VAT Law: Royal Decree No. (M/113) and Value Added Tax Implementing Regulations (Article 53: Invoicing Provisions).