BR-KSA-27: Simplified invoices must carry a QR code (KSA-14)
Requires a cac:AdditionalDocumentReference with cbc:ID 'QR' whose cac:Attachment has a non-empty cbc:EmbeddedDocumentBinaryObject with mimeCode='text/plain'. Although the official text says every document, the check only runs for simplified invoices and their notes (InvoiceTypeCode @name starting '02').
How to fix it
Add <cac:AdditionalDocumentReference><cbc:ID>QR</cbc:ID><cac:Attachment><cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">…</cbc:EmbeddedDocumentBinaryObject></cac:Attachment></cac:AdditionalDocumentReference> with the base64 QR content.
ZATCA's official text
[BR-KSA-27]-The document must contain a QR code (KSA-14), and this code must be base64Binary.
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules
Fails when (the condition ZATCA's SDK runs)
not((cac:AdditionalDocumentReference[normalize-space(cbc:ID) = 'QR'] and exists(cac:AdditionalDocumentReference[normalize-space(cbc:ID) = 'QR']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject) and (normalize-space(cac:AdditionalDocumentReference[cbc:ID = 'QR']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject) != '') and (cac:AdditionalDocumentReference[cbc:ID = 'QR']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject[normalize-space(@mimeCode) = 'text/plain'])) )
Related rules
- BR-CL-KSA-14 · The QR code value must be 1 to 1000 characters long
- BR-KSA-24 · Not-subject-to-VAT (O) breakdown needs a reason code (BT-121)
- BR-KSA-25 · Simplified invoice with EDU/HEA exemption needs the buyer name
- BR-KSA-26 · Previous invoice hash (PIH) attachment must be filled, text/plain
- BR-KSA-28 · Signature information ID must be ...ubl:signature:1
- BR-KSA-29 · Signature ID and referenced signature ID must be ...signature:Invoice
Validate your invoice against ZATCA's rules
Paste the XML and see every error and warning. It runs in your browser; the invoice goes nowhere.
Validate an invoice or try Matheel