Flick.
ZATCA CompliantCountry guide

Saudi Arabia - eInvoicing Mandates

Complete guide to implementing ZATCA-compliant e-invoicing in Saudi Arabia. Our platform offers comprehensive tools for seamless integration, helping businesses achieve compliance with ease while streamlining their invoice management processes.

ZATCACompliant
Phase 2Ready
B2B/B2CSupported
Real-timeValidation

Reporting Mandates

  • Fatoora Phase 1
  • Fatoora Phase 2

Exchange Networks

  • E-Mail

Supported Documents

  • Commercial Invoices
  • Advance Invoice
  • Credit Notes
  • Debit Notes

Introduction to Saudi Arabia E-Invoicing

Saudi Arabia is one of the leading economies in the Middle East and a key member of the G20. As part of its ambitious Vision 2030 program, the Kingdom is driving digital transformation across all sectors, including tax administration and business operations. The Zakat, Tax and Customs Authority (ZATCA) has spearheaded the implementation of mandatory electronic invoicing under the Fatoorah program.

Key Authorities

AuthorityRoleResponsibilities
Zakat, Tax and Customs Authority (ZATCA)Primary regulatory body for e-invoicing• Developing and publishing e-invoicing technical standards and specifications
• Setting compliance requirements and enforcement
• Managing the phased rollout based on taxpayer revenue thresholds
• Operating the Fatoora Portal for clearance and reporting
• Issuing Cryptographic Stamp Identifiers (CSIDs) to compliant EGS devices

Website: zatca.gov.sa
Ministry of Finance (MoF)Fiscal policy and oversight• Setting overall tax policy direction
• Coordinating with ZATCA on VAT and e-invoicing regulations
• Overseeing revenue collection and fiscal compliance

Website: mof.gov.sa

Vision 2030 and Digital Transformation

The e-invoicing mandate is a central pillar of Saudi Arabia's Vision 2030 goals:

ObjectiveDescription
DigitizationModernize government and business processes through digital platforms
Economic DiversificationStrengthen non-oil revenue through improved VAT compliance
Tax ComplianceReduce the VAT gap and combat tax evasion through real-time transaction controls
Ease of BusinessStreamline invoicing and reduce manual paper-based processes
TransparencyEnable data-driven government decision-making with real-time economic data

E-Invoicing Overview

Saudi Arabia's e-invoicing system, known as Fatoorah (فاتورة), was introduced by ZATCA in two phases:

  • Phase 1 — Generation Phase (December 4, 2021): All VAT-registered taxpayers in the Kingdom were required to generate and store electronic invoices and related credit/debit notes using compliant e-invoicing solutions. No specific XML format was mandated, but invoices had to include QR codes (for B2C) and be generated electronically (not handwritten or scanned).

  • Phase 2 — Integration Phase (January 1, 2023 onwards): Taxpayers are required to integrate their E-Invoicing Generation Solutions (EGS) with ZATCA's Fatoora platform via API. B2B invoices must be cleared by ZATCA before being shared with the buyer, while B2C invoices must be reported to ZATCA within 24 hours. This phase introduced the Continuous Transaction Controls (CTC) model with mandatory UBL 2.1 XML format, cryptographic stamping, and certificate-based authentication. The rollout is happening in waves based on annual revenue thresholds, gradually expanding from the largest enterprises down to smaller businesses.


For official updates and detailed information, please refer to the ZATCA e-invoicing portal.

Saudi Arabia E-Invoicing and Fiscalization Mandates

Saudi Arabia has implemented one of the most comprehensive e-invoicing mandates in the Middle East through ZATCA's Fatoorah program. This section outlines the mandate requirements affecting businesses operating in the Kingdom.

ZATCA Fatoorah eInvoicing

The Zakat, Tax and Customs Authority (ZATCA) introduced the Fatoorah (فاتورة) electronic invoicing mandate in two phases, establishing a Continuous Transaction Controls (CTC) system for real-time tax compliance.

What is Fatoorah?

Fatoorah is Saudi Arabia's mandatory e-invoicing system that requires businesses to generate, transmit, and store electronic invoices and related documents (credit/debit notes) through ZATCA-compliant solutions. In Phase 2, all invoices must be processed through ZATCA's Fatoora Portal via API before being shared with customers.

Regulatory Framework

ComponentDetails
Issuing AuthorityZakat, Tax and Customs Authority (ZATCA)
Program NameFatoorah (فاتورة)
StandardUBL 2.1 XML
ModelContinuous Transaction Controls (CTC)
Phase 1Generation Phase — December 4, 2021
Phase 2Integration Phase — January 1, 2023 (rolling waves)

Who Must Comply?

CategoryScope
Business TypeAll VAT-registered taxpayers in Saudi Arabia
Resident EntitiesAll resident taxable persons subject to VAT
Transaction TypesB2B (Business-to-Business), B2C (Business-to-Consumer), B2G (Business-to-Government)
RolloutPhased by annual revenue — from SAR 3 billion (Wave 1) down to SAR 2.5 million

How It Works

The Saudi e-invoicing system operates through a CTC clearance and reporting model:

TransactionProcessFlow
B2B / B2GClearanceInvoice is sent to ZATCA's Fatoora Portal for validation and clearance before delivery to the buyer
B2CReportingInvoice is generated locally and reported to ZATCA within 24 hours after issuance

Both models require the use of an E-Invoicing Generation Solution (EGS) — a hardware or software system registered with ZATCA that generates cryptographically stamped invoices.

Document Types

The mandate covers several types of electronic documents:

Document TypeCodeDescription
Tax Invoice388Standard invoice for regular taxable supplies
Advance Invoice386Invoice issued for advance payments before delivery of goods/services
Credit Note381Adjusts or corrects a previously issued invoice (reduces amount)
Debit Note383Adjusts a previously issued invoice (increases amount)

Each document type can be issued as either:

  • Standard (standard) — For B2B/B2G transactions, requires ZATCA clearance
  • Simplified (simplified) — For B2C transactions, requires ZATCA reporting

Key Requirements

To comply with the ZATCA Fatoorah mandate, businesses must:

#RequirementDescription
1Compliant EGSUse an E-Invoicing Generation Solution registered with ZATCA
2ZATCA CertificatesObtain Compliance and Production CSIDs from the Fatoora Portal
3UBL 2.1 XML FormatAll invoices must be in the prescribed XML format
4Cryptographic StampingEvery invoice must be digitally signed with the ZATCA-issued certificate
5QR CodesSimplified (B2C) invoices must include TLV-encoded QR codes
6Real-time IntegrationB2B invoices cleared via API; B2C invoices reported via API

VAT Categories

Saudi Arabia supports four VAT categories for line items:

CategoryCodeDescriptionTax Rate
Standard RatedSStandard VAT rate applies15%
Zero RatedZ0% VAT rate for specific supplies (exports, medicines, etc.)0%
ExemptEExempt from VAT (financial services, real estate, etc.)N/A
Out of ScopeONot subject to VATN/A

Implementation

Businesses should take the following steps to comply with the Fatoorah mandate:

StepActionPurpose
1. Assess ReadinessDetermine which Phase 2 wave applies based on annual revenueUnderstand your compliance timeline
2. Select an EGSChoose a compliant E-Invoicing Generation Solution or API providerEnsure technical compliance
3. Register EGSOnboard your EGS devices with ZATCA's Fatoora PortalObtain Compliance CSID
4. Complete CompliancePass ZATCA's compliance checks to obtain Production CSIDActivate production clearance
5. Go LiveBegin clearing B2B invoices and reporting B2C invoicesAchieve full compliance
6. MonitorTrack clearance status and handle rejectionsMaintain ongoing compliance

