Official ZATCA Phase 2 Technical Specifications

ZATCA Error Codes & BR-KSA Directory

Comprehensive developer reference for diagnosing and fixing ZATCA Fatoora Portal clearance and compliance rejection codes, complete with XPath contexts and UBL 2.1 XML diffs.

🔍
20+
Documented Rules & Errors
UBL 2.1
KSA XML Standard Format
100%
Copy-Paste Fix Snippets
🇸🇦
Updated for 2026 Phase 2 Waves
BR-KSA-03 📑 Invoice Types & Structure

BR-KSA-03: Invalid Universally Unique Identifier (UUID / KSA-1)

BR-KSA-03 • BR-KSA-03: المعرف الفريد العالمي غير صالح (UUID / KSA-1)

The invoice must contain a valid UUID (KSA-1) conforming to RFC 4122 standard (letters, digits, dashes).

View Solution & XML Example →
BR-KSA-04 📑 Invoice Types & Structure

BR-KSA-04: Invoice Issue Date Cannot Be in Future

BR-KSA-04 • BR-KSA-04: تاريخ إصدار الفاتورة لا يمكن أن يكون في المستقبل

The document issue date (BT-2) must be less than or equal to the current server date (KSA timezone AST / UTC+3).

View Solution & XML Example →
BR-KSA-05 📑 Invoice Types & Structure

BR-KSA-05: Invalid Invoice Type Code (BT-3)

BR-KSA-05 • BR-KSA-05: رمز نوع الفاتورة غير صالح (BT-3)

Invoice type code must be one of the agreed UN/CEFACT 1001 codes: 388 (Tax Invoice), 381 (Credit Note), 383 (Debit Note), or 386 (Prepayment).

View Solution & XML Example →
BR-KSA-06 📑 Invoice Types & Structure

BR-KSA-06: Invalid Invoice Transaction Subtype Code (NNPNESB / KSA-2)

BR-KSA-06 • BR-KSA-06: كود المعاملة الفرعية للفاتورة غير صحيح (NNPNESB / KSA-2)

The invoice transaction code (KSA-2) must exist in @name attribute of InvoiceTypeCode and respect the 7-digit NNPNESB structure.

View Solution & XML Example →
BR-KSA-08 🏢 Seller Address & Identity

BR-KSA-08: Invalid Seller Identification Scheme (BT-29)

BR-KSA-08 • BR-KSA-08: مخطط هوية البائع غير صالح (BT-29)

Seller identification must exist once with an authorized schemeID: CRN (Commercial Registration), MOM, MLS, 700, SAG, or OTH.

View Solution & XML Example →
BR-KSA-09 🏢 Seller Address & Identity

BR-KSA-09: Seller Saudi National Address Mandatory Fields Missing

BR-KSA-09 • BR-KSA-09: نقص في الحقول الإلزامية للعنوان الوطني للبائع

Seller address must contain all 6 Saudi National Address elements: Street Name, Building Number, Postal Code, City, District, and Country Code ('SA').

View Solution & XML Example →
BR-KSA-15 📑 Invoice Types & Structure

BR-KSA-15: Supply Date Mandatory for Standard Tax Invoices

BR-KSA-15 • BR-KSA-15: تاريخ التوريد إلزامي في الفواتير الضريبية القياسية

Standard tax invoices (BT-3=388 & KSA-2 starts with 01) must contain the supply date (KSA-5) in Delivery block.

View Solution & XML Example →
BR-KSA-26 🔐 Cryptography, Hash & Security

BR-KSA-26: Invalid Previous Invoice Hash Calculation (PIH / KSA-13)

BR-KSA-26 • BR-KSA-26: خطأ في احتساب هاش الفاتورة السابقة (PIH / KSA-13)

Previous invoice hash (KSA-13) must be Base64-encoded SHA-256 digest of the canonicalized previous invoice XML (or the standard zero seed for the 1st invoice).

View Solution & XML Example →
BR-KSA-27 📱 QR Code & TLV Encoding

BR-KSA-27: Mandatory QR Code (KSA-14) Missing or Malformed

BR-KSA-27 • BR-KSA-27: رمز الاستجابة السريعة (QR Code / KSA-14) مفقود أو غير مطابق

The document must contain a Base64-encoded TLV QR Code (KSA-14) formatted according to ZATCA Phase 2 security specifications.

View Solution & XML Example →
BR-KSA-31 📑 Invoice Types & Structure

BR-KSA-31: Unsupported Subtype on Simplified Tax Invoice

BR-KSA-31 • BR-KSA-31: نوع معاملة غير مسموح به في الفاتورة المبسطة

For simplified tax invoices (KSA-2 starting with 02), only third party (pos 3), nominal supply (pos 4), and summary transactions (pos 6) are allowed. Exports & self-billing are forbidden.

