Building across multiple Arabic & GCC document types? Explore our unified Arabic OCR API & Bilingual Document Hub (PDFs, ZATCA invoices, Emirates ID, Iqama, Istimara, Mulkiya & health cards).
Arabic OCR Hub

ZATCA Invoice Scanner & Bilingual GCC VAT OCR API

Extract bilingual Arabic–English line items, validate 15-digit Saudi VAT (3...3) and UAE TRN (100...) numbers, and cross-check ZATCA Phase 1 & Phase 2 TLV QR totals against printed invoice values in a single REST API call.

200 free credits = 66 Invoice scans, no credit card. Then from $5 for 500 credits, pay as you go. See pricing

ZATCA bilingual Saudi Arabic-English tax invoice with QR code transforming into structured gcc_compliance JSON with validated 15-digit VAT number and cross-check flags

Why Generic Invoice OCR Breaks on Saudi ZATCA & UAE Tax Invoices

Accounts payable teams across Saudi Arabia and the UAE receive thousands of bilingual Arabic–English PDF and scanned supplier invoices every month. Standard OCR engines reverse right-to-left (RTL) Arabic seller names, misread Eastern Arabic-Indic numerals (٠١٢٣٤٥٦٧٨٩) in SAR/AED totals, and ignore GCC tax compliance checks—leaving ERP teams to manually verify 15-digit Saudi VAT numbers, UAE TRNs, and whether printed totals actually match the invoice's ZATCA Fatoora TLV QR payload.

Full-Invoice Bilingual OCR + Deterministic gcc_compliance Verification

With StructOCR's Invoice OCR API (POST /v1/invoice), one API call reads printed bilingual headers and multi-page line items (up to 5 pages per PDF), normalizes Eastern Arabic numerals to Western digits (0–9), and appends a deterministic gcc_compliance block whenever Saudi (SAR) or UAE (AED) context is detected. Need an instant zero-upload browser check on a single QR image or Base64 string first? Use our free ZATCA QR Code Scanner, or explore our unified Arabic OCR API Hub for broader GCC document pipelines.

Need more testing? Create a free account to get 200 free credits (equals 66 Invoice scans).

GCC Accounts Payable & ERP Verification Workflows

Saudi AP Intake & ZATCA Mismatch Flagging

Automatically compare printed invoice totals, VAT amounts, and 15-digit seller VAT numbers against decoded ZATCA Phase 1/2 TLV fields (0.02 SAR tolerance) and route has_mismatch: true bills for AP review before ERP posting.

UAE FTA Tax Invoice & 15-Digit TRN Validation

Normalize bilingual Dubai and Abu Dhabi supplier invoices in AED, validate 15-digit UAE Tax Registration Numbers (100...), and map subtotal, 5% VAT, IBAN, and line items straight into NetSuite, SAP, Odoo, or Zoho Books.

Multi-Page Construction, Trading & Logistics Invoices

Process multi-page bilingual supplier PDFs (up to 5 pages per request) where line items span across pages and final VAT summaries appear on the last page—eliminating manual line-by-line keying.

Procurement Audit & Bilingual Document Archival

Preserve clean UTF-8 Arabic and English vendor descriptions alongside normalized ISO YYYY-MM-DD invoice dates, currency codes, and IBANs without reversed RTL text artifacts.

Technical Specs

  • Endpoint: `POST https://api.structocr.com/v1/invoice`
  • Authentication: `x-api-key` header + `Content-Type: application/json`
  • Input: Base64 string or Data URI (`img` / `image`) up to 4.5 MB decoded — PDF (up to 5 pages), JPG, PNG, WebP, HEIC
  • GCC Validation: Auto-emits `gcc_compliance` for Saudi Arabia (`SAU` / 15-digit VAT `^3\d{13}3$`) and UAE (`ARE` / 15-digit TRN `^100\d{12}$`)
  • ZATCA TLV Scope: Decodes Phase 1 Tags 1–5 & Phase 2 Tags 6–9 when readable Base64 text is present, with `0.02` cross-check tolerance
  • Pricing: 3 credits per invoice request (200 free sign-up credits = 66 invoices; automatic refund on failed calls)