For official compliance timelines and wave schedules, refer to the ZATCA e-invoicing portal.

ZATCA Fatoorah E-Invoicing with Flick

The ZATCA Fatoorah Phase 2 system requires businesses to integrate their invoicing solutions with ZATCA's Fatoora Portal for real-time clearance and reporting of electronic invoices.

What is ZATCA Phase 2?

Phase 2 (Integration Phase) of the Fatoorah mandate requires all applicable VAT-registered taxpayers to connect their E-Invoicing Generation Solutions (EGS) to ZATCA's Fatoora platform via API. This enables:

  • B2B/B2G Clearance: Standard tax invoices must be submitted to ZATCA and cleared before delivery to the buyer
  • B2C Reporting: Simplified tax invoices are reported to ZATCA within 24 hours of issuance
  • Cryptographic Stamping: Every invoice is digitally signed using ZATCA-issued certificates

The Clearance and Reporting Model

ZATCA's system uses a Continuous Transaction Controls (CTC) model with two distinct flows depending on the transaction type:

FlowInvoice TypeTransactionProcess
ClearanceStandard (standard)B2B / B2GInvoice is sent to ZATCA → validated → cryptographically stamped → returned with QR code → then shared with buyer
ReportingSimplified (simplified)B2CInvoice is generated locally with QR code → issued to buyer → reported to ZATCA within 24 hours

Clearance Flow (B2B/B2G)

  1. EGS generates the invoice in UBL 2.1 XML format
  2. Invoice is digitally signed with the Production CSID
  3. Invoice is submitted to ZATCA's Fatoora Portal via API
  4. ZATCA validates the invoice against business rules
  5. If valid, ZATCA returns the cleared invoice with a cryptographic stamp and QR code
  6. The cleared invoice is delivered to the buyer

Reporting Flow (B2C)

  1. EGS generates the simplified invoice in UBL 2.1 XML format
  2. Invoice is digitally signed with the Production CSID
  3. QR code is generated locally using TLV encoding
  4. Invoice is issued to the customer immediately
  5. Invoice data is reported to ZATCA via API within 24 hours

E-Invoicing Generation Solution (EGS)

An EGS is any hardware or software system used to generate electronic invoices. Each EGS device must be individually registered with ZATCA's Fatoora Portal and assigned its own cryptographic certificates.

EGS Requirements

RequirementDescription
Device RegistrationEach EGS must be onboarded with ZATCA via the Fatoora Portal
OTP VerificationA 6-digit OTP from the Fatoora Portal is required during onboarding
Compliance CSIDIssued after onboarding — used for compliance testing
Production CSIDIssued after passing compliance checks — used for live invoicing
Branch AssociationEach EGS is linked to a specific branch/location
Certificate RenewalCertificates must be renewed before expiry

EGS Integration Lifecycle

The full lifecycle from device registration through to live invoice generation:

StepEndpointDescription
1. OnboardPOST /egs/onboardRegister device(s) with ZATCA — provides device details, location, and OTP. Returns a Compliance CSID (CCSID).
2. Compliance CheckGET /egs/compliance-check/{uuid}Run ZATCA compliance checks using the CCSID. If all checks pass, a Production CSID (PCSID) is issued.
3. Generate & Clear/ReportPOST /api/einvoice/generate/invoiceGenerate invoices using the PCSID. B2B invoices are cleared; B2C invoices are reported.
4. Report B2CPOST /api/einvoice/reportExplicitly report simplified (B2C) invoices to ZATCA.

Invoice Types

ZATCA defines two invoice types based on the transaction:

Standard Tax Invoice (B2B/B2G)

AttributeDetails
inv_typestandard
Buyer InfoRequired — full party details including VAT number and address
ZATCA ProcessClearance (must be approved before delivery)
QR CodeGenerated by ZATCA during clearance
Use CasesB2B supplies, government contracts, inter-company transactions

Simplified Tax Invoice (B2C)

AttributeDetails
inv_typesimplified
Buyer InfoOptional — buyer details not required
ZATCA ProcessReporting (reported after issuance)
QR CodeGenerated locally by the EGS using TLV encoding
Use CasesPoint-of-sale, retail, consumer transactions

Document Type Codes

CodeDocument TypeDescription
388Tax InvoiceStandard invoice for taxable supplies
386Advance InvoiceInvoice for advance payments
381Credit NoteReduces amount of a previously issued invoice
383Debit NoteIncreases amount of a previously issued invoice

Key Components

Cryptographic Stamp Identifier (CSID)

ZATCA issues digital certificates to each registered EGS device:

  • Compliance CSID (CCSID): Temporary certificate issued during onboarding, used to complete compliance checks
  • Production CSID (PCSID): Permanent certificate issued after passing compliance, used for live invoice signing

QR Code (TLV Encoding)

Phase 2 invoices require QR codes encoded using Tag-Length-Value (TLV) format containing:

  1. Seller name (Arabic)
  2. VAT registration number
  3. Invoice timestamp (ISO 8601)
  4. Invoice total (including VAT)
  5. VAT amount
  6. Invoice hash (Phase 2 only)
  7. Digital signature (Phase 2 only)
  8. Public key (Phase 2 only)
  9. Certificate signature (Phase 2 only)

Standards and Format

StandardSpecification
XML FormatUBL 2.1 (Universal Business Language)
EncodingUTF-8
SigningX.509 certificates issued by ZATCA
Hash AlgorithmSHA-256
CurrencySAR (default), other currencies supported with exchange rate
QR EncodingTLV (Tag-Length-Value), Base64 encoded
NetworkZATCA Fatoora Portal API

For detailed API integration steps and code samples, refer to the eInvoicing Lifecycle and Examples sections.

ZATCA Invoice Datapoints

These are the datapoints used in the ZATCA e-invoicing API for generating and reporting invoices in Saudi Arabia.

Top-Level Invoice Fields

invoice_ref_number

Requirement: Mandatory
Type: String

Unique Invoice Reference Number. Must be sequential within your system.

Regional API

JSON
{
  "invoice_ref_number": "INV-4"
}

Rules:

  • Must be unique within the EGS device
  • Should follow a sequential pattern
  • Can include alphanumeric characters and hyphens

issue_date

Requirement: Mandatory
Type: Date (YYYY-MM-DD)

The date on which the invoice was issued.

Regional API

JSON
{
  "issue_date": "2024-02-01"
}

Rules:

  • Must be in ISO 8601 format: YYYY-MM-DD
  • Cannot be a future date

issue_time

Requirement: Mandatory
Type: Time (HH:MM:SS)

The time at which the invoice was issued.

Regional API

JSON
{
  "issue_time": "01:40:40"
}

Rules:

  • Must be in 24-hour format: HH:MM:SS

doc_type

Requirement: Mandatory
Type: String

Specifies the type of document being issued.

Regional API

JSON
{
  "doc_type": "388"
}

Allowed Values:

CodeDescription
388Tax Invoice — standard invoice for taxable supplies
386Advance Invoice — invoice for advance payments
381Credit Note — reduces amount of a previously issued invoice
383Debit Note — increases amount of a previously issued invoice

inv_type

Requirement: Mandatory
Type: String

Specifies whether this is a B2B or B2C invoice.

Regional API

JSON
{
  "inv_type": "standard"
}

Allowed Values:

ValueDescriptionZATCA Process
standardB2B/B2G tax invoiceClearance (must be approved by ZATCA before delivery)
simplifiedB2C tax invoiceReporting (reported to ZATCA after issuance)

