All Posts
Compliance & E-Commerce

ZATCA Phase 2 for E-Commerce: How Saudi Online Retailers Can Achieve Compliance

Matti ur Rehman·March 20, 2026·7 min read
ZATCAE-CommerceSaudi ArabiaShopifyWooCommerceVATCompliance

E-commerce businesses in Saudi Arabia process thousands of transactions daily, each requiring a ZATCA-compliant electronic invoice. Unlike traditional retail with POS-generated invoices, e-commerce platforms must generate, validate, and report invoices programmatically through their order management systems.

Why E-Commerce ZATCA Is Different

Traditional brick-and-mortar businesses generate invoices at the point of sale. E-commerce businesses generate invoices at multiple stages: order confirmation, payment capture, shipping, and refunds. Each event may trigger a different type of ZATCA document — standard invoices, credit notes, and debit notes — all requiring real-time clearance or reporting.

Technical Integration Architecture

The recommended architecture places a ZATCA middleware layer between your e-commerce platform and the Fatoorah API. This middleware handles XML generation in UBL 2.1 format, cryptographic signing with your ZATCA-issued certificate, QR code generation embedding invoice data, clearance API calls for B2B transactions, reporting API calls for B2C transactions, and retry logic with exponential backoff for API failures.

Platform-Specific Solutions

Shopify Shopify stores can integrate via a custom app that hooks into the order.paid webhook, generates the ZATCA-compliant invoice, and stores the clearance response.

WooCommerce WordPress/WooCommerce sites can use a custom plugin that extends the WooCommerce invoice system with ZATCA XML generation and API integration.

Custom Platforms For custom-built e-commerce platforms, Mantiqi builds a standalone ZATCA microservice that accepts order data via API and handles all compliance requirements independently.

Common Pitfalls

The most common mistakes Saudi e-commerce businesses make with ZATCA Phase 2 are not handling refund credit notes correctly, using incorrect VAT categorisation for zero-rated or exempt items, failing to implement retry logic for API timeouts, and not maintaining the sequential invoice counter required by ZATCA.

How Mantiqi Can Help

Mantiqi has implemented ZATCA Phase 2 for Saudi e-commerce businesses across Shopify, WooCommerce, and custom platforms. We handle the full integration — middleware development, testing in the ZATCA sandbox, and production deployment. Contact us for a ZATCA compliance assessment of your e-commerce platform.

MuR

Matti ur Rehman

Co-Founder, Mantiqi