Skip to content
KSA-14

QR code

A base64 string of TLV tags carrying the invoice's key data and stamp, printed as a QR image the buyer can check.

The code is mandatory on every document (BR-KSA-27) and must be visible on the printed copy. In phase 2 it holds nine tags: seller name, VAT number, time stamp, total with VAT and VAT total, then the document hash, its signature and the public key; tag 9, for simplified documents only, is ZATCA's signature on the device certificate.

Each tag is one byte for the number, one byte for the length, then the UTF-8 value; the whole sequence is base64-encoded, and the Security standard caps the result at 700 characters. Typical mistakes are writing the length as text instead of a byte, or encoding an Arabic name in something other than UTF-8.

The QR block is excluded from the hash and the signature, since it contains the hash itself. On a standard invoice ZATCA adds or updates the QR when it clears it; on a simplified one the device writes the full code.

IdentifierKSA-14
Path in the document/Invoice/cac:AdditionalDocumentReference[cbc:ID='QR']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject
Cardinality0..1
Data typeBinary (base64)
Applies toStandard tax invoice and Simplified tax invoice

In JooDax

Built

The programs build all nine tags and refuse any tag over 255 bytes, but do not check the 700-character total. Tags 6 and 7 are written as base64 text, as in the technical guidelines' worked example, whereas the Security standard describes tag 6 as 32 bytes. Tag 3 is local time without a Z.

crates/jdx-einvoice-sa/src/xml.rs

Applies to

Tax invoiceDebit noteCredit noteSimplifiedSimplified debitSimplified credit
MandatoryMandatoryMandatoryMandatoryMandatoryMandatory

Rules that check it

  • BR-KSA-27 · The document must contain a QR code encoded as base64Binary.

Related fields

Fields — E-invoicing in Saudi Arabia (FATOORA)

Sources

  1. Electronic Invoice XML Implementation Standard to the E-Invoicing resolution dated 2023-05-19 (v1.2) — ZATCA
  2. Security Features Implementation Standards to the E-Invoicing resolution dated 2023-05-19 (v1.2) — ZATCA
  3. E-invoicing Detailed Technical Guidelines (vVersion 2) — ZATCA
  4. الضوابط والمتطلبات والمواصفات الفنية والقواعد الإجرائية اللازمة لتنفيذ أحكام لائحة الفوترة الإلكترونية (قرار المحافظ رقم 62738 وتاريخ 1443/11/23هـ) (vfile dated 20230519 (decision 62738)) — ZATCA

Checked on: 4 November 2026. What concerns JooDax is taken from the programs’ own code.