Skip to main content

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

JOF-01
jofotaraImplemented

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.

Document HeaderInspect & Fix
JOF-02
jofotaraImplemented

Mandatory JoFotara Invoice ID (cbc:ID)

Every JoFotara invoice must provide a non-empty unique invoice sequence ID in cbc:ID.

Document HeaderInspect & Fix
JOF-03
jofotaraImplemented

Valid RFC 4122 Invoice UUID

JoFotara requires a valid RFC 4122 UUID inside cbc:UUID for deduplication and QR linking.

Document HeaderInspect & Fix
JOF-04
jofotaraImplemented

Mandatory ISO IssueDate (YYYY-MM-DD)

cbc:IssueDate must be present and formatted strictly as YYYY-MM-DD.

Document HeaderInspect & Fix
JOF-05
jofotaraImplemented

JoFotara Document Type Code (388 Invoice / 381 Credit Note)

cbc:InvoiceTypeCode must be '388' for standard invoices or '381' for credit/return notes.

Document HeaderInspect & Fix
JOF-06
jofotaraImplemented

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).

Document HeaderInspect & Fix
JOF-07
jofotaraImplemented

Domestic Currency Code JOD

Domestic JoFotara invoices use DocumentCurrencyCode 'JOD' (3 decimal places / fils).

Document HeaderInspect & Fix
JOF-08
jofotaraImplemented

Invoice Counter Value (ICV) Mandatory

JoFotara requires an AdditionalDocumentReference with cbc:ID='ICV' and a positive sequential integer in cbc:UUID.

Document HeaderInspect & Fix
JOF-09
jofotaraImplemented

Supplier TIN, Registration Name & Country JO

cac:AccountingSupplierParty must specify the taxpayer's ISTD Tax Number (PartyTaxScheme/CompanyID), RegistrationName, and Country='JO'.

Seller PartyInspect & Fix
JOF-10
jofotaraImplemented

Seller Income Source Sequence (SellerSupplierParty)

JoFotara requires the registered Income Source Sequence number under cac:SellerSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID.

Seller PartyInspect & Fix
JOF-11
jofotaraImplemented

Credit Note (381) Original Reference & Return Reason

Return/credit notes (381) must include BillingReference/InvoiceDocumentReference/ID and PaymentMeans/InstructionNote reason.

Credit NotesInspect & Fix
JOF-12
jofotaraImplemented

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.

Buyer PartyInspect & Fix
JOF-13
jofotaraImplemented

At Least One InvoiceLine Required

Every JoFotara invoice must include at least one cac:InvoiceLine node.

Invoice LinesInspect & Fix
JOF-14
jofotaraImplemented

JoFotara Line Net Amount Arithmetic

Each InvoiceLine must have positive quantity, valid unit price, and LineExtensionAmount equal to (Quantity * PriceAmount) - Discount.

Invoice LinesInspect & Fix
JOF-15
jofotaraImplemented

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.

Tax CategoriesInspect & Fix
JOF-16
jofotaraImplemented

JoFotara LegalMonetaryTotal & Document Tax Consistency

TaxExclusiveAmount, TaxTotal/TaxAmount, TaxInclusiveAmount, and PayableAmount must reconcile cleanly against line sums using Decimal math.

Monetary TotalsInspect & Fix
QR-01
zatca_qrImplemented

Strict Base64 Payload Encoding

ZATCA QR payloads must decode cleanly using standard Base64 alphabet and valid padding without non-Base64 characters.

EncodingInspect & Fix
QR-02
zatca_qrImplemented

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 FramingInspect & Fix
QR-03
zatca_qrImplemented

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.

TLV FramingInspect & Fix
QR-04
zatca_qrImplemented

No Duplicate TLV Tags

Official ZATCA tags (1–9) must each appear at most once inside a QR payload.

TLV FramingInspect & Fix
QR-05
zatca_qrImplemented

ZATCA 700-Character Base64 QR Size Guideline

ZATCA's Security Features Implementation Standard caps printed QR Base64 strings at 700 characters for scanner reliability.

Payload LimitsInspect & Fix
QR-06
zatca_qrImplemented

QR Tag 2 Seller VAT Number Format

Tag 2 must contain a 15-digit Saudi VAT registration number starting and ending with '3'.

Field ValidationInspect & Fix
QR-07
zatca_qrImplemented

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).

Field ValidationInspect & Fix
QR-08
zatca_qrImplemented

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.

Field ValidationInspect & Fix
QR-09
zatca_qrImplemented

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.

CompletenessInspect & Fix
QR-10
zatca_qrImplemented

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.

