Features at a glance
Everything the package does, with the page that explains it. ⚠ marks behaviour that depends on a ZATCA rule not yet confirmed in official documentation.
Setup
| Feature | How | Docs |
|---|---|---|
| Companies (taxpayers) and VAT registrations | Zatca::companies()->create(), zatca:taxpayer:register | Devices from code, Taxpayers and devices |
| Stores / branches | Zatca::companies()->createStore(), stores in create() | Devices from code |
| Your own IDs for companies and stores | external_ref | Devices from code |
| Devices (EGS units), one or many | Zatca::devices()->register()/registerMany(), zatca:device:register | Devices from code |
| Device import from CSV / Excel, local or S3 | Zatca::devices()->import(), zatca:devices:import | Devices from code |
| Dry-run validation of a device file | validateMany(), --validate | Devices from code |
| Onboarding (key, CSR, compliance CSID, compliance checks, production CSID) | onboard(), onboardMany(), OTP column, zatca:device:onboard | Taxpayers and devices |
| Resume after failed compliance checks | resume(), --resume | Taxpayers and devices |
| Certificate renewal and expiry alerts | zatca:device:renew, zatca:devices:check-expiry | Taxpayers and devices |
| Sandbox, simulation and production | ZATCA_ENVIRONMENT, per device | Going live |
Invoicing
| Feature | How | Docs |
|---|---|---|
| B2C simplified invoices, reported within 24 h | Zatca::b2c()->issue() | B2C |
| B2B standard invoices, cleared before delivery | Zatca::b2b()->issue()/submit() | B2B |
| Validation only | validate() | Invoice payload |
| Idempotency (same number = same result) | external_id / invoice_number | B2C, HTTP API |
| Unit, line and header discounts; percentages; split over VAT groups | discount, discounts[], allowances[], distribute | Discounts |
| Charges (delivery etc.) | charges[] | Invoice payload |
| Zero-rated, exempt, out-of-scope lines | vat_category, exemption_reason_code | Invoice payload |
| QR code (TLV, phase 2) | qr in the result | B2C |
| Cleared XML for the buyer | stored artifact | B2B |
| Stored lines and VAT breakdown | $invoice->lines, vatBreakdown | Your own invoice tables |
| Link to your own invoice/order table | source option, HasZatcaInvoices | Your own invoice tables |
After issuing
| Feature | How | Docs |
|---|---|---|
| Automatic retries with backoff | workers | Rejections, retries and corrections |
| Manual retry of the identical document | retry(), zatca:invoice retry | Corrections |
| Correct a rejected or invalid invoice | correct(), zatca:invoice correct | Corrections |
| Reissue unchanged | reissueUnchanged(), zatca:invoice reissue | Corrections |
| Four-eyes approval of corrections | approve(), zatca:invoice approve | Corrections |
| Credit and debit notes, credit limit | creditNote(), debitNote(), zatca:invoice credit/debit | Credit and debit notes |
| Cancel an accepted invoice (full credit note) | cancel(), zatca:invoice cancel | Cancelling invoices |
| Discard a never-signed invoice | discard(), zatca:invoice discard | Cancelling invoices |
| Abandon a rejected invoice ⚠ | abandon(), zatca:invoice abandon | Cancelling invoices |
| 303 "clearance switched off" handling ⚠ | automatic | B2B |
| 24-hour reporting deadline alerts | zatca:deadlines:check | Monitoring |
| Statuses and history of every change | processing_status, history tables | Statuses and lifecycle |
Integration
| Feature | How | Docs |
|---|---|---|
| PHP facade | Zatca::… | PHP API |
| HTTP API (optional) | ZATCA_API_ENABLED | HTTP API |
| Events for every outcome | InvoiceAccepted, InvoiceRejected, InvoiceCancelled, … | Events |
| Multi-company and multi-tenant | tenant resolver | Multi-company and multi-tenant |
| Queues, workers, scheduler | queue:work, outbox relay | Queues and workers |
| Web dashboard: overview, B2B/B2C lists, invoice detail, actions, XML download, permissions | /admin/zatca, Zatca::auth() | Dashboard |
| Dashboard: devices (register, import from Excel/CSV, onboard and renew with an OTP), companies and stores | /admin/zatca/devices | Dashboard |
| Dashboard: errors and error groups (resolve with a note), queue monitor, audit history, settings | /admin/zatca/errors | Dashboard |
| Dashboard: correction editor, credit/debit note forms | invoice page | Dashboard |
| Dashboard: reports with charts, VAT summary, CSV exports | /admin/zatca/reports | Dashboard |
| Audit trail of every operator action (hash-chained) | zatca:audit:verify | Security |
Reliability and security
| Feature | Docs |
|---|---|
| Gap-free invoice counter (ICV) and hash chain (PIH) per device, safe under concurrency | Key concepts, Scaling |
| Chain and audit verification | zatca:chain:verify, zatca:audit:verify — Monitoring |
| Lost-message recovery | zatca:reconcile — Monitoring |
Load shedding (429/503) | HTTP API, Scaling |
| Encrypted private keys and secrets, OTPs never stored, redacted logs, TLS verification, XXE protection | Security |
| Laravel 9.52+–13, PHP 8.1+, MySQL/MariaDB/PostgreSQL/SQL Server ⚠ | Requirements, Compatibility |
Not available yet
| Feature | Planned |
|---|---|
| Batch HTTP endpoint, per-device in-flight limit | later; the config keys exist but are not used yet |
| Prepaid amounts, currencies other than SAR | later |