The five required fields
- Seller name (Tag 1).
- Seller VAT number (Tag 2).
- Invoice timestamp ISO 8601 (Tag 3).
- Invoice total incl. VAT (Tag 4).
- VAT amount (Tag 5).
Encoding: TLV → Base64
Each field is written as Tag (1 byte) | Length (1 byte) | Value (UTF-8). Concatenate the five, then base64-encode.
// Node.js sample
function toTLV(tag, value) {
const v = Buffer.from(value, 'utf8');
return Buffer.concat([Buffer.from([tag, v.length]), v]);
}
const tlv = Buffer.concat([
toTLV(1, 'Aljazera Store'),
toTLV(2, '300012345600003'),
toTLV(3, '2026-05-13T15:30:00Z'),
toTLV(4, '115.00'),
toTLV(5, '15.00'),
]);
const base64 = tlv.toString('base64');
How CD4CD does it for you
One REST call:
POST /v1/qr
{
"type": "zatca",
"data": {
"sellerName": "Aljazera Store",
"vatNumber": "300012345600003",
"timestamp": "2026-05-13T15:30:00Z",
"totalAmount": "115.00",
"vatAmount": "15.00"
}
}
Validation
Use the official ZATCA Scanner app. If it reads all five fields correctly — the code is compliant.