Saudi Arabia (KSA) · ZATCA FATOORA Phase 2 Middleware

ZATCA Phase 2 E-Invoicing Integration for Your Existing ERP

Keep your existing ERP. Connect it to ZATCA FATOORA Phase 2 through Saky ZATCA Connect.

Saky ZATCA Connect is dedicated integration middleware engineered for businesses operating in the Kingdom of Saudi Arabia. Instead of replacing your accounting or ERP platform, our middleware connects Microsoft Dynamics 365, custom ERP software, and POS systems to ZATCA FATOORA—handling UBL 2.1 XML transformation, CSID cryptographic stamping, Phase 2 TLV QR codes, and real-time clearance and reporting APIs.

ZATCA Phase 2 Technical ScopeUBL 2.1 XML
  • Standard Tax Invoices (0100000): Real-time synchronous B2B & B2G clearance via FATOORA API.
  • Simplified Tax Invoices (0200000): Local ECDSA cryptographic stamping, 9-tag TLV QR & 24-hour reporting.
  • CSID Lifecycle Management: CSR generation, OTP compliance checks & multi-branch Production CSIDs.
  • Pre-Flight Schematron Validation: Checks BR-KSA rules (VAT number, national address, credit note links) before transmission.
Regulatory Independence Note: Saky ZATCA Connect is engineered to align with ZATCA’s published Phase 2 XML and cryptographic specifications. Saky Technologies is an independent integration provider and does not claim official endorsement by ZATCA.
Verified ERP & Billing Connectivity

ERP, POS & Accounting Systems Supported

We prioritize transparent engineering delivery. Below are our verified integration pathways for Microsoft Dynamics 365 and custom ERP/POS platforms, alongside API middleware connectivity for SAP and Oracle landscapes.

Pre-Built OData Connector + Custom X++ Write-BackPre-Built OData Service + Custom X++ Write-Back

Microsoft Dynamics 365 Finance & Operations

Bridge Microsoft Dynamics 365 Finance & Operations (F&O) with Saudi Arabia’s ZATCA FATOORA Phase 2 platform through Saky ZATCA Connect’s pre-built Azure AD OData v4 connector and REST API middleware, combined with tailored X++ write-back and SSRS print layout integration.

Connector Method: Pre-Built OData v4 Polling (Azure AD OAuth 2.0) or API-Based Push (/api/v1/erp/invoices)
Explore Dynamics 365 Finance ZATCA Integration
API-Based Integration + Custom AL ExtensionAPI Middleware + Tailored AL Implementation

Microsoft Dynamics 365 Business Central

Connect Microsoft Dynamics 365 Business Central (Cloud SaaS or On-Premises) to ZATCA FATOORA Phase 2 by combining Saky ZATCA Connect’s pre-built REST API & cryptographic middleware with customer-specific Business Central AL extension hooks and RDLC/Word report layout updates.

Connector Method: API-Based REST JSON Push (POST /api/v1/erp/invoices) via Customer-Specific AL Codeunit
Explore Business Central ZATCA Integration
Pre-Built REST API & Webhook MiddlewarePre-Built REST API & Webhook Middleware

Custom ERP, POS & In-House Billing Systems

Avoid building complex cryptographic signing, UBL 2.1 XML canonicalization, and SHA-256 hash chaining from scratch. Send standard JSON invoice payloads from your custom ERP or POS to Saky ZATCA Connect’s pre-built REST API, and let our middleware handle ZATCA FATOORA Phase 2.

Connector Method: Pre-Built REST JSON API (POST /api/v1/erp/invoices, /api/v2/invoices/submit) or Scheduled Pull Sync
Explore Custom ERP & POS ZATCA Integration

Running SAP (S/4HANA / ECC) or Oracle (EBS / NetSuite) in Saudi Arabia?

Scope Disclosure: We do not market pre-built native SAP ABAP or Oracle SuiteApp connectors. Instead, we integrate SAP and Oracle environments with ZATCA FATOORA through our pre-built REST JSON API middleware (`/api/v1/erp/invoices`) combined with customer-specific outbound IDoc/OData/staging adapter configuration.

View API Middleware Specs
End-to-End Data Flow

Integration Architecture: ERP / POS / Billing System → Saky ZATCA Middleware → ZATCA FATOORA

Saky ZATCA Connect sits cleanly between your internal billing environment and the ZATCA FATOORA portal, isolating cryptographic signing and XML schema transformations from your core ledger.

Stage 1: Source System

ERP / POS / Billing System