Cross-ConsistencyInspect & Fix
QR-CRYPTO-SCOPE
zatca_qrUnsupported

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.

Unsupported ScopeInspect & Fix
BR-01
zatcaImplemented

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>.

Document HeaderInspect & Fix
BR-02
zatcaImplemented

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.

Document HeaderInspect & Fix
BR-04
zatcaImplemented

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).

Document HeaderInspect & Fix
BR-05
zatcaImplemented

ISO 4217 Document Currency Code (BT-5)

The invoice must specify a 3-letter ISO 4217 cbc:DocumentCurrencyCode (typically SAR).

Document HeaderInspect & Fix
BR-06
zatcaImplemented

Mandatory Seller Registration Name (BT-27)

The seller legal registration name must be present under cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName.

Seller PartyInspect & Fix
BR-16
zatcaImplemented

At Least One Invoice Line Required (BG-25)

A valid UBL invoice must contain at least one cac:InvoiceLine element.

Invoice LinesInspect & Fix
BR-CO-10
zatcaImplemented

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).

Monetary TotalsInspect & Fix
BR-CO-13
zatcaImplemented

Invoice Total Without VAT Calculation (BT-109)

TaxExclusiveAmount (BT-109) must equal LineExtensionAmount (BT-106) minus AllowanceTotalAmount (BT-107) plus ChargeTotalAmount (BT-108).

Monetary TotalsInspect & Fix
BR-CO-14
zatcaImplemented

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.

Tax BreakdownInspect & Fix
BR-CO-15
zatcaImplemented

Invoice Total With VAT Calculation (BT-112)

TaxInclusiveAmount (BT-112) must equal TaxExclusiveAmount (BT-109) plus TaxTotal/TaxAmount (BT-110).

Monetary TotalsInspect & Fix
BR-CO-16
zatcaImplemented

Payable Amount Calculation (BT-115)

PayableAmount (BT-115) must equal TaxInclusiveAmount (BT-112) minus PrepaidAmount (BT-113) plus PayableRoundingAmount (BT-114).

Monetary TotalsInspect & Fix
BR-S-09
zatcaImplemented

Standard VAT Breakdown Tax Calculation

For Standard-rated (S) VAT breakdowns, TaxSubtotal/TaxAmount must equal TaxableAmount * Percent / 100 (within 0.01 rounding tolerance).

Tax BreakdownInspect & Fix
BR-KSA-03
zatcaImplemented

RFC 4122 Invoice UUID Mandatory (KSA-1)

Every ZATCA Phase 2 invoice must include a unique RFC 4122 UUID inside cbc:UUID.

Document HeaderInspect & Fix
BR-KSA-04
zatcaImplemented

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).

Document HeaderInspect & Fix
BR-KSA-06
zatcaImplemented

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).

Document HeaderInspect & Fix
BR-KSA-08
zatcaImplemented

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 PartyInspect & Fix
BR-KSA-09
zatcaImplemented

Seller Saudi National Address Completeness

Seller PostalAddress must contain StreetName, BuildingNumber, CitySubdivisionName (District), CityName, PostalZone, and Country IdentificationCode.

Seller AddressInspect & Fix
BR-KSA-10
zatcaImplemented

Buyer Address Completeness on Standard Tax Invoices

Standard Tax Invoices (01xxxxx) must populate Buyer StreetName, CityName, PostalZone, and Country IdentificationCode.

Buyer AddressInspect & Fix
BR-KSA-14
zatcaImplemented

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).

Buyer PartyInspect & Fix
BR-KSA-15
zatcaImplemented

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.

DeliveryInspect & Fix
BR-KSA-16
zatcaImplemented

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.

PaymentInspect & Fix
BR-KSA-17
zatcaImplemented

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.

Credit & Debit NotesInspect & Fix
BR-KSA-18
zatcaImplemented

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).

Tax CategoriesInspect & Fix
BR-KSA-20
zatcaImplemented

Line-Level Charge Reason Code Mandatory (BT-145)

Any line-level cac:AllowanceCharge with ChargeIndicator=true must specify cbc:AllowanceChargeReasonCode.

Invoice LinesInspect & Fix
BR-KSA-21
zatcaImplemented

Document-Level Charge Reason Text Mandatory (BT-104)

Any document-level cac:AllowanceCharge with ChargeIndicator=true must specify cbc:AllowanceChargeReason.

Allowances & ChargesInspect & Fix
BR-KSA-23
zatcaImplemented

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.

Tax BreakdownInspect & Fix
BR-KSA-24
zatcaImplemented

Exempt VAT Breakdown Reason Text (BT-120)

A VAT breakdown with category 'E' must include cbc:TaxExemptionReason text describing the statutory exemption.