View Solution & XML Example →
BR-KSA-37 🏢 Seller Address & Identity

BR-KSA-37: Seller Building Number Must Be Exactly 4 Digits

BR-KSA-37 • BR-KSA-37: رقم مبنى البائع يجب أن يتكون من 4 أرقام بالضبط

The seller address building number (KSA-17) must contain exactly 4 numeric digits matching the Saudi National Address.

View Solution & XML Example →
BR-KSA-40 🏢 Seller Address & Identity

BR-KSA-40: Seller VAT Number Must Be 15 Digits Starting & Ending with 3

BR-KSA-40 • BR-KSA-40: الرقم الضريبي للبائع يجب أن يتكون من 15 رقماً يبدأ وينتهي بـ 3

Seller VAT registration number (BT-31) must contain exactly 15 digits, where the 1st digit is '3' and the 15th digit is '3'.

View Solution & XML Example →
BR-KSA-51 🧮 Tax & Line Calculations

BR-KSA-51: Line Total Amount with VAT Mismatch (KSA-12)

BR-KSA-51 • BR-KSA-51: عدم تطابق إجمالي مبلغ البند شامل الضريبة (KSA-12)

The line amount with VAT (KSA-12) must strictly equal Invoice line net amount (BT-131) + Line VAT amount (KSA-11).

View Solution & XML Example →
BR-KSA-56 🔄 Credit & Debit Notes

BR-KSA-56: Billing Reference ID Mandatory for Credit & Debit Notes

BR-KSA-56 • BR-KSA-56: مرجع الفاتورة الأصلية إلزامي للإشعارات الدائنة والمدينة

For credit notes (code 381) and debit notes (code 383), the original invoice billing reference ID (BT-25) is mandatory.

View Solution & XML Example →
BR-KSA-63 👤 Buyer Identification & Address

BR-KSA-63: Buyer Saudi National Address Mandatory When Country is 'SA'

BR-KSA-63 • BR-KSA-63: العنوان الوطني للمشتري إلزامي عندما تكون الدولة السعودية (SA)

If buyer country code is 'SA' on a Standard Tax Invoice, street name, building number, postal code (5 digits), city, district, and country code are all mandatory.

View Solution & XML Example →
BR-KSA-68 🌐 Code Lists & Currencies

BR-KSA-68: Tax Currency Code Must Exist and Be 'SAR'

BR-KSA-68 • BR-KSA-68: رمز العملة الضريبية إلزامي ويجب أن يكون 'SAR'

Tax currency code (BT-6) must exist in every invoice and be explicitly set to 'SAR' (Saudi Riyal) under EN16931 rules.

View Solution & XML Example →
BR-KSA-70 📑 Invoice Types & Structure

BR-KSA-70: Invalid Invoice Issue Time Format (KSA-25)

BR-KSA-70 • BR-KSA-70: تنسيق وقت إصدار الفاتورة غير صحيح (KSA-25)

The invoice must contain Issue Time (KSA-25) in either 'hh:mm:ss' (AST local time) or 'hh:mm:ssZ' (UTC format).

View Solution & XML Example →
BR-KSA-DEC-01 🧮 Tax & Line Calculations

BR-KSA-DEC-01: Allowance / Discount Percentage Must Have Maximum 2 Decimals

BR-KSA-DEC-01 • BR-KSA-DEC-01: نسبة الخصم يجب ألا تتجاوز خانتين عشريتين وبدون رمز %

Allowance and discount percentage values (BT-94, BT-138) must be numeric from 0.00 to 100.00 with max 2 decimals. The '%' symbol is forbidden.

View Solution & XML Example →
ZATCA-API-429 ⚡ API Clearance & Rate Limits

ZATCA API 429: Too Many Requests / Rate Limit Exceeded

ZATCA-API-429 • خطأ 429: تجاوز الحد الأقصى لمعدل الطلبات في بوابة زاتكا

ZATCA Fatoora clearance & compliance endpoints enforce throttling limits. Rapid concurrent requests trigger HTTP 429 rate limit errors.

View Solution & XML Example →
INVALID-INVOICE-HASH 🔐 Cryptography, Hash & Security

INVALID-INVOICE-HASH: Cryptographic Invoice Hash Mismatch

INVALID-INVOICE-HASH • خطأ هاش الفاتورة غير صالح: عدم تطابق بصمة الفاتورة الرقمية

The generated SHA-256 digest of the canonicalized invoice does not match the hash verified by ZATCA validator.

View Solution & XML Example →
✨ Stop Debugging Complex ZATCA Invoicing XML

Automate ZATCA Phase 2 Compliance with Qeemah

Qeemah automates BR-KSA validation, ECDSA cryptography, C14N canonicalization, and instant clearance out of the box with zero manual integration pain.