Your existing ERP or POS posts a tax invoice, simplified receipt, credit note, or debit note using its standard accounting workflow.

  • • Dynamics 365 Finance & Operations (X++ / OData)
  • • Dynamics 365 Business Central (AL Extension / API)
  • • Custom ERP, POS, HIMS or Travel Billing (JSON REST)
  • • SAP / Oracle Outbound Invoice Payloads
Outbound: JSON / OData / Webhook Payload
Stage 2: Saky ZATCA Middleware

Saky ZATCA Connect Engine

Validates business rules, transforms payloads to UBL 2.1 XML, chains invoice hashes, signs with the branch CSID, and manages API queues.

  • • Pre-flight XSD & BR-KSA Schematron validation
  • • UBL 2.1 XML generation & UUID assignment
  • • Sequential ICV counter & SHA-256 PIH chaining
  • • ECDSA cryptographic stamping & 9-tag TLV QR
  • • Persistent retry queue & audit logging
Signed UBL 2.1 XML + CSID BinarySecurityToken
Stage 3: Tax Authority Portal

ZATCA FATOORA API

ZATCA FATOORA processes the signed XML via Clearance or Reporting endpoints and returns the authoritative status and cleared XML back to your ERP.

  • • B2B Clearance API: Synchronous stamp & QR return
  • • B2C Reporting API: Sub-24h simplified invoice filing
  • • Compliance & Production CSID onboarding APIs
  • • Write-back of CLEARED / REPORTED status & QR to ERP
Inbound: Cleared XML + QR Code + Status Log
Transaction Lifecycle

ZATCA Phase 2 Invoice Workflows Supported

Every invoice document type and operational exception is handled through structured validation and API state management.

01. B2B & B2G Clearance

Standard Tax Invoice Clearance

Submits Standard Tax Invoices (`0100000`) synchronously to ZATCA’s Clearance API. Receives ZATCA’s cryptographic stamp and cleared UBL 2.1 XML with embedded QR code before the invoice is issued to your corporate buyer.

02. B2C POS Reporting

Simplified Tax Invoice Reporting

Signs Simplified Tax Invoices (`0200000`) locally using the branch EGS private key and generates the 9-tag Phase 2 TLV QR code immediately for customer checkout, then reports the signed XML to ZATCA within 24 hours.

03. Financial Adjustments

Credit & Debit Notes (381 / 383)

Enforces mandatory ZATCA `cac:BillingReference` linkage to the original invoice number and structured issuance reasons (`cbc:InstructionNote`) for both Standard and Simplified Credit and Debit Notes.

04. Pre-Flight Conformance

XSD & Schematron Invoice Validation

Validates buyer 15-digit VAT numbers (`BR-KSA-81`), mandatory B2B national address elements (`BR-10`), tax category codes (`S`, `Z`, `E`, `O`), and line-item arithmetic prior to calling ZATCA endpoints.

05. Resilience & Recovery

Error Handling & Retry Processing

Separates data validation rejections (requiring finance correction) from transient network or certificate issues, automatically scheduling queue retries while preserving sequential hash integrity.

06. Real-Time Visibility

Transaction Status Tracking

Tracks every invoice across `PENDING`, `CLEARED`, `REPORTED`, `WARNING`, and `REJECTED` states with downloadable signed XML, QR payload inspection, and ZATCA response codes.

Core Engineering Specifications

Technical Capabilities Built into ZATCA Connect

Purpose-built to handle the cryptographic and XML requirements defined in the ZATCA E-Invoicing Detailed Technical Guidelines.

CSID Onboarding & Certificate Lifecycle

Manages the two-stage Compliance CSID (CCSID) and Production CSID (PCSID) issuance flow, tracks certificate expiry dates across branches, and streamlines certificate renewal.

CSR & Production Credential Management

Generates `secp256k1` ECDSA keypairs and Certificate Signing Requests (CSRs) populated with mandatory ZATCA OID attributes (EGS serial number, VAT registration number, branch location, and invoice type flags).

UBL 2.1 XML Generation & Validation

Constructs canonicalized UBL 2.1 XML documents (`C14N11`) with `ubl:Invoice`, `ext:UBLExtensions`, `ds:Signature`, and `cac:AdditionalDocumentReference` blocks validated against ZATCA schemas.

Invoice Hashing & Phase 2 QR Code Generation

Computes SHA-256 XML digests, maintains the sequential Previous Invoice Hash (`PIH`) and Invoice Counter Value (`ICV`), and encodes all 9 Tag-Length-Value (TLV) Base64 fields into the Phase 2 QR code.