Key Features

  • No hallucinated QR payloads: Strictly sets `zatca_qr` to `null` unless a readable raw Base64 TLV payload is present—never guesses binary bytes from pixels.
  • Arabic-Indic numeral normalization: Converts Eastern Arabic digits (`٠–٩`) in totals, dates, and VAT/TRN fields to standard Western numerals (`0–9`).
  • Dual-layer financial extraction: Captures document-level `subtotal`, `tax_amount`, `tax_breakdown`, `total_amount`, `iban`, and full multi-page `line_items`.
  • Read-only AP scope: Purpose-built for receiving and auditing supplier invoices—distinct from ZATCA Fatoora XML signing or e-invoice issuance.

Verify Saudi ZATCA & UAE Supplier Invoices via POST /v1/invoice

Send a Base64-encoded PDF (up to 5 pages), JPG, PNG, WebP, or HEIC invoice up to 4.5 MB to POST /v1/invoice with your x-api-key header. Inspect data.gcc_compliance to gate ERP ingestion on valid 15-digit tax IDs and ZATCA cross-checks. See full schema details in the Invoice OCR API Reference.

import base64
import os
import requests

with open("saudi_supplier_invoice.pdf", "rb") as f:
    encoded = base64.b64encode(f.read()).decode("utf-8")

response = requests.post(
    "https://api.structocr.com/v1/invoice",
    headers={
        "x-api-key": os.environ["STRUCTOCR_API_KEY"],
        "Content-Type": "application/json",
    },
    json={"img": f"data:application/pdf;base64,{encoded}"},
    timeout=60,
)
response.raise_for_status()
data = response.json()["data"]

gcc = data.get("gcc_compliance") or {}
qr = gcc.get("zatca_qr") or {}

print("Jurisdiction:", gcc.get("jurisdiction"))
print("Tax ID Valid:", gcc.get("tax_id_valid"), gcc.get("tax_id_normalized"))
print("ZATCA Mismatch:", (qr.get("cross_check") or {}).get("has_mismatch"))
print("Line Items Extracted:", len(data.get("line_items", [])))

Structured JSON Output with gcc_compliance (Synthetic Example)

Synthetic bilingual Saudi tax invoice response illustrating the exact POST /v1/invoice contract, including merchant, financials, line_items, and deterministic gcc_compliance cross-check fields.

{
  "success": true,
  "data": {
    "type": "invoice",
    "invoice_number": "KSA-INV-2026-0842",
    "date": "2026-11-18",
    "due_date": "2026-12-18",
    "currency": "SAR",
    "language": "ar",
    "merchant": {
      "name": "Al-Riyadh Industrial Supplies Co. / شركة الرياض للتوريدات الصناعية",
      "address": "King Fahd Rd, Olaya District, Riyadh 12214, Saudi Arabia",
      "email": "[email protected]",
      "phone": "+966 11 555 0192",
      "tax_id": "310482910400003",
      "iban": "SA4420000001234567890001",
      "swift_bic": "RIBLSARI"
    },
    "customer": {
      "name": "Gulf Logistics & Contracting LLC",
      "address": "Dammam Second Industrial City, Saudi Arabia",
      "email": "[email protected]",
      "tax_id": "300918273600003"
    },
    "financials": {
      "subtotal": 12000,
      "tax_amount": 1800,
      "discount_amount": null,
      "shipping_amount": null,
      "total_amount": 13800,
      "tax_inclusive": false,
      "tax_breakdown": [
        {
          "tax_rate": "15%",
          "tax_amount": 1800
        }
      ]
    },
    "line_items": [
      {
        "description": "Industrial Safety Harness Kit / طقم حزام أمان صناعي",
        "quantity": 40,
        "unit_price": 200,
        "tax_rate": "15%",
        "amount": 8000
      },
      {
        "description": "Thermal Label Roll 100x150mm / لفة ملصقات حرارية",
        "quantity": 80,
        "unit_price": 50,
        "tax_rate": "15%",
        "amount": 4000
      }
    ],
    "gcc_compliance": {
      "jurisdiction": "SAU",
      "tax_id_type": "ksa_vat",
      "tax_id_normalized": "310482910400003",
      "tax_id_valid": true,
      "zatca_qr": {
        "valid": true,
        "phase": 2,
        "seller_name": "Al-Riyadh Industrial Supplies Co. (شركة الرياض للتوريدات الصناعية)",
        "vat_registration_number": "310482910400003",
        "timestamp": "2026-11-18T14:22:09Z",
        "invoice_total": 13800,
        "vat_total": 1800,
        "phase2": {
          "xml_invoice_hash": "NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==",
          "ecdsa_signature": "MEUCIQDfSyntheticSignatureExample0001AiEAk9SyntheticExample==",
          "ecdsa_public_key": "MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAESyntheticPublicKeyExample==",
          "cryptographic_stamp_signature": "MEQCICSyntheticZatcaStampExample0002AiB8SyntheticExample=="
        },
        "error": null,
        "cross_check": {
          "vat_match": true,
          "total_match": true,
          "tax_match": true,
          "has_mismatch": false
        }
      }
    }
  }
}

