Saudi Arabia ZATCA E-Invoice (FATOORA) Skill v1.0
General reference only. This skill is general tax/accounting reference material for AI-assisted workflows. It has not been reviewed for any specific person's facts, documents, elections, deadlines, residency, filing status, or local procedures. Do not rely on it to file, pay, amend, or take a tax position without review by a qualified professional in the relevant jurisdiction.
Section 1 -- Quick Reference
| Field |
Value |
| Country |
Kingdom of Saudi Arabia (KSA) |
| Currency |
SAR (Saudi Riyal) |
| E-Invoicing System |
FATOORA Platform |
| Governing Body |
Zakat, Tax and Customs Authority (ZATCA) |
| Key Legislation |
E-Invoicing Regulation (issued 4 December 2021); VAT Implementing Regulations |
| Schema Standard |
UBL 2.1 (Universal Business Language) XML |
| Cryptographic Standard |
ECDSA secp256k1 digital signature |
| Phase 1 (Generation) |
Mandatory from 4 December 2021 (all VAT-registered taxpayers) |
| Phase 2 (Integration) |
Rolling waves from 1 January 2023, based on revenue thresholds |
| Current Status |
Phase 2 waves ongoing through 2026; smaller thresholds being added progressively |
| Portal |
fatoora.zatca.gov.sa |
Phase 2 Integration Waves
| Wave |
Effective Date |
Revenue Threshold |
| Wave 1 |
1 January 2023 |
> SAR 3 billion |
| Wave 2 |
1 July 2023 |
> SAR 500 million |
| Wave 3 |
1 October 2023 |
> SAR 250 million |
| Wave 4 |
1 November 2023 |
> SAR 150 million |
| Wave 5 |
1 December 2023 |
> SAR 100 million |
| Wave 6 |
1 March 2024 |
> SAR 70 million |
| Wave 7 |
1 June 2024 |
> SAR 50 million |
| Wave 8 |
1 October 2024 |
> SAR 40 million |
| Wave 9 |
1 December 2024 |
> SAR 30 million |
| Wave 10+ |
2025-2026 |
Progressively lower thresholds |
Section 2 -- Mandate Scope
Phase 1 -- Generation (All Taxpayers Since Dec 2021)
- ALL VAT-registered taxpayers in KSA
- Must generate e-invoices (and credit/debit notes) using a compliant electronic system
- Paper invoices no longer legally valid
- Basic QR code required on simplified (B2C) invoices
- No system-to-system integration required
Phase 2 -- Integration (Wave-Based)
- System must integrate with ZATCA's FATOORA platform via API
- Standard Tax Invoice (B2B): Must be cleared by ZATCA before delivery to buyer
- Simplified Tax Invoice (B2C): Must be reported to ZATCA within 24 hours
- Cryptographic stamp (digital signature) required on all invoices
- Enhanced QR code with TLV-encoded cryptographic data
Document Types
| Type |
Code |
SubType Code |
Clearance Model |
| Standard Tax Invoice (B2B) |
388 |
0100000 |
Real-time clearance (before sharing with buyer) |
| Simplified Tax Invoice (B2C) |
388 |
0200000 |
Near-real-time reporting (within 24 hours) |
| Standard Credit Note |
381 |
0100000 |
Clearance |
| Simplified Credit Note |
381 |
0200000 |
Reporting |
| Standard Debit Note |
383 |
0100000 |
Clearance |
| Simplified Debit Note |
383 |
0200000 |
Reporting |
Exemptions
- None for Phase 1 — all VAT-registered taxpayers must comply
- Phase 2 integration is wave-based by revenue; ZATCA notifies targeted groups 6 months in advance
Section 3 -- Technical Format
XML Specification
| Aspect |
Detail |
| Format |
XML |
| Standard |
UBL 2.1 (ISO/IEC 19845:2015) |
| Root Element |
<Invoice> or <CreditNote> or <DebitNote> |
| Namespace (UBL) |
urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 |
| Namespace (cac) |
urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 |
| Namespace (cbc) |
urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 |
| Namespace (ext) |
urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2 |
| CIUS |
ZATCA Saudi Arabia CIUS (country-specific extensions within UBL) |
| Encoding |
UTF-8 |
Cryptographic Requirements (Phase 2)
| Component |
Specification |
| Signing Algorithm |
ECDSA with secp256k1 curve |
| Hash Algorithm |
SHA-256 |
| Certificate |
X.509 issued by ZATCA via CSR/CSID process |
| Invoice Hash |
Base64-encoded SHA-256 of canonical XML (before signing) |
| Previous Invoice Hash |
Hash of the previously issued invoice (chain integrity) |
| UUID |
RFC 4122 v4 (randomly generated 128-bit identifier per document) |
QR Code Structure (Phase 2)
TLV (Tag-Length-Value) encoding with Base64:
| Tag |
Field |
Data Type |
| 1 |
Seller Name |
UTF-8 String |
| 2 |
VAT Registration Number |
UTF-8 String |
| 3 |
Invoice Timestamp |
ISO 8601 (YYYY-MM-DDThh:mm:ssZ) |
| 4 |
Invoice Total (with VAT) |
Decimal String |
| 5 |
VAT Amount |
Decimal String |
| 6 |
Invoice Hash (SHA-256) |
Base64 |
| 7 |
ECDSA Signature |
Base64 |
| 8 |
Public Key |
Base64 (DER-encoded) |
| 9 |
Certificate Signature |
Base64 |
Section 4 -- Mandatory Fields
Invoice-Level Fields
| UBL Path |
Description |
Example |
| cbc:ID |
Invoice number |
INV-2026-001 |
| cbc:UUID |
RFC 4122 UUID |
8d487816-... |
| cbc:IssueDate |
Issue date |
2026-05-22 |
| cbc:IssueTime |
Issue time |
14:30:00 |
| cbc:InvoiceTypeCode |
Document type |
388 |
| cbc:InvoiceTypeCode/@name |
SubType code |
0100000 (standard) or 0200000 (simplified) |
| cbc:DocumentCurrencyCode |
Currency |
SAR |
| cbc:TaxCurrencyCode |
Tax currency |
SAR |
| cac:AdditionalDocumentReference (ICV) |
Invoice Counter Value |
Sequential integer |
| cac:AdditionalDocumentReference (PIH) |
Previous Invoice Hash |
Base64 SHA-256 |
Supplier (cac:AccountingSupplierParty)
| Path |
Description |
| cac:Party/cac:PartyIdentification/cbc:ID (@schemeID="CRN") |
Commercial Registration Number |
| cac:Party/cac:PartyTaxScheme/cbc:CompanyID |
VAT Registration Number (15 digits) |
| cac:Party/cac:PartyLegalEntity/cbc:RegistrationName |
Legal name (Arabic required) |
| cac:Party/cac:PostalAddress/cbc:StreetName |
Street |
| cac:Party/cac:PostalAddress/cbc:BuildingNumber |
Building number |
| cac:Party/cac:PostalAddress/cbc:CityName |
City |
| cac:Party/cac:PostalAddress/cbc:PostalZone |
Postal code |
| cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode |
SA |
Buyer (cac:AccountingCustomerParty) — Standard Invoice
| Path |
Description |
| cac:Party/cac:PartyTaxScheme/cbc:CompanyID |
Buyer VAT number |
| cac:Party/cac:PartyLegalEntity/cbc:RegistrationName |
Buyer legal name |
| cac:Party/cac:PostalAddress |
Full address (street, city, postal code) |
Tax Total (cac:TaxTotal)
| Path |
Description |
| cbc:TaxAmount |
Total VAT amount |
| cac:TaxSubtotal/cbc:TaxableAmount |
Taxable amount per rate |
| cac:TaxSubtotal/cbc:TaxAmount |
Tax amount per rate |
| cac:TaxSubtotal/cac:TaxCategory/cbc:ID |
Tax category (S, Z, E, O) |
| cac:TaxSubtotal/cac:TaxCategory/cbc:Percent |
VAT rate (15, 0, etc.) |
Line Items (cac:InvoiceLine)
| Path |
Description |
| cbc:ID |
Line number |
| cbc:InvoicedQuantity |
Quantity |
| cbc:LineExtensionAmount |
Line net amount |
| cac:Item/cbc:Name |
Item name |
| cac:Item/cac:ClassifiedTaxCategory/cbc:ID |
Tax category |
| cac:Item/cac:ClassifiedTaxCategory/cbc:Percent |
VAT rate |
| cac:Price/cbc:PriceAmount |
Unit price |
Section 5 -- Transmission Method
Onboarding Process
- Register on FATOORA portal (fatoora.zatca.gov.sa) using ZATCA credentials
- Generate OTP (One-Time Password) per EGS device
- EGS generates ECDSA private key (secp256k1) and Certificate Signing Request (CSR)
- Submit CSR + OTP to Compliance CSID API → receive Compliance CSID (temporary certificate)
- Run 3 compliance checks (standard invoice, simplified invoice, credit note)
- Submit compliance check results → receive Production CSID (permanent certificate)
- Begin production clearance/reporting
API Endpoints
| Endpoint |
Method |
Purpose |
| /compliance |
POST |
Onboarding — get Compliance CSID |
| /production/csids |
POST |
Get Production CSID |
| /compliance/invoices |
POST |
Submit compliance test invoices |
| /invoices/clearance |
POST |
Clear standard (B2B) invoices |
| /invoices/reporting |
POST |
Report simplified (B2C) invoices |
Production Base URL
https://gw-fatoora.zatca.gov.sa/e-invoicing/developer-portal
Authentication
- HTTP Basic Auth using Base64-encoded
{CSID_binary_token}:{secret}
- Each EGS device has its own certificate and credentials
- Certificate renewal required before expiry
Section 6 -- Validation Rules
ZATCA Server-Side Validation
- XML schema validation against UBL 2.1 + ZATCA CIUS
- Cryptographic signature verification (ECDSA secp256k1)
- Certificate chain validation (must be ZATCA-issued)
- Invoice hash verification (SHA-256 of canonical form)
- Previous invoice hash chain integrity
- UUID uniqueness check
- Invoice Counter Value (ICV) sequence validation
- Tax calculation verification (line totals, tax amounts)
- Seller VAT number validity
- Buyer VAT number validity (standard invoices)
Common Rejection Reasons
| Code |
Description |
Resolution |
| INVALID-SIGNATURE |
Signature verification failed |
Regenerate signature with correct private key |
| INVALID-CERTIFICATE |
Certificate not issued by ZATCA |
Re-onboard the EGS device |
| DUPLICATE-UUID |
UUID already submitted |
Generate new UUID per RFC 4122 |
| INVALID-HASH |
Invoice hash does not match content |
Recompute SHA-256 on canonical XML |
| PIH-MISMATCH |
Previous invoice hash incorrect |
Use hash of actual last invoice |
| TAX-CALC-ERROR |
Tax amounts do not compute |
Verify: TaxAmount = TaxableAmount × Rate |
| MISSING-FIELD |
Required field absent |
Add missing UBL element |
Validation Statuses
| Status |
Meaning |
| CLEARED |
Standard invoice accepted (can share with buyer) |
| REPORTED |
Simplified invoice acknowledged |
| REJECTED |
Validation failed — must fix and resubmit |
| WARNING |
Non-blocking issue — invoice accepted but flagged |
Section 7 -- Tax Computation Rules
VAT Rates in KSA
| Category |
Code |
Rate |
Description |
| Standard |
S |
15% |
Default rate |
| Zero-rated |
Z |
0% |
Exports, international transport |
| Exempt |
E |
0% |
Financial services, residential rent |
| Out of scope |
O |
0% |
Government services |
Calculation Rules
- Line Extension Amount = Quantity × Unit Price - Discount
- Tax Amount per line = Line Extension Amount × Tax Rate / 100
- Rounding: 2 decimal places (round half-up)
- Document-level TaxTotal must equal sum of all line tax amounts (tolerance: SAR 0.01)
- TaxInclusiveAmount = TaxExclusiveAmount + TaxTotal
Multi-Rate Invoice
- Each line item carries its own TaxCategory and Percent
- TaxTotal contains multiple TaxSubtotal elements (one per distinct rate)
- Each TaxSubtotal aggregates TaxableAmount and TaxAmount for that rate
Section 8 -- Archiving Requirements
| Requirement |
Detail |
| Retention Period |
Minimum 6 years from end of tax period (VAT Implementing Regulations Art. 66) |
| Format |
Original XML (signed) + ZATCA response |
| Digital Signature |
Must retain the signed XML with embedded UBL Extensions containing the signature |
| Integrity |
Invoice hash chain provides tamper evidence |
| Medium |
Electronic storage; must be accessible on demand by ZATCA |
| QR Code |
Physical/PDF copies must display the complete TLV QR code |
| Language |
Arabic required for invoice content; bilingual (Arabic + English) permitted |
Section 9 -- Penalties for Non-Compliance
| Violation |
Penalty (SAR) |
| Not issuing e-invoices |
5,000 -- 50,000 per violation |
| Not including required fields |
5,000 -- 50,000 per violation |
| Not integrating with FATOORA (Phase 2) |
5,000 -- 50,000 per violation |
| Deleting or modifying e-invoices after issuance |
10,000 -- 50,000 per violation |
| Not storing e-invoices per requirements |
5,000 -- 50,000 per violation |
| Obstructing ZATCA officials |
5,000 -- 50,000 per violation |
| Repeated violations |
Penalty doubled; potential business suspension |
ZATCA may also publish violator names publicly and may suspend tax registration for severe/repeated non-compliance.
Section 10 -- Interaction with Tax Skills
VAT Return Integration
- Cleared B2B invoices feed directly into ZATCA's VAT return pre-population
- Reported B2C invoices aggregated for VAT return box totals
- VAT return data (Box 1: standard-rated sales, Box 2: zero-rated, etc.) can be cross-referenced against FATOORA submission records
- Discrepancies between submitted e-invoices and VAT return values trigger ZATCA risk-assessment flags
Credit Note Handling
- Credit notes must reference the original invoice UUID
- Tax adjustments in VAT return derived from cleared credit notes
- ZATCA validates that credit note does not exceed original invoice value
Withholding Tax
- If withholding tax applies (certain services), the invoice must still show full VAT amount
- Withholding is a separate mechanism; e-invoice shows gross amounts
Audit Trail
- ZATCA maintains complete record of all cleared/reported invoices
- Taxpayer's records must match ZATCA's records exactly
- UUID + ICV provide unique identification for audit queries
Disclaimer
This skill and its outputs are provided for informational and computational purposes only and do not constitute tax, legal, or financial advice. Open Accountants and its contributors accept no liability for any errors, omissions, or outcomes arising from the use of this skill. All outputs must be reviewed and signed off by a qualified professional (such as a CPA, SOCPA member, or equivalent licensed practitioner in your jurisdiction) before filing or acting upon.
The most up-to-date, verified version of this skill is maintained at openaccountants.com.
Source: OpenAccountants — open tax Guides for AI, reviewed by named CPAs/CAs/EAs. Quality: source-cited draft. For always-current figures and named-accountant backing, connect the OpenAccountants MCP server (openaccountants-mcp).
1---2name: saudi-einvoice3description: > Use this skill whenever asked about Saudi Arabia e-invoicing, ZATCA FATOORA platform, Phase 1 generation, Phase 2 integration, e-invoice clearance, e-invoice reporting, ZATCA API, UBL 2.1 XML for Saudi invoices, cryptographic stamp, QR code TLV encoding, ECDSA signing, CSID certificate, onboarding OTP, Simplified vs Standard tax invoice, B2B clearance, B2C reporting, or any question about generating, submitting, or troubleshooting Saudi e-invoices. Also trigger when advising on ZATCA compliance waves, XML structure, digital signature requirements, or integration architecture. ALWAYS read this skill before touching any Saudi e-invoice work.4license: AGPL-3.0-or-later (code) / OpenAccountants Guide License v1.0 (c5---67# Saudi Arabia ZATCA E-Invoice (FATOORA) Skill v1.089> **General reference only.** This skill is general tax/accounting reference material for AI-assisted workflows. It has not been reviewed for any specific person's facts, documents, elections, deadlines, residency, filing status, or local procedures. Do not rely on it to file, pay, amend, or take a tax position without review by a qualified professional in the relevant jurisdiction.1011---1213## Section 1 -- Quick Reference1415| Field | Value |16|---|---|17| Country | Kingdom of Saudi Arabia (KSA) |18| Currency | SAR (Saudi Riyal) |19| E-Invoicing System | FATOORA Platform |20| Governing Body | Zakat, Tax and Customs Authority (ZATCA) |21| Key Legislation | E-Invoicing Regulation (issued 4 December 2021); VAT Implementing Regulations |22| Schema Standard | UBL 2.1 (Universal Business Language) XML |23| Cryptographic Standard | ECDSA secp256k1 digital signature |24| Phase 1 (Generation) | Mandatory from 4 December 2021 (all VAT-registered taxpayers) |25| Phase 2 (Integration) | Rolling waves from 1 January 2023, based on revenue thresholds |26| Current Status | Phase 2 waves ongoing through 2026; smaller thresholds being added progressively |27| Portal | fatoora.zatca.gov.sa |2829### Phase 2 Integration Waves3031| Wave | Effective Date | Revenue Threshold |32|---|---|---|33| Wave 1 | 1 January 2023 | > SAR 3 billion |34| Wave 2 | 1 July 2023 | > SAR 500 million |35| Wave 3 | 1 October 2023 | > SAR 250 million |36| Wave 4 | 1 November 2023 | > SAR 150 million |37| Wave 5 | 1 December 2023 | > SAR 100 million |38| Wave 6 | 1 March 2024 | > SAR 70 million |39| Wave 7 | 1 June 2024 | > SAR 50 million |40| Wave 8 | 1 October 2024 | > SAR 40 million |41| Wave 9 | 1 December 2024 | > SAR 30 million |42| Wave 10+ | 2025-2026 | Progressively lower thresholds |4344---4546## Section 2 -- Mandate Scope4748### Phase 1 -- Generation (All Taxpayers Since Dec 2021)4950- ALL VAT-registered taxpayers in KSA51- Must generate e-invoices (and credit/debit notes) using a compliant electronic system52- Paper invoices no longer legally valid53- Basic QR code required on simplified (B2C) invoices54- No system-to-system integration required5556### Phase 2 -- Integration (Wave-Based)5758- System must integrate with ZATCA's FATOORA platform via API59- **Standard Tax Invoice (B2B)**: Must be cleared by ZATCA before delivery to buyer60- **Simplified Tax Invoice (B2C)**: Must be reported to ZATCA within 24 hours61- Cryptographic stamp (digital signature) required on all invoices62- Enhanced QR code with TLV-encoded cryptographic data6364### Document Types6566| Type | Code | SubType Code | Clearance Model |67|---|---|---|---|68| Standard Tax Invoice (B2B) | 388 | 0100000 | Real-time clearance (before sharing with buyer) |69| Simplified Tax Invoice (B2C) | 388 | 0200000 | Near-real-time reporting (within 24 hours) |70| Standard Credit Note | 381 | 0100000 | Clearance |71| Simplified Credit Note | 381 | 0200000 | Reporting |72| Standard Debit Note | 383 | 0100000 | Clearance |73| Simplified Debit Note | 383 | 0200000 | Reporting |7475### Exemptions7677- None for Phase 1 — all VAT-registered taxpayers must comply78- Phase 2 integration is wave-based by revenue; ZATCA notifies targeted groups 6 months in advance7980---8182## Section 3 -- Technical Format8384### XML Specification8586| Aspect | Detail |87|---|---|88| Format | XML |89| Standard | UBL 2.1 (ISO/IEC 19845:2015) |90| Root Element | `<Invoice>` or `<CreditNote>` or `<DebitNote>` |91| Namespace (UBL) | urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 |92| Namespace (cac) | urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 |93| Namespace (cbc) | urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 |94| Namespace (ext) | urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2 |95| CIUS | ZATCA Saudi Arabia CIUS (country-specific extensions within UBL) |96| Encoding | UTF-8 |9798### Cryptographic Requirements (Phase 2)99100| Component | Specification |101|---|---|102| Signing Algorithm | ECDSA with secp256k1 curve |103| Hash Algorithm | SHA-256 |104| Certificate | X.509 issued by ZATCA via CSR/CSID process |105| Invoice Hash | Base64-encoded SHA-256 of canonical XML (before signing) |106| Previous Invoice Hash | Hash of the previously issued invoice (chain integrity) |107| UUID | RFC 4122 v4 (randomly generated 128-bit identifier per document) |108109### QR Code Structure (Phase 2)110111TLV (Tag-Length-Value) encoding with Base64:112113| Tag | Field | Data Type |114|---|---|---|115| 1 | Seller Name | UTF-8 String |116| 2 | VAT Registration Number | UTF-8 String |117| 3 | Invoice Timestamp | ISO 8601 (YYYY-MM-DDThh:mm:ssZ) |118| 4 | Invoice Total (with VAT) | Decimal String |119| 5 | VAT Amount | Decimal String |120| 6 | Invoice Hash (SHA-256) | Base64 |121| 7 | ECDSA Signature | Base64 |122| 8 | Public Key | Base64 (DER-encoded) |123| 9 | Certificate Signature | Base64 |124125---126127## Section 4 -- Mandatory Fields128129### Invoice-Level Fields130131| UBL Path | Description | Example |132|---|---|---|133| cbc:ID | Invoice number | INV-2026-001 |134| cbc:UUID | RFC 4122 UUID | 8d487816-... |135| cbc:IssueDate | Issue date | 2026-05-22 |136| cbc:IssueTime | Issue time | 14:30:00 |137| cbc:InvoiceTypeCode | Document type | 388 |138| cbc:InvoiceTypeCode/@name | SubType code | 0100000 (standard) or 0200000 (simplified) |139| cbc:DocumentCurrencyCode | Currency | SAR |140| cbc:TaxCurrencyCode | Tax currency | SAR |141| cac:AdditionalDocumentReference (ICV) | Invoice Counter Value | Sequential integer |142| cac:AdditionalDocumentReference (PIH) | Previous Invoice Hash | Base64 SHA-256 |143144### Supplier (cac:AccountingSupplierParty)145146| Path | Description |147|---|---|148| cac:Party/cac:PartyIdentification/cbc:ID (@schemeID="CRN") | Commercial Registration Number |149| cac:Party/cac:PartyTaxScheme/cbc:CompanyID | VAT Registration Number (15 digits) |150| cac:Party/cac:PartyLegalEntity/cbc:RegistrationName | Legal name (Arabic required) |151| cac:Party/cac:PostalAddress/cbc:StreetName | Street |152| cac:Party/cac:PostalAddress/cbc:BuildingNumber | Building number |153| cac:Party/cac:PostalAddress/cbc:CityName | City |154| cac:Party/cac:PostalAddress/cbc:PostalZone | Postal code |155| cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode | SA |156157### Buyer (cac:AccountingCustomerParty) — Standard Invoice158159| Path | Description |160|---|---|161| cac:Party/cac:PartyTaxScheme/cbc:CompanyID | Buyer VAT number |162| cac:Party/cac:PartyLegalEntity/cbc:RegistrationName | Buyer legal name |163| cac:Party/cac:PostalAddress | Full address (street, city, postal code) |164165### Tax Total (cac:TaxTotal)166167| Path | Description |168|---|---|169| cbc:TaxAmount | Total VAT amount |170| cac:TaxSubtotal/cbc:TaxableAmount | Taxable amount per rate |171| cac:TaxSubtotal/cbc:TaxAmount | Tax amount per rate |172| cac:TaxSubtotal/cac:TaxCategory/cbc:ID | Tax category (S, Z, E, O) |173| cac:TaxSubtotal/cac:TaxCategory/cbc:Percent | VAT rate (15, 0, etc.) |174175### Line Items (cac:InvoiceLine)176177| Path | Description |178|---|---|179| cbc:ID | Line number |180| cbc:InvoicedQuantity | Quantity |181| cbc:LineExtensionAmount | Line net amount |182| cac:Item/cbc:Name | Item name |183| cac:Item/cac:ClassifiedTaxCategory/cbc:ID | Tax category |184| cac:Item/cac:ClassifiedTaxCategory/cbc:Percent | VAT rate |185| cac:Price/cbc:PriceAmount | Unit price |186187---188189## Section 5 -- Transmission Method190191### Onboarding Process1921931. Register on FATOORA portal (fatoora.zatca.gov.sa) using ZATCA credentials1942. Generate OTP (One-Time Password) per EGS device1953. EGS generates ECDSA private key (secp256k1) and Certificate Signing Request (CSR)1964. Submit CSR + OTP to Compliance CSID API → receive Compliance CSID (temporary certificate)1975. Run 3 compliance checks (standard invoice, simplified invoice, credit note)1986. Submit compliance check results → receive Production CSID (permanent certificate)1997. Begin production clearance/reporting200201### API Endpoints202203| Endpoint | Method | Purpose |204|---|---|---|205| /compliance | POST | Onboarding — get Compliance CSID |206| /production/csids | POST | Get Production CSID |207| /compliance/invoices | POST | Submit compliance test invoices |208| /invoices/clearance | POST | Clear standard (B2B) invoices |209| /invoices/reporting | POST | Report simplified (B2C) invoices |210211### Production Base URL212213```214https://gw-fatoora.zatca.gov.sa/e-invoicing/developer-portal215```216217### Authentication218219- HTTP Basic Auth using Base64-encoded `{CSID_binary_token}:{secret}`220- Each EGS device has its own certificate and credentials221- Certificate renewal required before expiry222223---224225## Section 6 -- Validation Rules226227### ZATCA Server-Side Validation2282291. XML schema validation against UBL 2.1 + ZATCA CIUS2302. Cryptographic signature verification (ECDSA secp256k1)2313. Certificate chain validation (must be ZATCA-issued)2324. Invoice hash verification (SHA-256 of canonical form)2335. Previous invoice hash chain integrity2346. UUID uniqueness check2357. Invoice Counter Value (ICV) sequence validation2368. Tax calculation verification (line totals, tax amounts)2379. Seller VAT number validity23810. Buyer VAT number validity (standard invoices)239240### Common Rejection Reasons241242| Code | Description | Resolution |243|---|---|---|244| INVALID-SIGNATURE | Signature verification failed | Regenerate signature with correct private key |245| INVALID-CERTIFICATE | Certificate not issued by ZATCA | Re-onboard the EGS device |246| DUPLICATE-UUID | UUID already submitted | Generate new UUID per RFC 4122 |247| INVALID-HASH | Invoice hash does not match content | Recompute SHA-256 on canonical XML |248| PIH-MISMATCH | Previous invoice hash incorrect | Use hash of actual last invoice |249| TAX-CALC-ERROR | Tax amounts do not compute | Verify: TaxAmount = TaxableAmount × Rate |250| MISSING-FIELD | Required field absent | Add missing UBL element |251252### Validation Statuses253254| Status | Meaning |255|---|---|256| CLEARED | Standard invoice accepted (can share with buyer) |257| REPORTED | Simplified invoice acknowledged |258| REJECTED | Validation failed — must fix and resubmit |259| WARNING | Non-blocking issue — invoice accepted but flagged |260261---262263## Section 7 -- Tax Computation Rules264265### VAT Rates in KSA266267| Category | Code | Rate | Description |268|---|---|---|---|269| Standard | S | 15% | Default rate |270| Zero-rated | Z | 0% | Exports, international transport |271| Exempt | E | 0% | Financial services, residential rent |272| Out of scope | O | 0% | Government services |273274### Calculation Rules275276- Line Extension Amount = Quantity × Unit Price - Discount277- Tax Amount per line = Line Extension Amount × Tax Rate / 100278- Rounding: 2 decimal places (round half-up)279- Document-level TaxTotal must equal sum of all line tax amounts (tolerance: SAR 0.01)280- TaxInclusiveAmount = TaxExclusiveAmount + TaxTotal281282### Multi-Rate Invoice283284- Each line item carries its own TaxCategory and Percent285- TaxTotal contains multiple TaxSubtotal elements (one per distinct rate)286- Each TaxSubtotal aggregates TaxableAmount and TaxAmount for that rate287288---289290## Section 8 -- Archiving Requirements291292| Requirement | Detail |293|---|---|294| Retention Period | Minimum 6 years from end of tax period (VAT Implementing Regulations Art. 66) |295| Format | Original XML (signed) + ZATCA response |296| Digital Signature | Must retain the signed XML with embedded UBL Extensions containing the signature |297| Integrity | Invoice hash chain provides tamper evidence |298| Medium | Electronic storage; must be accessible on demand by ZATCA |299| QR Code | Physical/PDF copies must display the complete TLV QR code |300| Language | Arabic required for invoice content; bilingual (Arabic + English) permitted |301302---303304## Section 9 -- Penalties for Non-Compliance305306| Violation | Penalty (SAR) |307|---|---|308| Not issuing e-invoices | 5,000 -- 50,000 per violation |309| Not including required fields | 5,000 -- 50,000 per violation |310| Not integrating with FATOORA (Phase 2) | 5,000 -- 50,000 per violation |311| Deleting or modifying e-invoices after issuance | 10,000 -- 50,000 per violation |312| Not storing e-invoices per requirements | 5,000 -- 50,000 per violation |313| Obstructing ZATCA officials | 5,000 -- 50,000 per violation |314| Repeated violations | Penalty doubled; potential business suspension |315316ZATCA may also publish violator names publicly and may suspend tax registration for severe/repeated non-compliance.317318---319320## Section 10 -- Interaction with Tax Skills321322### VAT Return Integration323324- Cleared B2B invoices feed directly into ZATCA's VAT return pre-population325- Reported B2C invoices aggregated for VAT return box totals326- VAT return data (Box 1: standard-rated sales, Box 2: zero-rated, etc.) can be cross-referenced against FATOORA submission records327- Discrepancies between submitted e-invoices and VAT return values trigger ZATCA risk-assessment flags328329### Credit Note Handling330331- Credit notes must reference the original invoice UUID332- Tax adjustments in VAT return derived from cleared credit notes333- ZATCA validates that credit note does not exceed original invoice value334335### Withholding Tax336337- If withholding tax applies (certain services), the invoice must still show full VAT amount338- Withholding is a separate mechanism; e-invoice shows gross amounts339340### Audit Trail341342- ZATCA maintains complete record of all cleared/reported invoices343- Taxpayer's records must match ZATCA's records exactly344- UUID + ICV provide unique identification for audit queries345346---347348## Disclaimer349350This skill and its outputs are provided for informational and computational purposes only and do not constitute tax, legal, or financial advice. Open Accountants and its contributors accept no liability for any errors, omissions, or outcomes arising from the use of this skill. All outputs must be reviewed and signed off by a qualified professional (such as a CPA, SOCPA member, or equivalent licensed practitioner in your jurisdiction) before filing or acting upon.351352The most up-to-date, verified version of this skill is maintained at [openaccountants.com](https://openaccountants.com).353354---355356_Source: [OpenAccountants](https://openaccountants.com/skills/saudi-einvoice) — open tax Guides for AI, reviewed by named CPAs/CAs/EAs. Quality: **source-cited draft**. For always-current figures and named-accountant backing, connect the OpenAccountants MCP server (`openaccountants-mcp`)._