currency

Requirement: Optional
Type: String
Default: SAR

The currency in which the invoice was issued.

Regional API

JSON
{
  "currency": "USD"
}

Rules:

  • Must be a valid ISO 4217 currency code
  • Default value is SAR
  • If currency is not SAR, currency_exchange_rate must be provided

currency_exchange_rate

Requirement: Conditional
Type: Float

Exchange rate to SAR for the tax amount. Required when currency is not SAR.

Regional API

JSON
{
  "currency": "USD",
  "currency_exchange_rate": 3.75
}

Rules:

  • Required when currency is not SAR
  • Represents the rate to convert 1 unit of the invoice currency to SAR

is_export

Requirement: Optional
Type: Boolean
Default: false

Indicates if this is an export transaction.


is_b2g

Requirement: Optional
Type: Boolean
Default: false

Indicates if this is a Business-to-Government (B2G) transaction.


is_thirdparty

Requirement: Optional
Type: Boolean
Default: false

Indicates if this is a third-party transaction.


is_nominal

Requirement: Optional
Type: Boolean
Default: false

Indicates if this is a nominal transaction.


is_summary

Requirement: Optional
Type: Boolean
Default: false

Indicates if this is a summary invoice.


is_selfbilled

Requirement: Optional
Type: Boolean
Default: false

Indicates if this is a self-billed invoice.


Party Details — party_details

Contains information about the customer (buyer) to whom the invoice is being issued.

party_name_ar

Requirement: Mandatory
Type: String

The name of the customer in Arabic.

Regional API

JSON
{
  "party_details": {
    "party_name_ar": "شركة اختبار"
  }
}

party_name_en

Requirement: Optional
Type: String

The name of the customer in English.

Regional API

JSON
{
  "party_details": {
    "party_name_en": "Test Company"
  }
}

party_vat

Requirement: Mandatory
Type: String

The VAT Registration number for the customer.

Regional API

JSON
{
  "party_details": {
    "party_vat": "301121921500003"
  }
}

Rules:

  • 15-digit number
  • Starts and ends with 3

city_ar

Requirement: Mandatory
Type: String

Customer's city name in Arabic.


city_en

Requirement: Optional
Type: String

Customer's city name in English.


city_subdivision_ar

Requirement: Mandatory
Type: String

Customer's district or subdivision in Arabic.


city_subdivision_en

Requirement: Optional
Type: String

Customer's district or subdivision in English.


street_ar

Requirement: Mandatory
Type: String

Customer's street address in Arabic.


street_en

Requirement: Optional
Type: String

Customer's street address in English.


postal_zone

Requirement: Mandatory
Type: String

5-digit postal zone or ZIP code for the customer's location.


plot

Requirement: Optional
Type: String

4-digit plot identification number for the customer's location.


building

Requirement: Optional
Type: String

4-digit building number for the customer's location.


country

Requirement: Conditional
Type: String (ISO 3166-1 alpha-2)

Two-letter country code of the buyer. Defaults to SA if not provided. Mandatory for export invoices (is_export: true) or when the buyer is located outside Saudi Arabia.

Regional API

JSON
{
  "party_details": {
    "country": "AE"
  }
}

party_add_id

Requirement: Optional
Type: Key-Value Object

Additional party identification. Can include IDs such as:

KeyDescription
tinTax Identification Number
crnCommercial Registration Number
momMomra License
mlsMLSD License
sagSagia License
natNational ID
gccGCC ID
iqaIqama Number
othOther
700ID 700

Regional API

JSON
{
  "party_details": {
    "party_add_id": {
      "crn": "4123123431"
    }
  }
}

is_unregistered

Requirement: Optional
Type: Boolean
Default: false

Indicates if this is a VAT-unregistered party.


Full Party Details Example

Regional API

JSON
{
  "party_details": {
    "party_name_ar": "شركة اختبار",
    "party_name_en": "Test Company",
    "party_vat": "301121921500003",
    "party_add_id": {
      "crn": "4123123431"
    },
    "city_ar": "جدة",
    "city_en": "Jeddah",
    "city_subdivision_ar": "البلد",
    "city_subdivision_en": "Al-Balad",
    "street_ar": "شارع فهد",
    "street_en": "Fahad St.",
    "building": "1234",
    "postal_zone": "12345"
  }
}

Line Items — lineitems[]

An array of items included in the invoice. At least one item is mandatory.

name_ar

Requirement: Mandatory
Type: String

The name of the item in Arabic.


name_en

Requirement: Optional
Type: String

The name of the item in English.


quantity

Requirement: Mandatory
Type: Float

The quantity of items included in the invoice.


tax_exclusive_price

Requirement: Mandatory
Type: Float

The price of the item exclusive of tax.


tax_percentage

Requirement: Mandatory
Type: Float

Tax percentage in decimal form (15% is given as 0.15).


tax_category

Requirement: Mandatory
Type: String

Specifies the VAT category for this line item.

CodeCategoryDescription
SStandard RatedStandard VAT rate applies (15%)
ZZero Rated0% VAT rate applies
EExemptExempt from VAT
OOut of ScopeNot subject to VAT

tax_reason_code

Requirement: Conditional
Type: String

Required when tax_category is NOT S. The exemption reason code per UN/CEFACT code list 5305.

For "E" (Exempt from Tax):

CodeDescription
VATEX-SA-29Financial services mentioned in Article 29 of the VAT Regulations
VATEX-SA-29-7Life insurance services mentioned in Article 29 of the VAT Regulations
VATEX-SA-30Real estate transactions mentioned in Article 30 of the VAT Regulations

For "Z" (Zero Rated):

CodeDescription
VATEX-SA-32Export of goods
VATEX-SA-33Export of services
VATEX-SA-34-1International transport of goods
VATEX-SA-34-2International transport of passengers
VATEX-SA-34-3Services connected to international passenger transport
VATEX-SA-34-4Supply of a qualifying means of transport
VATEX-SA-34-5Services relating to goods or passenger transportation (Article 25)
VATEX-SA-35Medicines and medical equipment
VATEX-SA-36Qualifying metals
VATEX-SA-EDUPrivate education to citizen
VATEX-SA-HEAPrivate healthcare to citizen
VATEX-SA-MLTRYSupply of qualified military goods

For "O" (Out of Scope):

CodeDescription
VATEX-SA-OOSNot subject to VAT (free text reason provided by taxpayer)

tax_reason_text

Requirement: Conditional
Type: String

Required when tax_category is NOT S. The human-readable reason text corresponding to tax_reason_code. Can be in English or Arabic.


discounts

Requirement: Optional
Type: Array of Objects

Line-item level discounts. Each discount has:

FieldTypeDescription
amountFloatDiscount amount, exclusive of taxes
reasonStringReason for the discount

Regional API

JSON
{
  "lineitems": [
    {
      "name_ar": "حاسوب محمول",
      "name_en": "Laptop",
      "quantity": 1,
      "tax_category": "S",
      "tax_exclusive_price": 1750,
      "tax_percentage": 0.15,
      "discounts": [
        {
          "amount": 50,
          "reason": "Loyalty discount"
        }
      ]
    }
  ]
}

Document-Level Discounts and Charges

Discounts

Requirement: Optional
Type: Array of Objects

Document-level discounts applied to the overall invoice total.

Charges

Requirement: Optional
Type: Array of Objects

Document-level charges or fees applied to the overall invoice total.

Both Discounts and Charges share the same schema:

FieldTypeRequiredDescription
amountFloatYesAmount to be adjusted from total taxable
reasonStringYesReason for the discount or charge
tax_categoryStringYesS, O, E, or Z
tax_percentageFloatYesPercentage of tax involved
tax_reason_codeStringNoExemption reason code (when tax_category is not S)
tax_reason_textStringNoExemption reason text (when tax_category is not S)

Regional API

JSON
{
  "Discounts": [
    {
      "amount": 100,
      "reason": "Flat Discount",
      "tax_category": "S",
      "tax_percentage": 0.15
    }
  ],
  "Charges": [
    {
      "amount": 50,
      "reason": "Service Fee",
      "tax_category": "S",
      "tax_percentage": 0.15
    }
  ]
}

Delivery Details — delivery_details

Requirement: Conditional
Type: Object

Delivery information related to the invoice. Mandatory when doc_type is 388 (Tax Invoice) and inv_type is standard.

FieldTypeRequiredDescription
actual_deliveryDate (YYYY-MM-DD)ConditionalActual delivery date. Mandatory for doc_type: 388 with inv_type: standard.
latest_deliveryDate (YYYY-MM-DD)NoLatest delivery date. Use when the delivery spans a period of time.

Regional API

JSON
{
  "delivery_details": {
    "actual_delivery": "2024-01-01",
    "latest_delivery": "2024-01-31"
  }
}

Advance Details — advance_details

Requirement: Conditional
Type: Object

Details related to advance amounts received against a final invoice. Only applicable when has_advance is true and doc_type is 388.

FieldTypeRequiredDescription
advance_amountFloatYesTotal of all advance amounts paid against this invoice
advance_invoicesArrayYesList of individual advance invoices (see below)

Advance Invoices — advance_invoices[]

Each entry represents a single advance invoice with its tax details and identification.

FieldTypeRequiredDescription
idStringYesAdvance invoice reference number
issue_dateDate (YYYY-MM-DD)YesIssue date of the advance invoice
issue_timeTime (HH:MM:SS)YesIssue time of the advance invoice
tax_categoryStringYesS, Z, E, or O
tax_percentageFloatYesPercentage in decimal (0.15 for 15%)
taxable_amountFloatYesTaxable amount in this advance invoice
tax_reason_codeStringNoExemption reason code (required when tax_category is not S)
tax_reason_textStringNoExemption reason text (required when tax_category is not S)

Regional API

JSON
{
  "has_advance": true,
  "advance_details": {
    "advance_amount": 215,
    "advance_invoices": [
      {
        "tax_category": "S",
        "tax_percentage": 0.15,
        "taxable_amount": 100,
        "id": "ADV-INV-1",
        "issue_date": "2023-12-05",
        "issue_time": "12:34:23"
      },
      {
        "tax_category": "E",
        "tax_percentage": 0,
        "tax_reason_code": "VATEX-SA-29",
        "tax_reason_text": "Financial services mentioned in Article 29 of the VAT Regulations",
        "taxable_amount": 100,
        "id": "ADV-INV-2",
        "issue_date": "2023-12-06",
        "issue_time": "12:34:23"
      }
    ]
  }
}

Notes Details — notes_details

Requirement: Conditional
Type: Object

Required when doc_type is 381 (Credit Note) or 383 (Debit Note). Contains information about the original invoice being adjusted.

FieldTypeDescription
related_doc_referenceStringID of the document this note relates to
reason_textStringReason why the note is being generated

Regional API

JSON
{
  "doc_type": "381",
  "notes_details": {
    "related_doc_reference": "INV-3",
    "reason_text": "Product return and refund"
  }
}

ZATCA eInvoicing Lifecycle

This guide covers the complete lifecycle of e-invoicing in Saudi Arabia, from onboarding EGS devices to generating, clearing, and reporting invoices through ZATCA's Fatoora Portal.


Overview

The ZATCA e-invoicing lifecycle follows these stages:

StageEndpointPurpose
1. Onboard EGSPOST /egs/onboardRegister devices and obtain Compliance CSID
2. Compliance CheckGET /egs/compliance-check/{uuid}Pass compliance tests and obtain Production CSID
3. Generate InvoicePOST /api/einvoice/generate/invoiceGenerate and clear B2B invoices or generate B2C invoices
4. Report B2CPOST /api/einvoice/reportReport simplified (B2C) invoices to ZATCA
5. Phase One QRPOST /api/einvoice/generate/phase-one-qrGenerate QR codes for Phase 1 compliance

1. Onboard EGS Devices

Before generating invoices, your E-Invoicing Generation Solution (EGS) devices must be registered with ZATCA. This step generates a Compliance CSID (CCSID) for each device.

Prerequisites

  • A Flick API account with KSA mandate enabled
  • Your company's VAT registration details (15-digit VAT number starting and ending with 3)
  • A 6-digit OTP obtained from the Fatoora Portal for each device

Request

Endpoint: POST /egs/onboard

Headers:

  • x-flick-auth-key: Your Flick API key
  • Content-Type: application/json

Regional API

JSON
{
  "vat_name": "Test Co.",
  "vat_number": "300000000000003",
  "devices": [
    {
      "device_name": "TestEGS1",
      "city": "Riyadh",
      "city_subdiv": "Test Dist.",
      "street": "Test St.",
      "plot": "1234",
      "building": "1234",
      "postal": "12345",
      "branch_name": "Riyadh Branch 1",
      "branch_industry": "Retail",
      "otp": "123321"
    },
    {
      "device_name": "TestEGS2",
      "city": "Riyadh",
      "city_subdiv": "Test Dist.",
      "street": "Test St.",
      "plot": "1234",
      "building": "1234",
      "postal": "12345",
      "branch_name": "Riyadh Branch 2",
      "branch_industry": "Retail",
      "otp": "321123"
    }
  ]
}

Request Fields

FieldTypeRequiredDescription
vat_nameStringYesOfficial VAT-registered name of the entity
vat_numberStringYes15-digit VAT number (starts and ends with 3)
devicesArrayYesArray of devices to onboard (see device fields below)

Device Fields — devices[]

Each device in the array must include:

FieldTypeRequiredDescription
device_nameStringYesUnique name of the device intended for onboarding
cityStringYesCity where the device will be placed
city_subdivStringYesDistrict or subdivision within the city
streetStringYesStreet address of the device's location
branch_nameStringYesBranch name. For Group-VAT members, this should contain the 10-digit TIN of the member.
branch_industryStringYesIndustry category of the branch (e.g. Retail, Healthcare)
otpStringYes6-digit OTP obtained from the Fatoora Portal
postalStringYes5-digit postal zone or ZIP code
plotStringNo4-digit plot identifier
buildingStringNo4-digit building number

Response

JSON
{
  "status": "success",
  "data": {
    "response": [
      {
        "uuid": "f902f9aa-3d25-4bf2-90c5-6ec4bbc122df",
        "device_name": "TestEGS1",
        "compliance_certificate": "-----BEGIN CERTIFICATE-----\nMIICRT...2mx9I+et/byhTsH\n-----END CERTIFICATE-----"
      },
      {
        "uuid": "5cd9c201-1960-4bdd-9741-88a124c6a63b",
        "device_name": "TestEGS2",
        "compliance_certificate": "-----BEGIN CERTIFICATE-----\nMIICRT...2mx9I+et/byhTsH\n-----END CERTIFICATE-----"
      }
    ]
  }
}

Response Fields

FieldDescription
uuidUnique identifier for the onboarded EGS — used in subsequent API calls
device_nameThe name you provided during onboarding
compliance_certificateThe Compliance CSID (CCSID) certificate issued by ZATCA