Clearance & Reporting API Integration

Authenticates with ZATCA FATOORA Sandbox, Simulation, and Production endpoints using CSID `BinarySecurityToken` headers, handling HTTP 200, 202 (Warning), and 400 responses.

Audit Logs & Transaction Monitoring

Records an immutable operational log for every submission attempt, retry event, actor, timestamp, invoice UUID, and integrity hash for internal finance and tax audits.

Security & Hosting Models

Security & Deployment Architecture

Designed around enterprise network boundaries and cryptographic key protection:

1. Single-Tenant Private Cloud (VPC)

Dedicated cloud instance with isolated database schemas, TLS 1.3 encrypted API transport, and IP allowlisting between your ERP and the middleware.

2. On-Premises / Corporate Network Deployment

Deploy ZATCA Connect inside your own Windows/Linux server infrastructure or private cloud so ERP database traffic and ECDSA private keys stay inside your firewall.

3. Encrypted Keystore & Role-Based Access

Branch private keys and ZATCA CSID secrets are stored encrypted at rest, with role-based access control separating IT administrators from finance auditors.

Need custom network topology or VPN peering? Speak with an integration architect →
Implementation Methodology

5-Step ERP Integration Process

Our engineering team follows a structured onboarding sequence so your live ERP billing operations experience zero unplanned downtime.

Step 01

ERP Invoice Schema & Tax Code Assessment

We audit your invoice document types (B2B, B2C, Credit/Debit notes, prepayments), VAT categories (S, Z, E, O), and customer master address fields against ZATCA UBL 2.1 requirements.

Step 02

Middleware & Connector Configuration

We deploy the Dynamics 365 connector or REST API webhook bridge in your staging environment and map your ERP fields to the ZATCA Connect payload contract.

Step 03

ZATCA Simulation & Compliance CSID Testing

We generate branch CSRs, onboard Compliance CSIDs via FATOORA OTP, and validate sample Standard, Simplified, Credit, and Debit invoices against ZATCA Simulation.

Step 04

Production CSID Issuance & Print QR Integration

Once compliance checks pass, we issue Production CSIDs for each branch and embed the returned Phase 2 QR code and UUID into your ERP invoice PDF/print templates.

Step 05

Go-Live Cutover & Queue Monitoring

We transition your production branches to live ZATCA Clearance and Reporting endpoints with real-time dashboard monitoring and finance team training.

Production Implementation Evidence

Multi-Branch Saudi Travel & Commercial Services Enterprise Deployment

A multi-branch commercial travel and corporate services organization operating across Riyadh, Jeddah, Dammam, and Al Khobar needed to connect its existing branch billing operations to ZATCA FATOORA Phase 2 without replacing its back-office reservation and accounting software.

Multi-Branch CSID Isolation

Configured independent EGS units and Production CSID certificates for 4 KSA branches, maintaining isolated sequential invoice counters (ICV) and SHA-256 hash chains per branch.

Automated Queue & Certificate Recovery

Implemented pre-flight buyer VAT (`BR-KSA-81`) and address (`BR-10`) checks plus automated retry queues so invoices queued during certificate renewal cleared seamlessly once active CSIDs were provisioned.

Verified Production Architecture Highlights

Active KSA Branches
4 Branches (Riyadh, Jeddah, Dammam, Khobar)
Invoice Flows
B2B Clearance & B2C Reporting + Cr. Notes
Schema Standard
UBL 2.1 XML + 9-Tag TLV QR
Audit Trail
Signed XML & SHA-256 Integrity Verification
Technical Documentation & Regulatory Guides

ZATCA Phase 2 Engineering Resource Library

Looking for India GST reconciliation instead? Explore TaxFlow (India GST Engine), maintained as a completely separate statutory codebase.

Technical & Compliance FAQ

Frequently Asked Questions — ZATCA Phase 2 Integration

Answers for Saudi CIOs, ERP project managers, and finance controllers evaluating FATOORA Phase 2 middleware.

No. Saky ZATCA Connect is designed as non-invasive integration middleware. You keep your existing Microsoft Dynamics 365, custom ERP, POS, or accounting system while ZATCA Connect handles UBL 2.1 XML transformation, cryptographic stamping, QR generation, and FATOORA API communication.
KSA Enterprise Integration Assessment

Request a ZATCA Phase 2 Technical Demo

Share your existing ERP environment and monthly invoice volume. Our integration engineers will walk you through the middleware architecture, UBL 2.1 XML transformation, and CSID onboarding flow.