ZATCA E-Invoicing Phase 2: ERP Integration Guide for Accountants
Most Phase 2 guides are written for IT teams. This one is for the accountant managing the integration checklist, validating the CSID, and owning the audit trail when ZATCA comes knocking.
By the SuperAccountant Editorial Team
ZATCA E-Invoicing Phase 2: ERP Integration Guide for Accountants
Your IT team has plugged the ERP into the Fatoora portal. Now ZATCA sends back a clearance rejection — and everyone looks at you. Phase 2 of Saudi Arabia's e-invoicing mandate (Fatoorah) shifted accountability from the software vendor to the finance function. If you are the accountant managing this implementation, here is the workflow-first breakdown you actually need.
What Phase 2 Actually Changes for Your Day-to-Day
Phase 1 (December 2021) required generating a structured XML invoice and storing it. Phase 2 — the Integration Phase — requires your ERP to connect in real time to ZATCA's Fatoora platform and receive either a clearance (standard invoices above ﷼1,000) or a reporting acknowledgement (simplified invoices) before the document is considered legally valid.
Under ZATCA's E-Invoicing Implementing Regulation (Articles 53–56, as published on zatca.gov.sa), this means:
- Every B2B tax invoice must be cleared by ZATCA's API before it is handed to the buyer.
- Every B2C simplified invoice must be reported within 24 hours of issuance.
- The cleared/reported XML — including ZATCA's cryptographic stamp — is the legal document. Your PDF is a human-readable copy, not the original.
The practical consequence: your accounts-receivable cut-off procedure, your month-end invoice register, and your audit file must reference the cleared XML UUID, not just the internal invoice number.
The Five-Step CSID Onboarding Workflow (Fatoora Portal OTP Integration)
Before a single invoice can be cleared, your ERP solution unit must be registered and issued a Cryptographic Stamp Identifier (CSID). This is the Fatoora portal OTP integration sequence accountants need to oversee:
-
Generate a Certificate Signing Request (CSR) inside the ERP. The CSR must include your VAT registration number (15-digit TIN), the solution name, and the ERP's production environment flag. Your IT contact runs this — your job is to confirm the TIN matches your ZATCA VAT certificate exactly.
-
Submit the CSR to the Fatoora compliance portal at fatoora.zatca.gov.sa. The portal returns a one-time password (OTP) valid for one hour. Log the timestamp — if the OTP expires, you restart.
-
Exchange the OTP for a CCSID (Compliance Cryptographic Stamp Identifier) using the
/complianceAPI endpoint. At this stage ZATCA runs format-level checks. You will need sample invoices in UBL 2.1 XML format for the compliance check calls — prepare at least one standard invoice and one credit note. -
Pass the compliance API checks, then call
/production/csidsto receive the live CSID. This is the credential your ERP stores and uses to sign every invoice going forward. Treat it like a signing certificate: document the expiry date (typically three years) and set a renewal calendar reminder. -
Go-live validation: Issue one real invoice, retrieve the cleared XML from the ZATCA response, and confirm the
<cac:Signature>block and the UUID are populated. File this as your Phase 2 go-live evidence.
Accountant's checkpoint: You own steps 1 (TIN verification), 3 (sample invoice preparation), and 5 (go-live evidence filing). Do not delegate these to IT without sign-off.
Mu'tamad ERP Compliance: What the Approved-Software List Means for You
ZATCA maintains an approved solutions list (Mu'tamad). Using a non-listed solution is not outright prohibited today, but ZATCA's published guidance makes clear that taxpayers remain liable for non-compliant output regardless of their vendor's claims. Verify your ERP's listing at zatca.gov.sa/en/E-Invoicing before the integration project closes.
Key validation points for Mu'tamad ERPs:
| Compliance Checkpoint | What to Verify | Who Owns It |
|---|---|---|
| UBL 2.1 XML schema | Run ZATCA's SDK validator against a sample invoice | IT + Accountant |
| QR code (TLV encoding) | Scan with any ZATCA-approved reader; confirm all 5 required tags | Accountant |
| UUID uniqueness | Confirm ERP generates a new UUID per invoice, stored in your ledger | Accountant |
| Anti-tampering hash | Previous invoice hash embedded in current invoice (PIH) | IT |
| VAT amount rounding | SAR amounts to 2 decimal places; VAT at exactly 15% | Accountant |
| Credit note linkage | Credit note XML references original cleared invoice UUID | Accountant |
The rounding rule catches teams every time: if your ERP calculates a line-level VAT of ﷼17.6666…, the rounded figure must be ﷼17.67, and the XML element <cac:TaxAmount> must carry that rounded value — not the pre-rounded one. ZATCA's validator rejects mismatches.
Handling Clearance Rejections: The Three Most Common Error Codes
Even after a successful CSID onboarding, production invoices get rejected. Here are the three codes your team will encounter most, with the accountant's corrective action:
Error BV-S-002 — Invalid XML structure: The ERP sent a malformed UBL 2.1 document. Pull the raw XML from your ERP's outbound log, run it through ZATCA's open-source SDK (available on the ZATCA GitHub under the Fatoora project), and identify the offending element. Usually a missing mandatory field like <cbc:TaxCurrencyCode>.
Error XSD-CWT-002 — Previous invoice hash mismatch: Your ERP lost chain continuity — the hash of the prior cleared invoice stored in your system does not match what ZATCA holds. This happens after a server restore or a manual database edit. Do not issue new invoices until IT reconciles the hash chain. Document the gap with a formal incident note for your audit file.
Error VAT-E-003 — VAT number not found: Typically triggered on B2B invoices where the buyer's VAT number in the XML is either missing or fails ZATCA's format check (must be 15 digits, starting with 3). Your AR team must enforce buyer-VAT-number collection as a mandatory field before invoice creation — not after.
For the authoritative error-code reference, consult the ZATCA E-Invoicing SDK documentation at zatca.gov.sa.
Month-End Close Procedures Under Phase 2
Phase 2 changes two specific close procedures that most teams have not yet updated:
Invoice completeness check: Your old procedure was to reconcile the internal invoice sequence. Your new procedure adds a second reconciliation: total invoices in the ERP's outbound queue vs. total UUIDs confirmed cleared/reported by ZATCA. Any gap is either a clearance failure or a missing report — both are a compliance breach under Article 53 of the Implementing Regulation.
VAT return cross-check (ZATCA VAT Return, Form VA-001): Your Box 1 (Standard-rated supplies) figure must agree to the sum of cleared invoice taxable values for the period. ZATCA's system holds the cleared invoices on their side — an unexplained variance between your return and their records is the first trigger for a field audit. Build this variance check into your close checklist before the VAT return is filed.
If your team wants to benchmark your current close procedures or test your Phase 2 knowledge before the next filing period, the SuperAccountant quiz covers KSA e-invoicing scenarios used in actual implementation projects.
Building the Audit File ZATCA Inspectors Expect
When ZATCA conducts a field review, their inspectors will ask for the cleared XML archive, not your PDF invoices. Structure your audit file now:
- Cleared XML store: Archived by period, with each file named by UUID. Retention period is ten years per the VAT Implementing Regulation.
- CSID certificate copy with issuance and expiry dates.
- Go-live evidence: The first cleared invoice UUID, timestamp, and the API response log.
- Rejection log: Every rejected invoice, the error code, the corrective action taken, and the resubmission UUID.
- Chain-continuity log: A record showing no gaps in the invoice hash chain, signed off by the finance manager monthly.
A rejection that was corrected and resubmitted is not automatically a penalty event — but an uninvestigated or undocumented rejection is. The documentation is your defence.
The Ongoing Compliance Calendar
Phase 2 is not a one-time project. Build these recurring tasks into your team calendar:
- Monthly: Invoice completeness reconciliation (ERP vs. ZATCA confirmed count).
- Quarterly: Re-run ZATCA SDK validation on a sample of cleared invoices to catch any ERP version drift.
- Annually (or on ERP upgrade): Re-run the full CSID onboarding compliance checks on a sandbox environment before pushing any ERP update to production.
- 36 months post-CSID issuance: Initiate CSID renewal at least 30 days before expiry. A lapsed CSID means your ERP cannot clear invoices — which means you cannot legally issue B2B invoices during the gap.
The teams that treat Phase 2 as a completed IT project are the ones filing amended VAT returns eighteen months from now. The teams that build recurring accountant-owned controls are the ones with clean audit files.
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.