Key Points:

  • Each device gets its own UUID and Compliance CSID
  • The UUID is required for the compliance check step and as a header when generating invoices
  • You can onboard multiple devices in a single request
  • For Group-VAT members, set branch_name to the member's 10-digit TIN

2. Complete Compliance Check

After onboarding, each EGS device must pass ZATCA's compliance checks to receive a Production CSID (PCSID). The compliance check verifies that the device can properly generate, sign, and submit invoices.

Request

Endpoint: GET /egs/compliance-check/{egs_uuid}

Headers:

  • x-flick-auth-key: Your Flick API key

Path Parameters:

ParameterTypeDescription
egs_uuidStringUUID returned from the onboarding step

Sample Request

Text
GET /egs/compliance-check/f902f9aa-3d25-4bf2-90c5-6ec4bbc122df

Response

JSON
{
  "status": "success",
  "data": {
    "response": {
      "uuid": "f902f9aa-3d25-4bf2-90c5-6ec4bbc122df",
      "device_name": "TestEGS1",
      "production_certificate": "-----BEGIN CERTIFICATE-----\nMIIFFTCCBLqgAwIBAgITGQAAE0B6Q1...jxMYAEr29G\n-----END CERTIFICATE-----"
    }
  }
}

Response Fields

FieldDescription
uuidThe EGS UUID (same as input)
device_nameThe device name
production_certificateThe Production CSID (PCSID) — your device is now ready for live invoicing

Key Points:

  • Each EGS device must complete this check individually
  • The compliance check runs automated test invoices against ZATCA's validation rules
  • Once a Production CSID is issued, the device can generate and submit live invoices
  • Store the Production CSID securely — it is required for signing invoices

3. Generate E-Invoice

Generate an e-invoice and submit it to ZATCA for clearance (B2B) or prepare it for reporting (B2C).

Request

Endpoint: POST /api/einvoice/generate/invoice

Headers:

  • x-flick-auth-key: Your Flick API key
  • egs_uuid: UUID of the EGS device generating this invoice
  • Content-Type: application/json

Standard Invoice (B2B)

Regional API

JSON
{
  "invoice_ref_number": "INV-4",
  "issue_date": "2024-02-01",
  "issue_time": "01:40:40",
  "doc_type": "388",
  "currency": "USD",
  "currency_exchange_rate": 3.75,
  "inv_type": "standard",
  "party_details": {
    "party_name_ar": "شركة اختبار",
    "party_name_en": "Test Company",
    "party_vat": "301121921500003",
    "party_add_id": {
      "crn": "4123123431"
    },
    "city_ar": "جدة",
    "city_en": "Jeddah",
    "city_subdivision_ar": "البلد",
    "city_subdivision_en": "Al-Balad",
    "street_ar": "شارع فهد",
    "street_en": "Fahad St.",
    "building": "1234",
    "postal_zone": "12345"
  },
  "delivery_details": {
    "actual_delivery": "2024-01-01",
    "latest_delivery": "2024-01-31"
  },
  "has_advance": true,
  "advance_details": {
    "advance_amount": 215,
    "advance_invoices": [
      {
        "tax_category": "S",
        "tax_percentage": 0.15,
        "taxable_amount": 100,
        "id": "ADV-INV-1",
        "issue_date": "2023-12-05",
        "issue_time": "12:34:23"
      },
      {
        "tax_category": "E",
        "tax_percentage": 0,
        "tax_reason_code": "VATEX-SA-29",
        "tax_reason_text": "Financial services mentioned in Article 29 of the VAT Regulations",
        "taxable_amount": 100,
        "id": "ADV-INV-2",
        "issue_date": "2023-12-06",
        "issue_time": "12:34:23"
      }
    ]
  },
  "lineitems": [
    {
      "name_en": "Laptop",
      "name_ar": "حاسوب محمول",
      "quantity": 1,
      "tax_category": "S",
      "tax_exclusive_price": 1750,
      "tax_percentage": 0.15
    },
    {
      "name_en": "Iphone",
      "name_ar": "ايفون",
      "quantity": 1,
      "tax_category": "S",
      "tax_exclusive_price": 750,
      "tax_percentage": 0.15
    }
  ]
}

Success Response (200)

JSON
{
  "status": "success",
  "data": {
    "uuid": "be90ce5a-0870-48cb-99d9-281a72267bd0",
    "invoice_hash": "gwu7kxui55r3v0ZKa2zHKkJogrtVjnK5WJa6QkkaVfU=",
    "invoice_total": 3191.5,
    "tax_total": "322.50",
    "qr_code": "AStNdXRhYmFxYW5pIE1lZGlj...",
    "pdf_base64": "JVBERi0xLjQKMSAwIG9iago8P...",
    "xml_base64": "PD94bWwgdmVyc2lvbj0iMS4w..."
  }
}

Response Fields

FieldDescription
uuidUnique identifier assigned to this invoice
invoice_hashSHA-256 hash of the invoice
invoice_totalComputed invoice total including taxes
tax_totalComputed total tax amount
qr_codeBase64-encoded QR code data
pdf_base64Base64-encoded PDF of the invoice
xml_base64Base64-encoded UBL 2.1 XML of the invoice

Validation Error Response (400)

JSON
{
  "status": "validation_error",
  "message": "There are validation errors in the submitted data",
  "errors": [
    {
      "error": "Issue time is required",
      "path": ["issue_time"]
    }
  ],
  "errors_text": "(1) Issue time is required"
}
FieldDescription
status"validation_error"
messageHuman-readable summary
errorsArray of individual errors, each with error (message) and path (field location)
errors_textConcatenated error summary string

Request Fields Summary

FieldTypeRequiredDescription
invoice_ref_numberStringYesUnique sequential invoice reference
issue_dateDateYesInvoice date (YYYY-MM-DD)
issue_timeTimeYesInvoice time (HH:MM:SS)
doc_typeStringYes388, 386, 381, or 383
inv_typeStringYesstandard or simplified
currencyStringNoCurrency code (default: SAR)
currency_exchange_rateFloatConditionalRequired when currency is not SAR
party_detailsObjectYesBuyer details (see Datapoints)
delivery_detailsObjectConditionalMandatory for doc_type: 388 with inv_type: standard. Must include actual_delivery.
has_advanceBooleanNoWhether invoice has advance payments
advance_detailsObjectConditionalRequired when has_advance is true
notes_detailsObjectConditionalRequired for credit/debit notes (doc_type 381/383)
lineitemsArrayYesAt least one line item required
DiscountsArrayNoDocument-level discounts
ChargesArrayNoDocument-level charges
is_exportBooleanNoExport transaction flag
is_b2gBooleanNoB2G transaction flag
is_thirdpartyBooleanNoThird-party transaction flag
is_nominalBooleanNoNominal transaction flag
is_summaryBooleanNoSummary invoice flag
is_selfbilledBooleanNoSelf-billed invoice flag

4. Report B2C E-Invoice

Use this endpoint when you do not need real-time clearance. Instead of clearing the invoice through ZATCA before delivery, the /report endpoint returns a QR code immediately so you can issue it to the customer (e.g. from a POS system), while Flick reports the transaction to ZATCA asynchronously within 24 hours.

This is the standard flow for simplified (B2C) invoices.

Request

Endpoint: POST /api/einvoice/report

Headers:

  • x-flick-auth-key: Your Flick API key
  • egs_uuid: UUID of the EGS device
  • Content-Type: application/json

