ZATCA deep dive

QR code and UBL 2.1 structure, explained.

Two technical building blocks sit underneath every ZATCA invoice: a standardized XML structure, and a QR code that carries its essential facts.

UBL 2.1 structure

ZATCA requires invoices to be structured according to the Universal Business Language (UBL) 2.1 standard, with ZATCA-specific extensions layered on top for fields like the invoice hash, UUID, and QR payload. This is the same open standard underlying many Peppol-based e-invoicing systems worldwide, which is part of why the 5-corner model and ZATCA's clearance model can coexist on related tooling.

QR code content

The QR code embeds a fixed set of mandatory fields in TLV (tag-length-value) encoding: seller name, VAT registration number, invoice timestamp, invoice total, and VAT total — with B2B (clearance) invoices carrying an extended payload including the cryptographic stamp and hash.

QR mandatory fields (simplified/B2C)

  • Seller name
  • VAT registration number
  • Invoice timestamp
  • Invoice total (incl. VAT)
  • VAT total

Additional fields (B2B/clearance)

  • Invoice hash
  • Cryptographic stamp
  • ZATCA-issued certificate reference