22 May 2026

How to Set Up ZATCA E-Invoicing in Odoo 17: Step-by-Step Guide

A practical technical guide to configuring Odoo 17 for full ZATCA Phase 2 compliance in Saudi Arabia — from CSR generation to production go-live

Before You Start: What You Need

Before configuring ZATCA in Odoo 17, make sure the following are ready:

  • Odoo 17 installation with the Accounting module activated
  • ZATCA credentials for your business: Commercial Registration number, VAT number
  • A valid email address linked to your ZATCA account to receive the digital certificate
  • System administrator access to your Odoo instance

The setup process has two main stages: device registration and CSID (Cryptographic Stamp Identifier) extraction.

Step 1: Install the ZATCA Module in Odoo

  1. Go to Apps from the main Odoo menu
  2. Search for Saudi Arabia - E-invoicing or the technical name l10n_sa_edi
  3. Install the module and wait for it to complete
  4. Navigate to Accounting → Settings → Saudi E-Invoicing

On this screen you will find two critical fields:

  • ZATCA Environment: Select “Sandbox” for testing first, then switch to “Production” when ready
  • Initial OTP: This will be required later during certificate extraction

Step 2: Complete Your Company Data

Go to Settings → Companies and verify every field is accurate:

  • Legal company name matching exactly what is registered in ZATCA
  • VAT number (15 digits)
  • Address: Region, city, district, street, postal code
  • Commercial Registration (CR) number

Critical note: Any mismatch between Odoo company data and your ZATCA registration will cause invoices to be rejected by Fatoora. Cross-check against your VAT certificate.

Step 3: Generate a Certificate Signing Request (CSR)

The CSR is the request you send to ZATCA to obtain your CSID digital certificate.

From the e-invoicing settings screen:

  1. Click Generate CSR
  2. Enter the required device information (solution name, device type)
  3. Odoo will generate the CSR file automatically

Step 4: Register the Device and Extract Your CSID

  1. Log in to the Fatoora portal at fatoora.zatca.gov.sa
  2. Navigate to Devices → Register New Device
  3. Paste your CSR content into the designated field
  4. You will receive a one-time OTP to the registered email address
  5. Return to Odoo and enter the OTP in the “Initial OTP” field
  6. Click Extract Certificate — Odoo will receive the CSID directly from ZATCA

Step 5: Test Thoroughly in Sandbox

Before moving to production, test every invoice scenario:

Invoice types to test:

  • Standard tax invoice (B2B)
  • Simplified invoice (B2C)
  • Credit note
  • Debit note

For each one, verify that:

  • The invoice receives a cryptographic stamp from ZATCA
  • The QR code is valid and scannable
  • Both XML and PDF formats download correctly

Step 6: Switch to Production

Once all sandbox tests pass:

  1. Change the ZATCA environment from Sandbox to Production
  2. Generate a new CSR for the production environment
  3. Register a new device in the Fatoora portal (production environment)
  4. Extract the production CSID

Your system is now live for ZATCA Phase 2 e-invoicing directly from Odoo.

Common Problems and How to Fix Them

ProblemLikely CauseFix
CSID rejectedCompany data mismatchVerify all fields match ZATCA registration exactly
Invoice not stampedConnectivity issueCheck firewall rules allow outbound calls to Fatoora API
Invalid QR codeOutdated Odoo versionUpdate to the latest Odoo 17 release
VAT calculation errorIncorrect tax setupVerify 15% VAT is correctly mapped to products

Want Someone to Handle the Setup?

A complete ZATCA setup typically takes one to two working days and requires hands-on experience with both Odoo and the Fatoora platform. Configuration mistakes in production can halt your invoicing operation or result in ZATCA rejecting invoices — a costly situation to unwind.

At AlAfaq Alamiah, we handle the full implementation: CSR generation, certificate extraction, end-to-end testing, and team training — with no disruption to your current operations.