The request body is the same as the Generate endpoint. For B2C invoices, use inv_type: "simplified" and party_details are optional.

Regional API

JSON
{
  "invoice_ref_number": "INV-2",
  "issue_date": "2023-01-01",
  "issue_time": "01:40:40",
  "doc_type": "388",
  "inv_type": "simplified",
  "currency": "SAR",
  "lineitems": [
    {
      "name_en": "Laptop",
      "name_ar": "كمبيوتر محمول",
      "quantity": 1,
      "tax_category": "S",
      "tax_exclusive_price": 1750,
      "tax_percentage": 0.15
    }
  ]
}

Success Response (200)

JSON
{
  "uuid": "cf1f175d-a614-484a-a4ec-6754677c6859",
  "invoice_hash": "rK/NAM9Wy9BVEWI7V7J3o3XNp10Dsjb3qZGPyxBA06s=",
  "qr_code": "ARlBbCBTYWRoYW4gVHJhZGluZyBDb21wYW55..."
}

Response Fields

FieldDescription
uuidUnique identifier assigned to this invoice
invoice_hashSHA-256 hash of the invoice
qr_codeBase64-encoded QR code — use this in your POS receipt or invoice printout

Validation Error Response (400)

Validation errors follow the same structure as the Generate endpoint. See Generate Validation Error above.

Key Differences: Generate vs Report

/generate/report
ZATCA processReal-time clearance — invoice is validated and stamped by ZATCA before you get the responseAsync reporting — QR code returned immediately, Flick reports to ZATCA within 24 hours
Typical useB2B/B2G standard invoicesB2C simplified invoices (POS, retail)
ResponseFull response with pdf_base64, xml_base64, invoice_total, tax_totalLightweight response with uuid, invoice_hash, qr_code only
Buyer detailsparty_details mandatoryparty_details optional

5. Generate Phase One QR Code

For businesses still in Phase 1, or for generating standalone QR codes, use this endpoint to create a ZATCA-compliant QR code with the 5 mandatory TLV fields.

Request

Endpoint: POST /api/einvoice/generate/phase-one-qr

Headers:

  • x-flick-auth-key: Your Flick API key
  • Content-Type: application/json

Regional API

JSON
{
  "seller_vat": "300000000000033",
  "seller_name": "شركة اختبار",
  "issue_date": "2024-02-01",
  "issue_time": "01:40:40",
  "invoice_total": 1200,
  "tax_total": 200
}

Response

JSON
{
  "status": "success",
  "data": {
    "seller_vat": "300000000000033",
    "invoice_total": 1200,
    "qr_code": "AQzYs9in2K/Yrdin2YYCDzMwMDAwMDAwMDAwMDAzMwMUMjAyNC0wMi0wMVQwMTo0MDo0MFoEBDEyMDAFAzIwMA=="
  }
}

Response Fields

FieldDescription
seller_vatEchoed back for confirmation
invoice_totalEchoed back for confirmation
qr_codeBase64-encoded TLV QR code containing the 5 mandatory data fields

Complete Integration Flow

Here is the recommended sequence for a full integration:

Initial Setup (One-time)

  1. Get API credentials from the Flick dashboard
  2. Obtain OTPs from the Fatoora Portal for each EGS device
  3. Onboard devices via POST /egs/onboard — save the returned UUIDs
  4. Complete compliance via GET /egs/compliance-check/{uuid} — obtain Production CSIDs

Ongoing Operations

  1. Generate B2B invoices via POST /api/einvoice/generate/invoice with inv_type: "standard"
  2. Report B2C invoices via POST /api/einvoice/report with inv_type: "simplified"
  3. Handle errors — check response status and handle ZATCA rejections

Integration Checklist

Before going live, verify:

  • All EGS devices are onboarded and have Production CSIDs
  • API authentication is configured with valid credentials
  • B2B invoices are being cleared before delivery to buyers
  • B2C invoices are being reported within 24 hours
  • VAT calculations are correct (15% standard rate)
  • Arabic fields (name_ar, city_ar, etc.) are properly encoded in UTF-8
  • Sequential invoice numbering is maintained per EGS device
  • Error handling and retry logic are implemented
  • Sandbox testing is complete with all invoice types

For complete request body examples covering all invoice types, refer to the Examples section.

Saudi Arabia E-Invoicing Examples

Complete collection of ZATCA-compliant invoice examples covering standard invoices, simplified invoices, credit/debit notes, advance invoices, and special scenarios.


Standard Invoices

Standard Tax Invoice (B2B)

A typical B2B tax invoice with standard 15% VAT rate, full buyer details, and multiple line items.

Key Features:

  • Document Type: 388 (Tax Invoice)
  • Invoice Type: standard (B2B — requires ZATCA clearance)
  • Standard VAT rate: 15%
  • Full party details with Arabic and English names

Regional API

JSON
{
  "invoice_ref_number": "INV-001",
  "issue_date": "2024-02-01",
  "issue_time": "14:30:00",
  "doc_type": "388",
  "inv_type": "standard",
  "currency": "SAR",
  "party_details": {
    "party_name_ar": "شركة التقنية المحدودة",
    "party_name_en": "Tech Solutions Ltd.",
    "party_vat": "301121921500003",
    "party_add_id": {
      "crn": "4123123431"
    },
    "city_ar": "الرياض",
    "city_en": "Riyadh",
    "city_subdivision_ar": "العليا",
    "city_subdivision_en": "Al Olaya",
    "street_ar": "طريق الملك فهد",
    "street_en": "King Fahd Road",
    "building": "1234",
    "plot": "5678",
    "postal_zone": "12345"
  },
  "delivery_details": {
    "actual_delivery": "2024-02-01",
    "latest_delivery": "2024-02-28"
  },
  "lineitems": [
    {
      "name_en": "Software Development Services",
      "name_ar": "خدمات تطوير البرمجيات",
      "quantity": 100,
      "tax_category": "S",
      "tax_exclusive_price": 500,
      "tax_percentage": 0.15
    },
    {
      "name_en": "Technical Support",
      "name_ar": "الدعم الفني",
      "quantity": 50,
      "tax_category": "S",
      "tax_exclusive_price": 200,
      "tax_percentage": 0.15
    }
  ]
}

Simplified Tax Invoice (B2C)

A B2C point-of-sale invoice. Buyer details are optional for simplified invoices.

Key Features:

  • Document Type: 388 (Tax Invoice)
  • Invoice Type: simplified (B2C — reported to ZATCA after issuance)
  • No buyer details required
  • QR code generated locally

Regional API

JSON
{
  "invoice_ref_number": "POS-001",
  "issue_date": "2024-02-01",
  "issue_time": "10:15:30",
  "doc_type": "388",
  "inv_type": "simplified",
  "currency": "SAR",
  "lineitems": [
    {
      "name_en": "Laptop",
      "name_ar": "حاسوب محمول",
      "quantity": 1,
      "tax_category": "S",
      "tax_exclusive_price": 4500,
      "tax_percentage": 0.15
    },
    {
      "name_en": "Wireless Mouse",
      "name_ar": "فأرة لاسلكية",
      "quantity": 2,
      "tax_category": "S",
      "tax_exclusive_price": 150,
      "tax_percentage": 0.15
    }
  ]
}

Credit Notes and Debit Notes

Credit Note

A credit note that adjusts (reduces) a previously issued invoice. Used for returns, corrections, or partial refunds.

Key Features:

  • Document Type: 381 (Credit Note)
  • Requires notes_details with reference to the original invoice
  • Can be standard or simplified based on the original invoice type

