ZATCA Error Codes Guide: Common Errors & How to Fix Them

Atif Mehmood March 25, 2026 9 min read Troubleshooting

When you submit an e-invoice to ZATCA and it gets rejected, the API response contains error codes that tell you exactly what went wrong. This guide documents the most common ZATCA error codes, explains what they mean, and provides step-by-step fixes for each one.

Whether you are debugging a ZATCA integration or troubleshooting rejected invoices in production, this reference will help you resolve errors quickly.

Understanding ZATCA Response Statuses

ZATCA invoice pending and response statuses

ZATCA invoice status showing pending, cleared, and rejected states

When you submit an invoice to ZATCA's API, you receive one of three response statuses:

StatusMeaningAction Required
REPORTED / CLEAREDInvoice accepted by ZATCANone — invoice is valid
REPORTED WITH WARNINGSInvoice accepted but has issuesReview and fix warnings
REJECTEDInvoice failed validationFix errors and resubmit

Errors vs Warnings

Errors cause rejection — the invoice is not legally valid until fixed. Warnings are accepted but indicate potential problems. ZATCA may escalate repeated warnings to mandatory errors in future updates, so always address warnings promptly.

Invoice Structure Errors (BR-KSA)

BR-KSA codes are Saudi-specific business rules. These are the most common errors:

BR-KSA-F-06
Invoice line ID must be sequential starting from 1
Each InvoiceLine element must have an ID that starts at 1 and increments by 1. IDs starting at 0, containing letters, or skipping numbers will trigger this error.
Fix: Ensure your system assigns line IDs as 1, 2, 3... for each invoice. Do not use product SKUs or generated strings as line IDs.
BR-KSA-31
Seller name must be provided in Arabic
The RegistrationName under AccountingSupplierParty must contain Arabic characters. English-only seller names are rejected.
Fix: Configure your business profile with the Arabic company name. The system should use this Arabic name in the RegistrationName XML field.
BR-KSA-25
VAT registration number format invalid
The seller's VAT number must be exactly 15 digits, starting with "3" and ending with "3". Any other format is rejected.
Fix: Verify your VAT registration number in ZATCA's portal. The format is 3XXXXXXXXXXX3 (15 digits). Update your business settings with the correct number.
BR-KSA-40
Invoice hash does not match
The SHA-256 hash of the XML does not match the hash provided in the AdditionalDocumentReference. This typically means the XML was modified after hash computation.
Fix: Ensure the hash is computed after all XML modifications are complete and before submission. Do not alter the XML between hashing and sending.
BR-KSA-44
QR code data does not match invoice data
The seller name, VAT number, total, or VAT amount encoded in the QR code's TLV structure does not match the corresponding values in the XML invoice.
Fix: Generate the QR code from the same data source as the XML. Do not build QR data independently — extract values from the finalized XML. See our QR code requirements guide for the correct process.
BR-KSA-46
Digital signature validation failed
The XML Digital Signature (XMLDsig) could not be verified. The signature either does not match the invoice content or was generated with an invalid certificate.
Fix: Verify your CSID (certificate) is valid and not expired. Ensure the signing process uses canonical XML (C14N) and the correct SignedProperties reference.

VAT Calculation Errors

BR-CO-15
Invoice line VAT amount incorrect
The VAT amount on an invoice line does not equal the line amount multiplied by the VAT percentage. Rounding differences of more than 0.01 SAR trigger this error.
Fix: Recalculate VAT per line: TaxAmount = LineExtensionAmount × (Percent / 100). Round to 2 decimal places. Ensure the sum of line-level VAT equals the invoice-level TaxAmount.
BR-DEC-13
Amount decimal precision exceeded
Monetary amounts must have at most 2 decimal places. Values like 10.123 SAR are rejected.
Fix: Round all monetary amounts to 2 decimal places before generating the XML.
BR-S-08
Standard rate VAT is not 15%
When using VAT category code "S" (standard rate), the percentage must be exactly 15. Any other value is rejected for Saudi invoices.
Fix: Set the Percent element to exactly 15 for all standard-rated items. If the item is zero-rated or exempt, use category code Z or E instead.

Certificate and Authentication Errors

HTTP 401
Unauthorized — Authentication failed
The API credentials (CSID token) sent in the request header are invalid, expired, or formatted incorrectly.
Fix: Check that your Authorization header uses the correct Base64-encoded CSID. Verify the certificate has not expired. If using sandbox, ensure you are using a compliance CSID, not production.
HTTP 400
Bad Request — Malformed request body
The request body is not valid JSON or the required fields (invoiceHash, uuid, invoice) are missing or malformed.
Fix: Verify your request body contains all three required fields: invoiceHash (Base64 SHA-256), uuid (same as in XML), and invoice (Base64-encoded signed XML).

Common Warning Codes

CodeDescriptionRecommended Action
BT-32Buyer VAT number not provided on B2B invoiceAdd buyer's VAT number for B2B transactions
BR-KSA-68Postal code format does not match Saudi patternUse 5-digit Saudi postal code format
BR-KSA-70Building number not provided in addressAdd building number to seller/buyer address

Prevent Errors Before They Happen

Using a validated ZATCA POS system like LookPOS prevents virtually all of these errors. The system validates XML structure, calculates VAT accurately, generates correct QR codes, and handles digital signatures automatically — so your invoices pass ZATCA validation every time.

Stop Debugging ZATCA Errors Manually

LookPOS handles all ZATCA compliance automatically — correct XML structure, valid signatures, accurate calculations, and proper QR codes. Focus on your business, not error codes.

Start Free Trial Get Help Now

Debugging Tips

  1. Always test in sandbox first. Submit invoices to ZATCA's sandbox environment before going live. The sandbox returns the same error codes as production.
  2. Log the full ZATCA response. Store the complete JSON response including validationResults, warningMessages, and errorMessages for debugging.
  3. Validate XML schema locally. Use an XML validator against the ZATCA XSD schema before submitting. This catches structural errors instantly.
  4. Check the previous invoice hash chain. If hash errors appear suddenly on invoices that previously worked, the hash chain may be broken. Verify the previous invoice hash matches the SHA-256 of the prior invoice.
  5. Verify certificate expiry. Production CSIDs expire after one year. Set up monitoring to renew before expiry.

For technical details on the XML format and API integration, refer to our dedicated guides.

ZATCA compliance dashboard overview

Frequently Asked Questions

What does ZATCA REJECTED status mean? +

REJECTED means your invoice failed one or more ZATCA validation rules. The invoice is not legally valid and cannot be used. You must fix all errors in the response, regenerate the invoice, and resubmit it to ZATCA.

How do I find out which errors my invoice has? +

ZATCA includes error details in the API response. Look for the validationResults section which contains errorMessages (causing rejection) and warningMessages (informational). Each message has a code, type, category, and human-readable description. Your e-invoicing system should present these clearly.

Can warnings become errors in the future? +

Yes. ZATCA has progressively upgraded several warning codes to errors in past updates. Fields that were once optional become mandatory over time. It is best practice to address all warnings immediately rather than waiting for them to become blocking errors.

My invoices were working but suddenly get rejected — why? +

Common causes: (1) Your CSID certificate expired — renew it. (2) ZATCA updated their validation rules — check ZATCA release notes. (3) The invoice hash chain broke — verify the previous invoice hash. (4) Your API endpoint URL changed — sandbox and production have different URLs.

AM

Atif Mehmood

Founder of LookPOS — Building ZATCA-compliant POS and e-invoicing solutions for businesses across Saudi Arabia since 2018.