Saudi Arabia·7 min read·2026-08-30

ZATCA E-Invoicing Phase 2 in SAP: Your Implementation Guide

Most SAP shops already have the ERP muscle — what they're missing is the exact configuration sequence, validation checkpoints, and error-handling logic that ZATCA's Fatoorah Phase 2 actually demands before go-live.

By the SuperAccountant Editorial Team

ZATCA E-Invoicing Phase 2 in SAP: Your Implementation Guide · zatca e invoicing phase 2 sap — SuperAccountant Journal illustration

ZATCA E-Invoicing Phase 2 in SAP: Your Implementation Guide

Your wave date is either already set or arriving soon — ZATCA has been rolling Phase 2 onboarding in tranches since January 2023 (1 Jumada Al-Thani 1444H), and the Authority does not pause for under-prepared ERP teams. The gap most practitioners hit is not understanding the rule; it is knowing the precise SAP configuration sequence that passes ZATCA's cryptographic validation without a rejected-invoice backlog piling up on day one. This guide closes that gap.

What Phase 2 Actually Requires (Beyond the Phase 1 Basics)

Phase 1 (Fatoorah) was generation-only: produce a structured XML and a QR code, store it locally. Phase 2, governed by the ZATCA E-Invoicing Implementing Regulations (Articles 53–66 of the VAT Implementing Regulation as amended), adds two mandatory technical layers:

  • Integration with the Fatoorah portal via ZATCA's published APIs (see zatca.gov.sa → Developer Portal)
  • Cryptographic Stamping — each invoice must carry a UUID, a counter value, a previous-invoice hash, a digital signature, and a QR code encoding all of the above

Two transaction types flow through different API paths:

  • Standard Tax Invoices (B2B/B2G): must be cleared by ZATCA before they are valid — meaning ZATCA's system signs the XML and returns it to you within seconds.
  • Simplified Tax Invoices (B2C): must be reported to ZATCA within 24 hours of issuance.

Failing clearance on a B2B invoice means your buyer cannot claim input VAT. That is the practical consequence that should focus every IT and finance team.

SAP Landscape Considerations Before You Touch Configuration

Before you open any transaction code, answer these four questions:

QuestionWhy It Matters
Are you on S/4HANA (on-premise or cloud), ECC 6.0, or a hosted variant?SAP's official Fatoorah add-on requires a minimum support package level — check SAP Note 3099024 for S/4HANA and 3099025 for ECC.
Is your system on the ZATCA-approved (Mu'tamad) software list?Only Mu'tamad-listed ERP versions can act as the stamping point. Verify at zatca.gov.sa → E-Invoicing → Approved Solutions.
Do you have an active ZATCA Fatoorah Portal organisation account?Onboarding and CSID (Cryptographic Stamp Identifier) issuance happen here before any SAP config can be tested.
Is your basis team ready to deploy SAP's KSA Localisation Note stack?These are not one-click patches; they touch FI, SD, and Basis layers simultaneously.

If you answered "not sure" to any of these, stop and resolve them. Every configuration step downstream depends on these foundations.

Step-by-Step SAP Configuration for ZATCA Phase 2

Step 1 — Activate the KSA Localisation Add-On

Apply the mandatory SAP Notes in sequence (verify the latest stack via SAP Support Launchpad — search "ZATCA Phase 2"):

  1. Core XML schema note (UBL 2.1 compliant, ZATCA-specific extensions)
  2. Digital signature / hashing library note
  3. Business partner and tax code mapping note

Once applied, activate the KSA E-Invoice Customising node in SPRO: Financial Accounting → Accounts Receivable → E-Invoicing → KSA → Basic Settings.

Step 2 — Configure the Fatoorah Portal Connectivity (PCSID / CSID)

ZATCA's onboarding uses a two-certificate flow:

  1. PCSID (Provisional Cryptographic Stamp ID): generated during compliance testing. In SAP, trigger this via the dedicated report (delivered with the localisation note) — it submits your Certificate Signing Request (CSR) to https://gw-fatoorah.zatca.gov.sa/e-invoicing/developer-portal and stores the returned certificate in SAP's own certificate store (transaction STRUST).
  2. CSID (Production): issued after you pass ZATCA's compliance checks. Store this in the same STRUST path and update your RFC destination to point at the production endpoint.

Keep both certificates under version control. ZATCA certificates have a finite validity period; expiry causes immediate invoice rejection.

Step 3 — Map Your Tax Codes and Business Partner Fields

ZATCA's XML schema requires fields that standard SAP invoices do not always populate:

  • Buyer VAT registration number — map from Customer master field STCD3 (KSA TRN field)
  • Supply type code — B2B, B2C, Export — configure in the document type customising
  • Payment means code — cash (10), credit (30), bank transfer (42) per UN/CEFACT code list
  • Item-level VAT category code — Standard Rate (S), Zero-Rated (Z), Exempt (E), Not Subject (O)

Run a data quality pass on your customer master before go-live. A single missing TRN on a high-value B2B customer means that invoice cannot clear.

Step 4 — Build and Test the Clearance / Reporting Workflow

The SAP localisation delivers two background jobs:

  • Clearance Job (B2B): calls PUT /invoices/clearance and writes the signed XML back to the FI document. Schedule this to run within your DSO latency — most clients set it to trigger immediately on billing document release.
  • Reporting Job (B2C): calls POST /invoices/reporting — schedule within the 24-hour window required by Article 53(3) of the ZATCA Implementing Regulations.

In ZATCA's Compliance Checks environment, test at minimum:

  • A standard credit invoice
  • A standard debit note
  • A simplified invoice with a discount line
  • A zero-rated supply (export)
  • A rejected invoice scenario (deliberately corrupt the hash and confirm your error-handling route fires)

ZATCA requires you to pass 100% of compliance test cases before receiving your production CSID. Do not skip the rejection scenario — it is the one that burns teams in production.

Step 5 — Error Handling and Resubmission Logic

ZATCA returns structured error codes in the API response body. Map the most common ones in your SAP workflow:

  • ICV sequence error — your invoice counter is out of sync; reseed from the last successfully cleared invoice
  • PIH hash mismatch — the previous-invoice hash does not match ZATCA's record; this is often caused by a batch job that partially committed
  • XML schema validation errors — almost always a missing mandatory field; trace back to Step 3

Build a resubmission queue — a custom Z-table holding failed invoice UUIDs, error codes, and retry timestamps — rather than relying on manual SD re-billing. A well-designed queue lets your team clear a backlog of 200 invoices in under an hour.

Common Implementation Mistakes (and How to Avoid Them)

1. Going live without certificate rotation logic ZATCA certificates expire. Build an automated alert (via SAP's job scheduler) 30 days before expiry and document the CSID renewal process now, not when you get an expiry warning on a Tuesday evening.

2. Treating Phase 2 as a pure IT project The VAT category codes, buyer TRN population, and supply type classifications are accounting decisions. Involve your VAT team in UAT — not just at sign-off, but during test case design.

3. Ignoring the 24-hour B2C reporting window during peak periods If your B2C billing run fires at 23:00 and the reporting job has a dependency that fails, you can breach the 24-hour rule before anyone wakes up. Build a monitoring alert, not just a scheduled job.

4. Single-environment testing ZATCA runs a separate Sandbox and Compliance environment. Teams that test only in Sandbox often hit surprises in Compliance because Sandbox is more permissive on schema rules. Complete all compliance test cases before requesting production credentials.

If you want to benchmark your current Phase 2 readiness against a structured framework, the SuperAccountant skills quiz covers KSA e-invoicing concepts and highlights gaps worth closing before your go-live date.

Post-Go-Live Monitoring Checklist

Once in production, your monthly hygiene routine should cover:

  • Confirm clearance success rate ≥ 99.9% — pull from the ZATCA Fatoorah portal dashboard
  • Reconcile invoice counter (ICV) in SAP against ZATCA portal records
  • Review any invoices in the resubmission queue older than 48 hours
  • Check CSID certificate expiry date — renew if < 30 days remaining
  • Confirm that any new VAT tax codes introduced in the month have been mapped to ZATCA category codes
  • Archive signed XML files per ZATCA's 6-year retention requirement (Article 66 of the VAT Implementing Regulation)

What Auditors and Finance Teams Should Verify

From an audit and financial-controls perspective, Phase 2 creates a verifiable trail that did not exist before. For your next internal audit cycle:

  • Confirm that no invoice was issued outside the SAP-ZATCA workflow (watch for manual PDF invoices still circulating — these are non-compliant)
  • Verify that the QR code on each printed invoice decodes correctly using ZATCA's open-source verifier (available on zatca.gov.sa)
  • Test that the hash chain is unbroken — a gap in ICV sequence is a red flag for regulators
  • Confirm that Zakat and income tax workpapers reconcile to the cleared-invoice XML totals, not just the SAR ledger balance

Phase 2 compliance data is increasingly becoming source-of-truth for VAT return reconciliation. Teams that align their VAT Return (Form 15) preparation directly to the ZATCA portal data — rather than reconciling after the fact — reduce adjustment risk materially.


Sharpen your edge with SuperAccountant's next live cohort — small batches, real client workpapers, taught by partners. Details and seats at https://app.superaccountant.in/en/cohort?utm_source=blog&utm_medium=cta&utm_campaign=accountants.