Regional API

JSON
{
  "invoice_ref_number": "CN-001",
  "issue_date": "2024-02-15",
  "issue_time": "09:00:00",
  "doc_type": "381",
  "inv_type": "standard",
  "currency": "SAR",
  "notes_details": {
    "related_doc_reference": "INV-001",
    "reason_text": "Product return - defective item"
  },
  "party_details": {
    "party_name_ar": "شركة التقنية المحدودة",
    "party_name_en": "Tech Solutions Ltd.",
    "party_vat": "301121921500003",
    "city_ar": "الرياض",
    "city_en": "Riyadh",
    "city_subdivision_ar": "العليا",
    "city_subdivision_en": "Al Olaya",
    "street_ar": "طريق الملك فهد",
    "street_en": "King Fahd Road",
    "postal_zone": "12345"
  },
  "lineitems": [
    {
      "name_en": "Laptop",
      "name_ar": "حاسوب محمول",
      "quantity": 1,
      "tax_category": "S",
      "tax_exclusive_price": 4500,
      "tax_percentage": 0.15
    }
  ]
}

Debit Note

A debit note that adjusts (increases) a previously issued invoice. Used for additional charges or corrections.

Key Features:

  • Document Type: 383 (Debit Note)
  • Requires notes_details with reference to the original invoice

Regional API

JSON
{
  "invoice_ref_number": "DN-001",
  "issue_date": "2024-02-15",
  "issue_time": "11:30:00",
  "doc_type": "383",
  "inv_type": "standard",
  "currency": "SAR",
  "notes_details": {
    "related_doc_reference": "INV-001",
    "reason_text": "Additional installation services"
  },
  "party_details": {
    "party_name_ar": "شركة التقنية المحدودة",
    "party_name_en": "Tech Solutions Ltd.",
    "party_vat": "301121921500003",
    "city_ar": "الرياض",
    "city_en": "Riyadh",
    "city_subdivision_ar": "العليا",
    "city_subdivision_en": "Al Olaya",
    "street_ar": "طريق الملك فهد",
    "street_en": "King Fahd Road",
    "postal_zone": "12345"
  },
  "lineitems": [
    {
      "name_en": "Installation Service",
      "name_ar": "خدمة التركيب",
      "quantity": 1,
      "tax_category": "S",
      "tax_exclusive_price": 500,
      "tax_percentage": 0.15
    }
  ]
}

Advance Invoice

An advance invoice issued for advance payments received before delivery of goods or services.

Key Features:

  • Document Type: 386 (Advance Invoice)
  • No advance_details needed — this IS the advance invoice itself

Regional API

JSON
{
  "invoice_ref_number": "ADV-001",
  "issue_date": "2024-01-15",
  "issue_time": "12:00:00",
  "doc_type": "386",
  "inv_type": "standard",
  "currency": "SAR",
  "party_details": {
    "party_name_ar": "شركة البناء السعودية",
    "party_name_en": "Saudi Construction Co.",
    "party_vat": "300456789000003",
    "city_ar": "جدة",
    "city_en": "Jeddah",
    "city_subdivision_ar": "الحمراء",
    "city_subdivision_en": "Al Hamra",
    "street_ar": "شارع الأمير سلطان",
    "street_en": "Prince Sultan St.",
    "postal_zone": "21577"
  },
  "lineitems": [
    {
      "name_en": "Advance Payment - Construction Project",
      "name_ar": "دفعة مقدمة - مشروع بناء",
      "quantity": 1,
      "tax_category": "S",
      "tax_exclusive_price": 50000,
      "tax_percentage": 0.15
    }
  ]
}

Final Invoice with Advance Deduction

A final invoice that deducts a previously paid advance. Uses has_advance and advance_details to reference prior advance invoices.

Key Features:

  • Document Type: 388 (Tax Invoice)
  • has_advance: true with advance_details referencing prior advance invoices
  • Each advance invoice listed individually with its tax category

Regional API

JSON
{
  "invoice_ref_number": "INV-005",
  "issue_date": "2024-03-01",
  "issue_time": "09:00:00",
  "doc_type": "388",
  "inv_type": "standard",
  "currency": "SAR",
  "party_details": {
    "party_name_ar": "شركة البناء السعودية",
    "party_name_en": "Saudi Construction Co.",
    "party_vat": "300456789000003",
    "city_ar": "جدة",
    "city_en": "Jeddah",
    "city_subdivision_ar": "الحمراء",
    "city_subdivision_en": "Al Hamra",
    "street_ar": "شارع الأمير سلطان",
    "street_en": "Prince Sultan St.",
    "postal_zone": "21577"
  },
  "has_advance": true,
  "advance_details": {
    "advance_amount": 57500,
    "advance_invoices": [
      {
        "tax_category": "S",
        "tax_percentage": 0.15,
        "taxable_amount": 50000,
        "id": "ADV-001",
        "issue_date": "2024-01-15",
        "issue_time": "12:00:00"
      }
    ]
  },
  "lineitems": [
    {
      "name_en": "Construction Services - Phase 1",
      "name_ar": "خدمات البناء - المرحلة الأولى",
      "quantity": 1,
      "tax_category": "S",
      "tax_exclusive_price": 200000,
      "tax_percentage": 0.15
    }
  ]
}

Multi-Currency Invoice

An invoice issued in a foreign currency with an exchange rate to SAR.

Key Features:

  • Currency set to USD instead of default SAR
  • currency_exchange_rate provides the conversion rate for tax calculations

Regional API

JSON
{
  "invoice_ref_number": "INV-006",
  "issue_date": "2024-02-01",
  "issue_time": "01:40:40",
  "doc_type": "388",
  "currency": "USD",
  "currency_exchange_rate": 3.75,
  "inv_type": "standard",
  "party_details": {
    "party_name_ar": "شركة اختبار",
    "party_name_en": "Test Company",
    "party_vat": "301121921500003",
    "party_add_id": {
      "crn": "4123123431"
    },
    "city_ar": "جدة",
    "city_en": "Jeddah",
    "city_subdivision_ar": "البلد",
    "city_subdivision_en": "Al-Balad",
    "street_ar": "شارع فهد",
    "street_en": "Fahad St.",
    "building": "1234",
    "postal_zone": "12345"
  },
  "lineitems": [
    {
      "name_en": "Consulting Services",
      "name_ar": "خدمات استشارية",
      "quantity": 10,
      "tax_category": "S",
      "tax_exclusive_price": 500,
      "tax_percentage": 0.15
    }
  ]
}

Export Invoice

An invoice for exported goods or services, with zero-rated VAT.

Key Features:

  • is_export: true flag set
  • Line items use tax category Z (Zero Rated) with reason code VATEX-SA-32 or VATEX-SA-33

Regional API

JSON
{
  "invoice_ref_number": "EXP-001",
  "issue_date": "2024-02-01",
  "issue_time": "08:00:00",
  "doc_type": "388",
  "inv_type": "standard",
  "currency": "USD",
  "currency_exchange_rate": 3.75,
  "is_export": true,
  "party_details": {
    "party_name_ar": "شركة أجنبية",
    "party_name_en": "Foreign Corp Inc.",
    "party_vat": "",
    "party_add_id": {
      "crn": "1234567890"
    },
    "city_ar": "دبي",
    "city_en": "Dubai",
    "city_subdivision_ar": "وسط المدينة",
    "city_subdivision_en": "Downtown",
    "street_ar": "شارع الشيخ زايد",
    "street_en": "Sheikh Zayed Rd.",
    "building": "1234",
    "postal_zone": "00000",
    "country": "AE",
    "is_unregistered": true
  },
  "lineitems": [
    {
      "name_en": "Software License - Annual",
      "name_ar": "ترخيص برمجي - سنوي",
      "quantity": 1,
      "tax_category": "Z",
      "tax_exclusive_price": 10000,
      "tax_percentage": 0,
      "tax_reason_code": "VATEX-SA-33",
      "tax_reason_text": "Export of services"
    }
  ]
}

