Skip to main content
Skip to main content

Saudi Fatoora UUID & Hash (ZATCA Phase 2) Generator

Generate and format valid Saudi Fatoora UUID & Hash (ZATCA Phase 2) for software testing and development.

Waiting for generation...

About Saudi Fatoora UUID & Hash (ZATCA Phase 2)

The Fatoora project is Saudi Arabia's national e-invoicing platform governed by the Zakat, Tax and Customs Authority (ZATCA). Phase 2 (Integration Phase) mandates that every tax invoice is digitally signed using X.509 certificates and contains a sequential cryptographic hash tying it to the preceding invoice.

The specification requires a canonical UUID v4 (`8-4-4-4-12` hex characters) inside `<cbc:UUID>` of UBL 2.1 XML, and a Base64-encoded SHA-256 Invoice Hash (44 characters) in `<ext:UBLExtensions>`, enabling tamper-evident verification by ZATCA APIs.

Anatomy & Structure of Fatoora QR Code (TLV Base64) — Saudi Arabia

The e-Invoicing QR Code encodes 5 mandatory tags in binary TLV format:

PositionFieldLengthMeaning & RuleExample
Tag 1Seller Company NameVariableSeller legal name in UTF-8Acme Corp
Tag 2Seller VAT Number15 digits15-digit VAT number starting and ending in 3300123456700003
Tag 3Invoice TimestampISO 8601Timestamp in format YYYY-MM-DDTHH:mm:ssZ2024-01-15T12:00:00Z
Tag 4Total Invoice AmountDecimalInvoice total amount including VAT115.00
Tag 5VAT Total AmountDecimalHighlighted VAT tax amount15.00

TLV and Base64 Encoding (ZATCA Fatoora Phase 1/2)

Fiscal QR Code encoding algorithm:

Binary concatenation of [Tag (1 byte) + Length (1 byte) + Value (N bytes)] encoded in Base64
  1. 1. For each fiscal field (1 to 5), write tag number in 1 byte.
  2. 2. Write length in UTF-8 bytes in 1 byte.
  3. 3. Write the UTF-8 encoded text bytes.
  4. 4. Concatenate all blocks and encode the binary buffer in Base64.

Frequently Asked Questions & Technical Guidelines