Get 100% ZATCA Phase II compliant with ClearTaxGet 100% ZATCA Phase II compliant with ClearTax
Seamless integration
with any ERP/POS
Seamless integration with any ERP/POS
E-invoice generation in
a fraction of a second
E-invoice generation in a fraction of a second
PDF/A3 E-invoices with
XML embedded
PDF/A3 E-invoices with XML embedded

XML Data Enrichment for ZATCA Connectivity

Updated on: Apr 3rd, 2023


3 min read

social iconssocial iconssocial iconssocial icons

Zakat, Tax and Customs Authority (ZATCA) announced that under the Value Added Tax (VAT), phase II of e-invoicing will be applicable from 1st January 2023 for registered taxpayers in Saudi Arabia having more than 300 billion SAR for the financial year 2021. Accordingly, businesses started integrating their accounting systems/ ERPs with the Fatoora portal. 

Also, ZATCA mentioned in the e-invoicing guidelines that the taxpayers must submit the invoice data in XML format. This article explains the role of XML data enrichment in SA e-invoicing

Latest Updates

What is XML?

XML stands for an extensible markup language. It is a way to present information in a structured and machine-readable format. The ZATCA e-invoice format is based on XML and several other XML-based standards. It defines a set of rules for encoding documents in both human-readable and machine-readable formats.

The XML standard is a flexible way to create information formats and electronically share structured data via the public internet and corporate networks.

What is Data Enrichment?

Data enrichment is improving existing information by adding missed or incomplete data. In simple terms, data enrichment stands for data massaging. 

Role of XML Data Enrichment in SA e-Invoicing

As mentioned earlier, in phase II, taxpayers must use the e-Invoice Generation Solution (EGS) unit to generate invoice data in XML format and share it with the ZATCA portal. Then the portal validates the invoice data and sends back the same for further use.

However, your EGS shall enrich the XML file before sharing it with the ZATCA. Three specific fields need to be added to your invoice data XML.

Let’s look at each of them.

Universal Unique Identifier (UUID)

  • UUID is used to identify an invoice through a globally unique number identifier. Once it is issued, it can be tracked throughout its lifecycle (archiving, audits, reconciliations etc.)
  • UUID is an automatically generated number within the taxpayer’s EGS unit.

Previous Invoice Hash (PIH)

  • An invoice hash is generated within the taxpayer’s EGS unit, a digital fingerprint of the invoice. Any modification/ tampering of the invoice will result in a change in the hash of the invoice.
  • The previous invoice hash is included within the subsequent invoice to showcase a sequence of invoices.
  • If the taxpayer generates an invalid e-Invoice, that invoice remains part of the records/books, and its hash is included in the next invoice to maintain continuity.

Invoice Counter Value (ICV)

  • The invoice counter is a functionality of e-inv solutions and is generated automatically.
  • Invoice counter increments for each issuance of an invoice by the system.
  • The value of an invoice counter may repeat on separate EGS units owned by the same taxpayer but not in the same EGS unit.
  • ICV and Invoice sequence numbers (IRN) are different. ICV is associated with each EGS unit and can have multiple sequence numbers for the same VAT depending on the number of EGS units configured

It is to be noted that the taxpayer’s EGS shall enrich the XML file with ICV and PIH values before sharing invoice data with ZATCA.

Also, if there are any errors while generating the e-Invoice, the taxpayer must resolve the errors based on the functionalities supported by their ERP.

  • If the ERP allows editing the same invoice, validation errors can be resolved, and the corrected invoice can be resubmitted to the ZATCA portal.
  • Otherwise, the taxpayer must issue a new invoice and submit the data to the ZATCA portal.