Auditing, Governance, and Digital Transformation

E-Invoicing: Technical requirements and integration with the Tax Authority (ZATCA)

Illustration for Electronic Invoicing E Invoicing
Skip to content
ZATCA & Compliance E-Invoicing • Phase 2 • Integration • XML • QR Code • Digital Salla

E-Invoicing (E-Invoicing): Technical Requirements and Integration with ZATCA

E-Invoicing (Fatoora): A professional guide explaining the technical requirements for applying ZATCA invoices, how to integrate with the Zakat, Tax and Customs Authority, clarifying the QR code, and identifying common errors that lead to invoice rejection—Digital Salla.

Before the technical part, check the data: Tax Invoice Mandatory Data — To ensure that your invoice contains the legal information required before starting the electronic integration process.
E-invoicing design showing a digital system connected to the ZATCA portal with an XML file and a compliant QR code.
Core Principle: E-invoicing is not just a “Digital PDF.” It is a Structured Data Exchange (XML) that allows the Authority to verify transactions in real-time.
What will you learn in this guide?
  • Fundamental concept of E-Invoicing (Phase 1 vs. Phase 2).
  • Technical requirements: XML, UUID, Hash, and Digital Signatures.
  • How the Integration (Linking) process works via APIs.
  • Analyzing the QR Code: Mandatory fields for B2B and B2C.
  • The difference between “Clearance” (Standard) and “Reporting” (Simplified).
  • Common errors in implementation and how to avoid them.
Practical Note: Integrating with the Fatoora Portal is a one-time setup, but ensuring data quality is a daily duty. A technical failure in the API means your invoices are legally invalid.

1) The Concept of E-Invoicing

E-Invoicing (Fatoora) is the process of generating, storing, and exchanging invoices in a structured electronic format (XML or PDF with embedded XML). It is designed to fight the shadow economy and increase transparency between the taxpayer and the Authority.

Key Insight: A scanned paper invoice or a document typed in Word is NOT an electronic invoice according to ZATCA regulations.

2) Phase 1 vs. Phase 2 (The Strategic Difference)

ZATCA has implemented the system in two distinct stages:

  • Phase 1 (Generation): Requires issuing and storing invoices via a compliant system. No direct connection to ZATCA was mandatory.
  • Phase 2 (Integration): Requires a Live API Connection. Each invoice must be validated or reported to ZATCA as it is issued.

3) The Integration Path (Visual Logic)

How an invoice travels from your ERP to ZATCA and then to the Client?

The ZATCA Integration Flow Diagram showing the data flow from ERP to ZATCA for validation and then to the Customer. Phase 2: Integration & Clearance Flow 1) ERP System Generates XML API 2) ZATCA (Fatoora) Validation & Stamp 3) Customer Receives Valid Invoice Result: The Authority has a copy of the invoice before the customer even pays, eliminating tax evasion risk.
Key Advantage: Real-time verification ensures that the Input Tax claimed by the buyer matches the Output Tax recorded by the seller.

4) Technical Requirements for Phase 2

To integrate with the Authority, your system must support:

Recommended for you

Sales Controls Template - Excel Template

Sales Control Template is an effective Excel tool to manage and monitor sales invoices and revenue c...

  • XML Format (UBL 2.1): The universal language for business documents.
  • UUID: A unique 128-bit identifier for every single invoice.
  • Cryptographic Stamp: A digital signature that proves the invoice hasn’t been altered after issuance.
  • Hash Chain: Each invoice is linked to the one before it, preventing anyone from deleting a past invoice.

5) Decoding the QR Code Requirements

The QR Code is the visual proof of compliance. It must contain (encoded in Base64):

  1. Seller’s Name.
  2. Seller’s VAT Registration Number.
  3. Invoice Timestamp (Date & Time).
  4. Invoice Total (Including VAT).
  5. VAT Amount.
  6. Phase 2 extra: Digital signature and Hash of the XML.

6) Clearance vs. Reporting Processes

The workflow depends on the type of invoice:

Phase 2 Processing Logic
Invoice Type Process Description
Standard (B2B) Clearance Must be sent to ZATCA and “Stamped” before giving it to the client.
Simplified (B2C) Reporting Issued to the client immediately, then “Reported” to ZATCA within 24 hours.

7) Operational Controls & Readiness Checklist

To ensure your E-Invoicing System is compliant:

ZATCA Integration Quality Gate

  1. Is your system on the ZATCA Certified Solution list?
  2. Can your system generate invoices in Offline Mode and sync later?
  3. Are Prohibited Functions (like changing old invoices or multiple sequences) blocked?
  4. Have you completed the “Onboarding” process on the Fatoora Portal?
  5. Do you have an Archiving Policy to store invoices for 6-10 years?
Related topic: Data Migration — Because before integration, you must ensure your Customer VAT Numbers are migrated correctly to avoid API rejection.

8) Common Errors and How to Prevent Them

  • Incorrect VAT Calculation: Calculating VAT on the total instead of line-by-line (ZATCA requires line-level precision).
  • Invalid Date Format: Using ISO formats that the Authority doesn’t accept. Fix: Use the exact XSD Schema provided by ZATCA.
  • Sequence Gaps: Missing an invoice number in the chain. Fix: Ensure your ERP has a robust auto-sequencing engine.
  • Wrong Invoice Type: Issuing a “Standard” invoice for a retail customer. Fix: Configure “Customer Type” validation in the master data.

9) Frequently Asked Questions

Does ZATCA store my actual invoice data?

Yes. For Standard invoices, they clear and store the data in real-time. For Simplified, they receive a summary reporting file.

What happens if my Internet is down?

ZATCA allows for “Delayed Reporting” in case of technical issues, but the system must timestamp the invoice locally and sync as soon as the connection is restored.

Is the QR code mandatory for B2B invoices?

In Phase 1, it was optional for B2B. In Phase 2, it is mandatory for all electronic invoices.

10) Conclusion

E-Invoicing and integration with ZATCA is more than just a regulatory hurdle; it is the final piece of the Digital Transformation puzzle. By aligning your ERP system with the technical requirements of XML, API integration, and secure hashing, you protect your entity from massive fines and ensure its reputation as a compliant, modern institution. This integration creates a safer business environment where data drives the economy, and transparency build trust with both the Authority and your global partners.

Action Step Now (30 minutes)

  1. Check your ZATCA Wave date based on your 2022/2023 revenue.
  2. Ask your ERP provider: “Are we ready for Phase 2 API Integration?”.
  3. Scan one of your current invoices with the official ZATCA App to verify QR compliance today.

© Digital Salla Articles — General educational content for tax, compliance, and digital transformation purposes.