Invoice with Document-Level Discounts and Charges

An invoice that includes both document-level discounts and charges.

Regional API

JSON
{
  "invoice_ref_number": "INV-007",
  "issue_date": "2024-02-01",
  "issue_time": "14:00:00",
  "doc_type": "388",
  "inv_type": "standard",
  "currency": "SAR",
  "party_details": {
    "party_name_ar": "شركة المشتري",
    "party_name_en": "Buyer Corp.",
    "party_vat": "301121921500003",
    "city_ar": "الرياض",
    "city_en": "Riyadh",
    "city_subdivision_ar": "المروج",
    "city_subdivision_en": "Al Muruj",
    "street_ar": "شارع التحلية",
    "street_en": "Tahlia St.",
    "postal_zone": "12345"
  },
  "lineitems": [
    {
      "name_en": "Product A",
      "name_ar": "منتج أ",
      "quantity": 10,
      "tax_category": "S",
      "tax_exclusive_price": 100,
      "tax_percentage": 0.15
    },
    {
      "name_en": "Product B",
      "name_ar": "منتج ب",
      "quantity": 5,
      "tax_category": "S",
      "tax_exclusive_price": 200,
      "tax_percentage": 0.15
    }
  ],
  "Discounts": [
    {
      "amount": 100,
      "reason": "Volume discount",
      "tax_category": "S",
      "tax_percentage": 0.15
    }
  ],
  "Charges": [
    {
      "amount": 50,
      "reason": "Delivery fee",
      "tax_category": "S",
      "tax_percentage": 0.15
    }
  ]
}

Exempt and Zero-Rated Items

Invoice with Exempt Items

Regional API

JSON
{
  "invoice_ref_number": "INV-008",
  "issue_date": "2024-02-01",
  "issue_time": "10:00:00",
  "doc_type": "388",
  "inv_type": "standard",
  "currency": "SAR",
  "party_details": {
    "party_name_ar": "بنك المملكة",
    "party_name_en": "Kingdom Bank",
    "party_vat": "300789456000003",
    "city_ar": "الرياض",
    "city_en": "Riyadh",
    "city_subdivision_ar": "الملز",
    "city_subdivision_en": "Al Malaz",
    "street_ar": "شارع العروبة",
    "street_en": "Uruba St.",
    "postal_zone": "11461"
  },
  "lineitems": [
    {
      "name_en": "Financial Advisory Services",
      "name_ar": "خدمات الاستشارات المالية",
      "quantity": 1,
      "tax_category": "E",
      "tax_exclusive_price": 25000,
      "tax_percentage": 0,
      "tax_reason_code": "VATEX-SA-29",
      "tax_reason_text": "Financial services mentioned in Article 29 of the VAT Regulations"
    }
  ]
}

Invoice with Zero-Rated Items (Medical Supplies)

Regional API

JSON
{
  "invoice_ref_number": "INV-009",
  "issue_date": "2024-02-01",
  "issue_time": "11:30:00",
  "doc_type": "388",
  "inv_type": "standard",
  "currency": "SAR",
  "party_details": {
    "party_name_ar": "مستشفى المملكة",
    "party_name_en": "Kingdom Hospital",
    "party_vat": "300111222000003",
    "city_ar": "الرياض",
    "city_en": "Riyadh",
    "city_subdivision_ar": "السليمانية",
    "city_subdivision_en": "Al Sulaimaniyyah",
    "street_ar": "شارع صلاح الدين",
    "street_en": "Salahuddin St.",
    "postal_zone": "11564"
  },
  "lineitems": [
    {
      "name_en": "Medical Equipment - MRI Scanner",
      "name_ar": "معدات طبية - جهاز تصوير بالرنين المغناطيسي",
      "quantity": 1,
      "tax_category": "Z",
      "tax_exclusive_price": 500000,
      "tax_percentage": 0,
      "tax_reason_code": "VATEX-SA-35",
      "tax_reason_text": "Medicines and medical equipment"
    }
  ]
}

VAT Category Reference

Tax Categories

CodeCategoryRateWhen to Use
SStandard Rated15%Most goods and services in Saudi Arabia
ZZero Rated0%Exports, international transport, medicines, qualifying metals
EExemptN/AFinancial services, real estate, life insurance
OOut of ScopeN/ATransactions not subject to VAT

Exemption Reason Codes

Zero Rated (Z)

CodeEnglishArabic
VATEX-SA-32Export of goodsصادرات السلع من المملكة
VATEX-SA-33Export of servicesصادرات الخدمات من المملكة
VATEX-SA-34-1International transport of goodsالنقل الدولي للسلع
VATEX-SA-34-2International transport of passengersالنقل الدولي للركاب
VATEX-SA-34-3Services connected to international passenger transportالخدمات المرتبطة بالنقل الدولي للركاب
VATEX-SA-34-4Supply of a qualifying means of transportتوريد وسائل النقل المؤهلة
VATEX-SA-34-5Services relating to goods or passenger transportationالخدمات ذات الصلة بنقل السلع أو الركاب
VATEX-SA-35Medicines and medical equipmentالأدوية والمعدات الطبية
VATEX-SA-36Qualifying metalsالمعادن المؤهلة
VATEX-SA-EDUPrivate education to citizenالخدمات التعليمية الخاصة للمواطنين
VATEX-SA-HEAPrivate healthcare to citizenالخدمات الصحية الخاصة للمواطنين
VATEX-SA-MLTRYSupply of qualified military goodsتوريد السلع العسكرية المؤهلة

Exempt (E)

CodeEnglishArabic
VATEX-SA-29Financial services (Article 29)الخدمات المالية
VATEX-SA-29-7Life insurance services (Article 29)عقد تأمين على الحياة
VATEX-SA-30Real estate transactions (Article 30)التوريدات العقارية المعفاة من الضريبة

Out of Scope (O)

CodeEnglishArabic
VATEX-SA-OOSNot subject to VAT (free text reason)السبب يتم تزويده من قبل المكلف

Document Type Reference

CodeTypeDescriptionClearance
388Tax InvoiceStandard invoice for suppliesB2B: Cleared / B2C: Reported
386Advance InvoiceInvoice for advance paymentsB2B: Cleared / B2C: Reported
381Credit NoteReduces a previously issued invoiceB2B: Cleared / B2C: Reported
383Debit NoteIncreases a previously issued invoiceB2B: Cleared / B2C: Reported

Best Practices

  1. Always test in sandbox first — Use the sandbox environment before processing live invoices
  2. Maintain sequential numbering — Invoice reference numbers must be sequential per EGS device
  3. Include Arabic fields — All _ar fields are mandatory; _en fields are optional but recommended
  4. Validate VAT numbers — Ensure all VAT numbers are 15 digits, starting and ending with 3
  5. Use correct tax categories — Always provide tax_reason_code and tax_reason_text for non-standard (Z, E, O) categories
  6. Report B2C promptly — Simplified invoices must be reported to ZATCA within 24 hours

For detailed field definitions, refer to Invoice Datapoints. For the complete integration flow, see eInvoicing Lifecycle.