Frequently Asked Questions

What is the difference between this ZATCA Invoice OCR API and the free ZATCA QR Code Scanner?

The free ZATCA QR Code Scanner (/tools/zatca-qr-code-scanner) is a zero-upload browser utility that decodes a single QR image or Base64 TLV string locally at 0 credits. This commercial solution uses POST /v1/invoice to automate full supplier invoice OCR—extracting bilingual Arabic–English headers, multi-page line items, tax breakdowns, IBANs, 15-digit Saudi VAT / UAE TRN checks, and ZATCA TLV cross-checks in one REST API call.

Does StructOCR sign XML invoices or submit e-invoices to ZATCA Fatoora?

No. StructOCR is a read-only OCR and accounts-payable verification API for incoming supplier invoices. It extracts printed fields, validates 15-digit Saudi VAT and UAE TRN formats, and decodes Phase 1/2 TLV QR metadata—it does not perform Fatoora XML signing, CSID onboarding, or tax clearance.

How does POST /v1/invoice handle ZATCA QR codes vs printed Base64 TLV strings?

To enforce strict anti-hallucination guarantees, POST /v1/invoice only populates gcc_compliance.zatca_qr when an explicit, readable Base64 ZATCA TLV payload is present on the document or text layer—it never fabricates Base64 bytes from QR code pixels. When decoded, it parses Phase 1 Tags 1–5 and Phase 2 Tags 6–9 and cross-checks VAT number, invoice total, and VAT total against OCR-extracted figures within a 0.02 tolerance.

How does StructOCR validate Saudi Arabia VAT numbers and UAE TRNs?

Eastern Arabic-Indic numerals (٠–٩), spaces, and hyphens are normalized first. Saudi VAT numbers (jurisdiction: SAU) are validated against the 15-digit ZATCA format starting and ending with 3 (^3\d{13}3$). UAE Tax Registration Numbers (jurisdiction: ARE) are validated against the standard 15-digit FTA format beginning with 100 (^100\d{12}$).

Can POST /v1/invoice process multi-page Arabic–English PDF invoices?

Yes. Each call to POST /v1/invoice accepts a native multi-page PDF up to 5 pages (max 4.5 MB decoded) and extracts all line items across pages together with the final tax summary. For general Arabic PDFs over 5 pages or custom JSON schemas up to 20 pages, use POST /v1/pdf-extract.

How much does ZATCA & GCC invoice OCR cost?

Every POST /v1/invoice request costs 3 permanent credits ($0.0174/invoice on the Pro pack or $0.03/invoice on the Mini pack). New accounts receive 200 permanent free credits (66 full invoice scans) with no credit card required, and failed requests are refunded automatically.

Explore More Invoice & Accounts Payable OCR Solutions

Core Infrastructure

Accounts Payable & Invoice OCR API

Automate vendor invoice ingestion across global and GCC tax formats with multi-page PDF line-item extraction, VAT/TRN checks, and ERP-ready JSON.

Technical Comparisons & Integrations

Explore platform integrations and competitive analysis

From tutorial to production in 5 minutes.

You've seen the code. Now get your API key, grab your 200 free credits, and see it work with your own images. No credit card required.

Instant Access Cancel Anytime No Credit Card