Tax BreakdownInspect & Fix
BR-KSA-25
zatcaImplemented

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.

Buyer PartyInspect & Fix
BR-KSA-26
zatcaImplemented

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.

Hash Chain & SecurityInspect & Fix
BR-KSA-31
zatcaImplemented

Simplified Invoice Transaction Flag Restrictions

Simplified tax invoices (02xxxxx) cannot enable export (position 5 = 1) or self-billed (position 7 = 1) transaction flags.

Document HeaderInspect & Fix
BR-KSA-33
zatcaImplemented

Invoice Counter Value (ICV) Mandatory & Positive

Every Phase 2 invoice must include an AdditionalDocumentReference with ID='ICV' and a positive integer in cbc:UUID.

Hash Chain & SecurityInspect & Fix
BR-KSA-37
zatcaImplemented

Seller Building Number Must Be 4 Digits

Seller PostalAddress/cbc:BuildingNumber must be exactly 4 numeric digits matching Saudi National Address format.

Seller AddressInspect & Fix
BR-KSA-39
zatcaImplemented

Seller VAT Registration Number Mandatory (BT-31)

Seller PartyTaxScheme/cbc:CompanyID is mandatory on all ZATCA e-invoices.

Seller PartyInspect & Fix
BR-KSA-40
zatcaImplemented

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'.

Seller PartyInspect & Fix
BR-KSA-42
zatcaImplemented

Buyer Registration Name Mandatory on Standard Invoices (BT-44)

On Standard Tax Invoices (01xxxxx), buyer cbc:RegistrationName under cac:AccountingCustomerParty is mandatory.

Buyer PartyInspect & Fix
BR-KSA-44
zatcaImplemented

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'.

Buyer PartyInspect & Fix
BR-KSA-45
Under ReviewzatcaImplemented

VAT Breakdown Taxable Amount Mandatory (BT-116)

Every cac:TaxSubtotal element must contain a valid cbc:TaxableAmount.

Tax BreakdownInspect & Fix
BR-KSA-46
zatcaImplemented

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 PartyInspect & Fix
BR-KSA-49
zatcaImplemented

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'.

Buyer PartyInspect & Fix
BR-KSA-50
Under ReviewzatcaImplemented

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.

Invoice LinesInspect & Fix
BR-KSA-51
zatcaImplemented

Line Total With VAT Calculation (KSA-12 / RoundingAmount)

Line RoundingAmount (KSA-12) must equal LineExtensionAmount (BT-131) plus Line VAT Amount (KSA-11).

Invoice LinesInspect & Fix
BR-KSA-52
zatcaImplemented

Line VAT Amount Mandatory on Standard Invoices (KSA-11)

Each InvoiceLine on Standard Tax Invoices and associated notes must include cac:TaxTotal/cbc:TaxAmount.

Invoice LinesInspect & Fix
BR-KSA-56
zatcaImplemented

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.

Credit & Debit NotesInspect & Fix
BR-KSA-60
zatcaPartial

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.

Hash Chain & SecurityInspect & Fix
BR-KSA-61
zatcaImplemented

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.

Hash Chain & SecurityInspect & Fix
BR-KSA-63
zatcaImplemented

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.

Buyer AddressInspect & Fix
BR-KSA-64
Under ReviewzatcaImplemented

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.

Seller AddressInspect & Fix
BR-KSA-65
Under ReviewzatcaImplemented

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).

Buyer AddressInspect & Fix
BR-KSA-66
zatcaImplemented

Seller Postal Code Must Be 5 Digits

Seller cbc:PostalZone must contain exactly 5 numeric digits for Saudi Arabia addresses.

Seller AddressInspect & Fix
BR-KSA-67
zatcaImplemented

Saudi Buyer Postal Code Must Be 5 Digits

When Buyer Country is 'SA', Buyer cbc:PostalZone must consist of exactly 5 numeric digits.

Buyer AddressInspect & Fix
BR-KSA-68
zatcaImplemented

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.

Document HeaderInspect & Fix
BR-KSA-69
zatcaImplemented

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.

Tax BreakdownInspect & Fix
BR-KSA-70
zatcaImplemented

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).

Document HeaderInspect & Fix
BR-KSA-81
zatcaImplemented

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.

Buyer PartyInspect & Fix
BR-KSA-83
zatcaImplemented

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.

Tax BreakdownInspect & Fix
ZATCA-SCOPE-XSD-SCHEMATRON
zatcaUnsupported

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.

Unsupported ScopeInspect & Fix
ZATCA-SCOPE-XADES-CA
zatcaUnsupported

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.

Unsupported ScopeInspect & Fix