Standards & Rule Reference
Verified Rule Reference Library (84 Rules)
Every rule below traces directly to official ZATCA or Jordan ISTD JoFotara technical documentation and declares its exact implementation status.
Showing 84 of 84 documented rules
JoFotara UBL 2.1 Invoice Root & Namespace
JoFotara XML documents must use root element <Invoice> in namespace urn:oasis:names:specification:ubl:schema:xsd:Invoice-2.
Mandatory JoFotara Invoice ID (cbc:ID)
Every JoFotara invoice must provide a non-empty unique invoice sequence ID in cbc:ID.
Valid RFC 4122 Invoice UUID
JoFotara requires a valid RFC 4122 UUID inside cbc:UUID for deduplication and QR linking.
Mandatory ISO IssueDate (YYYY-MM-DD)
cbc:IssueDate must be present and formatted strictly as YYYY-MM-DD.
JoFotara Document Type Code (388 Invoice / 381 Credit Note)
cbc:InvoiceTypeCode must be '388' for standard invoices or '381' for credit/return notes.
JoFotara 3-Digit Subtype Code (@name: 011–023)
InvoiceTypeCode/@name must be one of 011 (Cash Income), 012 (Cash General Sales), 013 (Cash Special Sales), 021 (Receivable Income), 022 (Receivable General Sales), or 023 (Receivable Special Sales).
Domestic Currency Code JOD
Domestic JoFotara invoices use DocumentCurrencyCode 'JOD' (3 decimal places / fils).
Invoice Counter Value (ICV) Mandatory
JoFotara requires an AdditionalDocumentReference with cbc:ID='ICV' and a positive sequential integer in cbc:UUID.
Supplier TIN, Registration Name & Country JO
cac:AccountingSupplierParty must specify the taxpayer's ISTD Tax Number (PartyTaxScheme/CompanyID), RegistrationName, and Country='JO'.
Seller Income Source Sequence (SellerSupplierParty)
JoFotara requires the registered Income Source Sequence number under cac:SellerSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID.
Credit Note (381) Original Reference & Return Reason
Return/credit notes (381) must include BillingReference/InvoiceDocumentReference/ID and PaymentMeans/InstructionNote reason.
Buyer Identification Rules (Receivable 02x / >= 10,000 JOD & NIN/PN/TN)
Receivable invoices (02x) and cash invoices >= 10,000 JOD require Buyer RegistrationName and PartyIdentification/ID with schemeID NIN, PN, or TN.
At Least One InvoiceLine Required
Every JoFotara invoice must include at least one cac:InvoiceLine node.
JoFotara Line Net Amount Arithmetic
Each InvoiceLine must have positive quantity, valid unit price, and LineExtensionAmount equal to (Quantity * PriceAmount) - Discount.
JoFotara Tax Categories (S, Z, O) & Family Consistency
Sales tax invoices (012/022/013/023) must use TaxCategory S, Z, or O with accurate tax arithmetic; Income-only invoices (011/021) must not charge sales tax.
JoFotara LegalMonetaryTotal & Document Tax Consistency
TaxExclusiveAmount, TaxTotal/TaxAmount, TaxInclusiveAmount, and PayableAmount must reconcile cleanly against line sums using Decimal math.
Strict Base64 Payload Encoding
ZATCA QR payloads must decode cleanly using standard Base64 alphabet and valid padding without non-Base64 characters.
Valid TLV Framing & UTF-8 Text Decoding
Every TLV chunk must have a 1-byte tag, 1-byte length, and valid UTF-8 bytes for textual tags (1–7).
TLV Declared Byte Length Within Buffer Bounds
Each TLV length byte must equal the exact UTF-8 byte length (not character length) and never exceed remaining bytes.
No Duplicate TLV Tags
Official ZATCA tags (1–9) must each appear at most once inside a QR payload.
ZATCA 700-Character Base64 QR Size Guideline
ZATCA's Security Features Implementation Standard caps printed QR Base64 strings at 700 characters for scanner reliability.
QR Tag 2 Seller VAT Number Format
Tag 2 must contain a 15-digit Saudi VAT registration number starting and ending with '3'.
QR Tag 3 ISO-8601 Timestamp Format
Tag 3 must encode the invoice timestamp in ISO-8601 format (e.g. 2026-06-06T12:30:00Z).
QR Tags 4 & 5 Decimal Monetary Amounts & Consistency
Tag 4 (Invoice Total with VAT) and Tag 5 (VAT Total) must be plain non-negative decimals with VAT Total <= Invoice Total.
Mandatory Phase 1 (1–5) & Phase 2 (6–9) Tag Completeness
All invoices require Tags 1–5. Phase 2 invoices add Tags 6 (XML Hash), 7 (ECDSA Signature), 8 (Public Key), plus Tag 9 (CA Signature) for Simplified B2C invoices.
QR-to-XML Cross-Consistency Verification
When invoice XML is provided alongside the QR string, Tags 1, 2, 4, and 5 must exactly match the XML Seller Name, Seller VAT, TaxInclusiveAmount, and TaxTotal.
QR ECDSA Signature & ZATCA Sub-CA Verification (Unsupported Locally)
Offline QR TLV decoding validates framing, UTF-8 lengths, and field consistency only. Cryptographic ECDSA verification of Tags 6–9 against ZATCA Sub-CA certificates requires the official ZATCA Fatoora Compliance API.
UBL 2.1 Invoice Root & ZATCA ProfileID (reporting:1.0)
Every ZATCA electronic invoice must declare the official UBL 2.1 Invoice namespace and include <cbc:ProfileID>reporting:1.0</cbc:ProfileID>.
Mandatory Invoice Number (BT-1 / cbc:ID)
Every invoice, credit note, or debit note must contain a non-empty unique document identifier in cbc:ID.
Mandatory Issue Date (BT-2) & Invoice Type Code (BT-3)
The invoice must contain a valid YYYY-MM-DD cbc:IssueDate and a supported UNTDID 1001 type code (388, 381, 383, or 386).
ISO 4217 Document Currency Code (BT-5)
The invoice must specify a 3-letter ISO 4217 cbc:DocumentCurrencyCode (typically SAR).
Mandatory Seller Registration Name (BT-27)
The seller legal registration name must be present under cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName.
At Least One Invoice Line Required (BG-25)
A valid UBL invoice must contain at least one cac:InvoiceLine element.
Sum of Line Net Amounts Must Match BT-106
LegalMonetaryTotal/LineExtensionAmount (BT-106) must equal the exact Decimal sum of every InvoiceLine/LineExtensionAmount (BT-131).
Invoice Total Without VAT Calculation (BT-109)
TaxExclusiveAmount (BT-109) must equal LineExtensionAmount (BT-106) minus AllowanceTotalAmount (BT-107) plus ChargeTotalAmount (BT-108).
Document VAT Total Must Match Sum of TaxSubtotals (BT-110)
The document-level TaxTotal/TaxAmount (BT-110) must equal the sum of all TaxSubtotal/TaxAmount (BT-117) entries.
Invoice Total With VAT Calculation (BT-112)
TaxInclusiveAmount (BT-112) must equal TaxExclusiveAmount (BT-109) plus TaxTotal/TaxAmount (BT-110).
Payable Amount Calculation (BT-115)
PayableAmount (BT-115) must equal TaxInclusiveAmount (BT-112) minus PrepaidAmount (BT-113) plus PayableRoundingAmount (BT-114).
Standard VAT Breakdown Tax Calculation
For Standard-rated (S) VAT breakdowns, TaxSubtotal/TaxAmount must equal TaxableAmount * Percent / 100 (within 0.01 rounding tolerance).
RFC 4122 Invoice UUID Mandatory (KSA-1)
Every ZATCA Phase 2 invoice must include a unique RFC 4122 UUID inside cbc:UUID.
Invoice Issue Date Cannot Be in the Future
cbc:IssueDate must be less than or equal to the current date in Arabian Standard Time (AST / UTC+3).
ZATCA Transaction Code Format NNPNESB (KSA-2)
cbc:InvoiceTypeCode/@name must be a 7-digit code starting with '01' (Standard) or '02' (Simplified) followed by 5 binary flags (Third-party, Nominal, Export, Summary, Self-billed).
Seller Additional Identification Scheme & Format (BT-29)
Seller PartyIdentification/cbc:ID must appear exactly once, contain alphanumeric characters only, and use an approved schemeID (CRN, MOM, MLS, 700, SAG, OTH).
Seller Saudi National Address Completeness
Seller PostalAddress must contain StreetName, BuildingNumber, CitySubdivisionName (District), CityName, PostalZone, and Country IdentificationCode.
Buyer Address Completeness on Standard Tax Invoices
Standard Tax Invoices (01xxxxx) must populate Buyer StreetName, CityName, PostalZone, and Country IdentificationCode.
Buyer Additional Identification Scheme & Format (BT-46)
When Buyer PartyIdentification/cbc:ID is supplied, it must be alphanumeric and carry a valid ZATCA schemeID (TIN, CRN, MOM, MLS, 700, SAG, NAT, GCC, IQA, PAS, OTH).
Mandatory Supply Date on Standard Tax Invoices (KSA-5)
Standard Tax Invoices (388, 01xxxxx) must declare cac:Delivery/cbc:ActualDeliveryDate in YYYY-MM-DD format.
Approved ZATCA Payment Means Code Subset (BT-81)
When cac:PaymentMeans/cbc:PaymentMeansCode is supplied, it must be one of ZATCA's allowed numeric UNTDID 4461 codes: 1, 10, 30, 42, or 48.
Mandatory Credit/Debit Note Issuance Reason (KSA-10)
Credit notes (381) and debit notes (383) must specify why the adjustment note was issued inside cac:PaymentMeans/cbc:InstructionNote.
Allowed VAT Category Codes (S, Z, E, O)
Line ClassifiedTaxCategory/cbc:ID and TaxSubtotal/TaxCategory/cbc:ID must use strictly S (Standard), Z (Zero-rated), E (Exempt), or O (Out of scope).
Line-Level Charge Reason Code Mandatory (BT-145)
Any line-level cac:AllowanceCharge with ChargeIndicator=true must specify cbc:AllowanceChargeReasonCode.
Document-Level Charge Reason Text Mandatory (BT-104)
Any document-level cac:AllowanceCharge with ChargeIndicator=true must specify cbc:AllowanceChargeReason.
Exempt VAT Breakdown Reason Code (BT-121)
A VAT breakdown (BG-23) with category 'E' must declare an official ZATCA VATEX-SA-* code in cbc:TaxExemptionReasonCode.
Exempt VAT Breakdown Reason Text (BT-120)
A VAT breakdown with category 'E' must include cbc:TaxExemptionReason text describing the statutory exemption.
Buyer Name Mandatory for Simplified Education/Healthcare Exemptions
On simplified invoices (02xxxxx), if exemption code is VATEX-SA-EDU or VATEX-SA-HEA, Buyer RegistrationName (BT-44) becomes mandatory.
Previous Invoice Hash (PIH) Base64 SHA-256 Format
The PIH EmbeddedDocumentBinaryObject must be a valid Base64-encoded SHA-256 digest chaining to the previous invoice.
Simplified Invoice Transaction Flag Restrictions
Simplified tax invoices (02xxxxx) cannot enable export (position 5 = 1) or self-billed (position 7 = 1) transaction flags.
Invoice Counter Value (ICV) Mandatory & Positive
Every Phase 2 invoice must include an AdditionalDocumentReference with ID='ICV' and a positive integer in cbc:UUID.
Seller Building Number Must Be 4 Digits
Seller PostalAddress/cbc:BuildingNumber must be exactly 4 numeric digits matching Saudi National Address format.
Seller VAT Registration Number Mandatory (BT-31)
Seller PartyTaxScheme/cbc:CompanyID is mandatory on all ZATCA e-invoices.
Seller VAT Number 15-Digit Format Starting & Ending With 3
Seller VAT number must consist of exactly 15 numeric digits where both the first and fifteenth digits are '3'.
Buyer Registration Name Mandatory on Standard Invoices (BT-44)
On Standard Tax Invoices (01xxxxx), buyer cbc:RegistrationName under cac:AccountingCustomerParty is mandatory.
Buyer VAT Number 15-Digit Format on Non-Export Invoices
When Buyer VAT number (BT-48) is present on a non-export invoice, it must be 15 digits starting and ending with '3'.
VAT Breakdown Taxable Amount Mandatory (BT-116)
Every cac:TaxSubtotal element must contain a valid cbc:TaxableAmount.
Export Invoice Must Omit Buyer VAT Number
When KSA-2 position 5 is '1' (Export invoice), Buyer VAT registration number (BT-48) must NOT be present.
Buyer National ID (NAT) Mandatory for EDU / HEA Exemptions
When exemption code is VATEX-SA-EDU or VATEX-SA-HEA, Buyer PartyIdentification/cbc:ID is mandatory with schemeID='NAT'.
Line VAT Amount Calculation (KSA-11)
Line VAT amount (cac:InvoiceLine/cac:TaxTotal/cbc:TaxAmount) must equal LineExtensionAmount (BT-131) * Line VAT Rate (BT-152) / 100.
Line Total With VAT Calculation (KSA-12 / RoundingAmount)
Line RoundingAmount (KSA-12) must equal LineExtensionAmount (BT-131) plus Line VAT Amount (KSA-11).
Line VAT Amount Mandatory on Standard Invoices (KSA-11)
Each InvoiceLine on Standard Tax Invoices and associated notes must include cac:TaxTotal/cbc:TaxAmount.
Credit/Debit Note Billing Reference Mandatory (BT-25)
Credit notes (381) and debit notes (383) must reference the original invoice number in cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID.
Cryptographic Stamp Block Presence on Simplified Invoices (KSA-15)
Simplified tax invoices (02xxxxx) must contain an ext:UBLExtensions signature block generated by the EGS device before reporting. Note: local preflight verifies structural presence only, not CA trust.
Previous Invoice Hash (PIH) Element Mandatory (KSA-13)
Every Phase 2 invoice must contain an AdditionalDocumentReference with cbc:ID='PIH' carrying the previous invoice hash.
Saudi Buyer National Address Completeness on Standard Invoices
If Buyer Country is 'SA' on a Standard Tax Invoice, StreetName, BuildingNumber, CitySubdivisionName (District), CityName, PostalZone, and Country are all mandatory.
Seller Address Additional Number (PlotIdentification) Must Be 4 Digits
If Seller cbc:PlotIdentification (KSA-23) is present, it must consist of exactly 4 numeric digits.
Buyer Address Additional Number Must Be 4 Digits (KSA-19)
GIC checks that Buyer Address Additional Number (KSA-19 / cbc:PlotIdentification) is exactly 4 numeric digits whenever present. The official status of rule ID BR-KSA-65 is under review (see verification status).
Seller Postal Code Must Be 5 Digits
Seller cbc:PostalZone must contain exactly 5 numeric digits for Saudi Arabia addresses.
Saudi Buyer Postal Code Must Be 5 Digits
When Buyer Country is 'SA', Buyer cbc:PostalZone must consist of exactly 5 numeric digits.
Tax Currency Code Must Equal SAR
cbc:TaxCurrencyCode is mandatory on all ZATCA e-invoices and must strictly be set to 'SAR', even if DocumentCurrencyCode is foreign.
Zero-Rated VAT Breakdown Reason Code & Text Mandatory
Every VAT breakdown (BG-23) with category 'Z' must include both a ZATCA VATEX-SA-* cbc:TaxExemptionReasonCode and cbc:TaxExemptionReason text.
Invoice Issue Time Format Mandatory (KSA-25)
cbc:IssueTime is mandatory and must match strict 24-hour format hh:mm:ss (AST) or hh:mm:ssZ (UTC).
Alternative Buyer ID Required When Buyer VAT Is Absent (BT-46)
On Standard Tax Invoices (01xxxxx), if Buyer VAT (BT-48) is not supplied, an alternative Buyer PartyIdentification/cbc:ID (BT-46) is mandatory.
Out-of-Scope VAT Breakdown Reason Text Mandatory (BT-120)
VAT breakdowns with category 'O' (Out of scope) must specify cbc:TaxExemptionReason explaining why the supply is outside VAT scope.
Official OASIS UBL 2.1 XSD & Full ZATCA Schematron JAR (Unsupported Locally)
Full official OASIS UBL 2.1 XSD schema validation and complete ZATCA Schematron XSLT ruleset require the official ZATCA Fatoora Java/.NET CLI SDK and are explicitly outside offline preflight scope.
XAdES ECDSA Signature & ZATCA Sub-CA Trust Chain Verification (Unsupported Locally)
Cryptographic signature validation against ZATCA's Production/Compliance Sub-CA certificates cannot be performed without ZATCA's authoritative trust store and online clearance/reporting API.