Complete guide to implementing ZATCA-compliant e-invoicing in Saudi Arabia. Our platform offers comprehensive tools for seamless integration, helping businesses achieve compliance with ease while streamlining their invoice management processes.
ZATCACompliant
Phase 2Ready
B2B/B2CSupported
Real-timeValidation
Reporting Mandates
Fatoora Phase 1
Fatoora Phase 2
Exchange Networks
E-Mail
Supported Documents
Commercial Invoices
Advance Invoice
Credit Notes
Debit Notes
Introduction to Saudi Arabia E-Invoicing
Saudi Arabia is one of the leading economies in the Middle East and a key member of the G20. As part of its ambitious Vision 2030 program, the Kingdom is driving digital transformation across all sectors, including tax administration and business operations. The Zakat, Tax and Customs Authority (ZATCA) has spearheaded the implementation of mandatory electronic invoicing under the Fatoorah program.
Key Authorities
Authority
Role
Responsibilities
Zakat, Tax and Customs Authority (ZATCA)
Primary regulatory body for e-invoicing
• Developing and publishing e-invoicing technical standards and specifications • Setting compliance requirements and enforcement • Managing the phased rollout based on taxpayer revenue thresholds • Operating the Fatoora Portal for clearance and reporting • Issuing Cryptographic Stamp Identifiers (CSIDs) to compliant EGS devices
• Setting overall tax policy direction • Coordinating with ZATCA on VAT and e-invoicing regulations • Overseeing revenue collection and fiscal compliance
The e-invoicing mandate is a central pillar of Saudi Arabia's Vision 2030 goals:
Objective
Description
Digitization
Modernize government and business processes through digital platforms
Economic Diversification
Strengthen non-oil revenue through improved VAT compliance
Tax Compliance
Reduce the VAT gap and combat tax evasion through real-time transaction controls
Ease of Business
Streamline invoicing and reduce manual paper-based processes
Transparency
Enable data-driven government decision-making with real-time economic data
E-Invoicing Overview
Saudi Arabia's e-invoicing system, known as Fatoorah (فاتورة), was introduced by ZATCA in two phases:
Phase 1 — Generation Phase (December 4, 2021): All VAT-registered taxpayers in the Kingdom were required to generate and store electronic invoices and related credit/debit notes using compliant e-invoicing solutions. No specific XML format was mandated, but invoices had to include QR codes (for B2C) and be generated electronically (not handwritten or scanned).
Phase 2 — Integration Phase (January 1, 2023 onwards): Taxpayers are required to integrate their E-Invoicing Generation Solutions (EGS) with ZATCA's Fatoora platform via API. B2B invoices must be cleared by ZATCA before being shared with the buyer, while B2C invoices must be reported to ZATCA within 24 hours. This phase introduced the Continuous Transaction Controls (CTC) model with mandatory UBL 2.1 XML format, cryptographic stamping, and certificate-based authentication. The rollout is happening in waves based on annual revenue thresholds, gradually expanding from the largest enterprises down to smaller businesses.
Saudi Arabia E-Invoicing and Fiscalization Mandates
Saudi Arabia has implemented one of the most comprehensive e-invoicing mandates in the Middle East through ZATCA's Fatoorah program. This section outlines the mandate requirements affecting businesses operating in the Kingdom.
ZATCA Fatoorah eInvoicing
The Zakat, Tax and Customs Authority (ZATCA) introduced the Fatoorah (فاتورة) electronic invoicing mandate in two phases, establishing a Continuous Transaction Controls (CTC) system for real-time tax compliance.
What is Fatoorah?
Fatoorah is Saudi Arabia's mandatory e-invoicing system that requires businesses to generate, transmit, and store electronic invoices and related documents (credit/debit notes) through ZATCA-compliant solutions. In Phase 2, all invoices must be processed through ZATCA's Fatoora Portal via API before being shared with customers.
Regulatory Framework
Component
Details
Issuing Authority
Zakat, Tax and Customs Authority (ZATCA)
Program Name
Fatoorah (فاتورة)
Standard
UBL 2.1 XML
Model
Continuous Transaction Controls (CTC)
Phase 1
Generation Phase — December 4, 2021
Phase 2
Integration Phase — January 1, 2023 (rolling waves)
Phased by annual revenue — from SAR 3 billion (Wave 1) down to SAR 2.5 million
How It Works
The Saudi e-invoicing system operates through a CTC clearance and reporting model:
Transaction
Process
Flow
B2B / B2G
Clearance
Invoice is sent to ZATCA's Fatoora Portal for validation and clearance before delivery to the buyer
B2C
Reporting
Invoice is generated locally and reported to ZATCA within 24 hours after issuance
Both models require the use of an E-Invoicing Generation Solution (EGS) — a hardware or software system registered with ZATCA that generates cryptographically stamped invoices.
Document Types
The mandate covers several types of electronic documents:
Document Type
Code
Description
Tax Invoice
388
Standard invoice for regular taxable supplies
Advance Invoice
386
Invoice issued for advance payments before delivery of goods/services
Credit Note
381
Adjusts or corrects a previously issued invoice (reduces amount)
Debit Note
383
Adjusts a previously issued invoice (increases amount)
Each document type can be issued as either:
Standard (standard) — For B2B/B2G transactions, requires ZATCA clearance
Simplified (simplified) — For B2C transactions, requires ZATCA reporting
Key Requirements
To comply with the ZATCA Fatoorah mandate, businesses must:
#
Requirement
Description
1
Compliant EGS
Use an E-Invoicing Generation Solution registered with ZATCA
2
ZATCA Certificates
Obtain Compliance and Production CSIDs from the Fatoora Portal
3
UBL 2.1 XML Format
All invoices must be in the prescribed XML format
4
Cryptographic Stamping
Every invoice must be digitally signed with the ZATCA-issued certificate
5
QR Codes
Simplified (B2C) invoices must include TLV-encoded QR codes
6
Real-time Integration
B2B invoices cleared via API; B2C invoices reported via API
VAT Categories
Saudi Arabia supports four VAT categories for line items:
Category
Code
Description
Tax Rate
Standard Rated
S
Standard VAT rate applies
15%
Zero Rated
Z
0% VAT rate for specific supplies (exports, medicines, etc.)
0%
Exempt
E
Exempt from VAT (financial services, real estate, etc.)
N/A
Out of Scope
O
Not subject to VAT
N/A
Implementation
Businesses should take the following steps to comply with the Fatoorah mandate:
Step
Action
Purpose
1. Assess Readiness
Determine which Phase 2 wave applies based on annual revenue
Understand your compliance timeline
2. Select an EGS
Choose a compliant E-Invoicing Generation Solution or API provider
Ensure technical compliance
3. Register EGS
Onboard your EGS devices with ZATCA's Fatoora Portal
Obtain Compliance CSID
4. Complete Compliance
Pass ZATCA's compliance checks to obtain Production CSID
Activate production clearance
5. Go Live
Begin clearing B2B invoices and reporting B2C invoices
The ZATCA Fatoorah Phase 2 system requires businesses to integrate their invoicing solutions with ZATCA's Fatoora Portal for real-time clearance and reporting of electronic invoices.
What is ZATCA Phase 2?
Phase 2 (Integration Phase) of the Fatoorah mandate requires all applicable VAT-registered taxpayers to connect their E-Invoicing Generation Solutions (EGS) to ZATCA's Fatoora platform via API. This enables:
B2B/B2G Clearance: Standard tax invoices must be submitted to ZATCA and cleared before delivery to the buyer
B2C Reporting: Simplified tax invoices are reported to ZATCA within 24 hours of issuance
Cryptographic Stamping: Every invoice is digitally signed using ZATCA-issued certificates
The Clearance and Reporting Model
ZATCA's system uses a Continuous Transaction Controls (CTC) model with two distinct flows depending on the transaction type:
Flow
Invoice Type
Transaction
Process
Clearance
Standard (standard)
B2B / B2G
Invoice is sent to ZATCA → validated → cryptographically stamped → returned with QR code → then shared with buyer
Reporting
Simplified (simplified)
B2C
Invoice is generated locally with QR code → issued to buyer → reported to ZATCA within 24 hours
Clearance Flow (B2B/B2G)
EGS generates the invoice in UBL 2.1 XML format
Invoice is digitally signed with the Production CSID
Invoice is submitted to ZATCA's Fatoora Portal via API
ZATCA validates the invoice against business rules
If valid, ZATCA returns the cleared invoice with a cryptographic stamp and QR code
The cleared invoice is delivered to the buyer
Reporting Flow (B2C)
EGS generates the simplified invoice in UBL 2.1 XML format
Invoice is digitally signed with the Production CSID
QR code is generated locally using TLV encoding
Invoice is issued to the customer immediately
Invoice data is reported to ZATCA via API within 24 hours
E-Invoicing Generation Solution (EGS)
An EGS is any hardware or software system used to generate electronic invoices. Each EGS device must be individually registered with ZATCA's Fatoora Portal and assigned its own cryptographic certificates.
EGS Requirements
Requirement
Description
Device Registration
Each EGS must be onboarded with ZATCA via the Fatoora Portal
OTP Verification
A 6-digit OTP from the Fatoora Portal is required during onboarding
Compliance CSID
Issued after onboarding — used for compliance testing
Production CSID
Issued after passing compliance checks — used for live invoicing
Branch Association
Each EGS is linked to a specific branch/location
Certificate Renewal
Certificates must be renewed before expiry
EGS Integration Lifecycle
The full lifecycle from device registration through to live invoice generation:
Step
Endpoint
Description
1. Onboard
POST /egs/onboard
Register device(s) with ZATCA — provides device details, location, and OTP. Returns a Compliance CSID (CCSID).
2. Compliance Check
GET /egs/compliance-check/{uuid}
Run ZATCA compliance checks using the CCSID. If all checks pass, a Production CSID (PCSID) is issued.
3. Generate & Clear/Report
POST /api/einvoice/generate/invoice
Generate invoices using the PCSID. B2B invoices are cleared; B2C invoices are reported.
4. Report B2C
POST /api/einvoice/report
Explicitly report simplified (B2C) invoices to ZATCA.
Invoice Types
ZATCA defines two invoice types based on the transaction:
Standard Tax Invoice (B2B/B2G)
Attribute
Details
inv_type
standard
Buyer Info
Required — full party details including VAT number and address
ZATCA Process
Clearance (must be approved before delivery)
QR Code
Generated by ZATCA during clearance
Use Cases
B2B supplies, government contracts, inter-company transactions
Simplified Tax Invoice (B2C)
Attribute
Details
inv_type
simplified
Buyer Info
Optional — buyer details not required
ZATCA Process
Reporting (reported after issuance)
QR Code
Generated locally by the EGS using TLV encoding
Use Cases
Point-of-sale, retail, consumer transactions
Document Type Codes
Code
Document Type
Description
388
Tax Invoice
Standard invoice for taxable supplies
386
Advance Invoice
Invoice for advance payments
381
Credit Note
Reduces amount of a previously issued invoice
383
Debit Note
Increases amount of a previously issued invoice
Key Components
Cryptographic Stamp Identifier (CSID)
ZATCA issues digital certificates to each registered EGS device:
Compliance CSID (CCSID): Temporary certificate issued during onboarding, used to complete compliance checks
Production CSID (PCSID): Permanent certificate issued after passing compliance, used for live invoice signing
QR Code (TLV Encoding)
Phase 2 invoices require QR codes encoded using Tag-Length-Value (TLV) format containing:
Seller name (Arabic)
VAT registration number
Invoice timestamp (ISO 8601)
Invoice total (including VAT)
VAT amount
Invoice hash (Phase 2 only)
Digital signature (Phase 2 only)
Public key (Phase 2 only)
Certificate signature (Phase 2 only)
Standards and Format
Standard
Specification
XML Format
UBL 2.1 (Universal Business Language)
Encoding
UTF-8
Signing
X.509 certificates issued by ZATCA
Hash Algorithm
SHA-256
Currency
SAR (default), other currencies supported with exchange rate
5-digit postal zone or ZIP code for the customer's location.
plot
Requirement: Optional Type: String
4-digit plot identification number for the customer's location.
building
Requirement: Optional Type: String
4-digit building number for the customer's location.
country
Requirement: Conditional Type: String (ISO 3166-1 alpha-2)
Two-letter country code of the buyer. Defaults to SA if not provided. Mandatory for export invoices (is_export: true) or when the buyer is located outside Saudi Arabia.
Regional API
JSON
{ "party_details": { "country": "AE" }}
party_add_id
Requirement: Optional Type: Key-Value Object
Additional party identification. Can include IDs such as:
This guide covers the complete lifecycle of e-invoicing in Saudi Arabia, from onboarding EGS devices to generating, clearing, and reporting invoices through ZATCA's Fatoora Portal.
Overview
The ZATCA e-invoicing lifecycle follows these stages:
Stage
Endpoint
Purpose
1. Onboard EGS
POST /egs/onboard
Register devices and obtain Compliance CSID
2. Compliance Check
GET /egs/compliance-check/{uuid}
Pass compliance tests and obtain Production CSID
3. Generate Invoice
POST /api/einvoice/generate/invoice
Generate and clear B2B invoices or generate B2C invoices
4. Report B2C
POST /api/einvoice/report
Report simplified (B2C) invoices to ZATCA
5. Phase One QR
POST /api/einvoice/generate/phase-one-qr
Generate QR codes for Phase 1 compliance
1. Onboard EGS Devices
Before generating invoices, your E-Invoicing Generation Solution (EGS) devices must be registered with ZATCA. This step generates a Compliance CSID (CCSID) for each device.
Prerequisites
A Flick API account with KSA mandate enabled
Your company's VAT registration details (15-digit VAT number starting and ending with 3)
A 6-digit OTP obtained from the Fatoora Portal for each device
Unique identifier for the onboarded EGS — used in subsequent API calls
device_name
The name you provided during onboarding
compliance_certificate
The Compliance CSID (CCSID) certificate issued by ZATCA
Key Points:
Each device gets its own UUID and Compliance CSID
The UUID is required for the compliance check step and as a header when generating invoices
You can onboard multiple devices in a single request
For Group-VAT members, set branch_name to the member's 10-digit TIN
2. Complete Compliance Check
After onboarding, each EGS device must pass ZATCA's compliance checks to receive a Production CSID (PCSID). The compliance check verifies that the device can properly generate, sign, and submit invoices.
Request
Endpoint: GET /egs/compliance-check/{egs_uuid}
Headers:
x-flick-auth-key: Your Flick API key
Path Parameters:
Parameter
Type
Description
egs_uuid
String
UUID returned from the onboarding step
Sample Request
Text
GET /egs/compliance-check/f902f9aa-3d25-4bf2-90c5-6ec4bbc122df
{ "status": "validation_error", "message": "There are validation errors in the submitted data", "errors": [ { "error": "Issue time is required", "path": ["issue_time"] } ], "errors_text": "(1) Issue time is required"}
Field
Description
status
"validation_error"
message
Human-readable summary
errors
Array of individual errors, each with error (message) and path (field location)
Mandatory for doc_type: 388 with inv_type: standard. Must include actual_delivery.
has_advance
Boolean
No
Whether invoice has advance payments
advance_details
Object
Conditional
Required when has_advance is true
notes_details
Object
Conditional
Required for credit/debit notes (doc_type 381/383)
lineitems
Array
Yes
At least one line item required
Discounts
Array
No
Document-level discounts
Charges
Array
No
Document-level charges
is_export
Boolean
No
Export transaction flag
is_b2g
Boolean
No
B2G transaction flag
is_thirdparty
Boolean
No
Third-party transaction flag
is_nominal
Boolean
No
Nominal transaction flag
is_summary
Boolean
No
Summary invoice flag
is_selfbilled
Boolean
No
Self-billed invoice flag
4. Report B2C E-Invoice
Use this endpoint when you do not need real-time clearance. Instead of clearing the invoice through ZATCA before delivery, the /report endpoint returns a QR code immediately so you can issue it to the customer (e.g. from a POS system), while Flick reports the transaction to ZATCA asynchronously within 24 hours.
This is the standard flow for simplified (B2C) invoices.
Request
Endpoint: POST /api/einvoice/report
Headers:
x-flick-auth-key: Your Flick API key
egs_uuid: UUID of the EGS device
Content-Type: application/json
The request body is the same as the Generate endpoint. For B2C invoices, use inv_type: "simplified" and party_details are optional.
Base64-encoded QR code — use this in your POS receipt or invoice printout
Validation Error Response (400)
Validation errors follow the same structure as the Generate endpoint. See Generate Validation Error above.
Key Differences: Generate vs Report
/generate
/report
ZATCA process
Real-time clearance — invoice is validated and stamped by ZATCA before you get the response
Async reporting — QR code returned immediately, Flick reports to ZATCA within 24 hours
Typical use
B2B/B2G standard invoices
B2C simplified invoices (POS, retail)
Response
Full response with pdf_base64, xml_base64, invoice_total, tax_total
Lightweight response with uuid, invoice_hash, qr_code only
Buyer details
party_details mandatory
party_details optional
5. Generate Phase One QR Code
For businesses still in Phase 1, or for generating standalone QR codes, use this endpoint to create a ZATCA-compliant QR code with the 5 mandatory TLV fields.
Request
Endpoint: POST /api/einvoice/generate/phase-one-qr
Onboard devices via POST /egs/onboard — save the returned UUIDs
Complete compliance via GET /egs/compliance-check/{uuid} — obtain Production CSIDs
Ongoing Operations
Generate B2B invoices via POST /api/einvoice/generate/invoice with inv_type: "standard"
Report B2C invoices via POST /api/einvoice/report with inv_type: "simplified"
Handle errors — check response status and handle ZATCA rejections
Integration Checklist
Before going live, verify:
All EGS devices are onboarded and have Production CSIDs
API authentication is configured with valid credentials
B2B invoices are being cleared before delivery to buyers
B2C invoices are being reported within 24 hours
VAT calculations are correct (15% standard rate)
Arabic fields (name_ar, city_ar, etc.) are properly encoded in UTF-8
Sequential invoice numbering is maintained per EGS device
Error handling and retry logic are implemented
Sandbox testing is complete with all invoice types
For complete request body examples covering all invoice types, refer to the Examples section.
Saudi Arabia E-Invoicing Examples
Complete collection of ZATCA-compliant invoice examples covering standard invoices, simplified invoices, credit/debit notes, advance invoices, and special scenarios.
Standard Invoices
Standard Tax Invoice (B2B)
A typical B2B tax invoice with standard 15% VAT rate, full buyer details, and multiple line items.
Key Features:
Document Type: 388 (Tax Invoice)
Invoice Type: standard (B2B — requires ZATCA clearance)