Going live
1. Sandbox (developer portal)
Everything from the quick start. Test your real invoice shapes: every VAT category you use, discounts, B2B buyers, credit notes. Fix all validation errors and ZATCA warnings.
2. Simulation
ZATCA's simulation environment uses your real taxpayer data and real OTPs from the Fatoora portal (simulation section), but nothing is legally reported.
dotenv
ZATCA_ENVIRONMENT=simulationRegister the devices again with --environment=simulation and onboard them with a simulation OTP. Run a realistic day of traffic, including failures (stop the workers for an hour, then start them again).
3. Production
dotenv
ZATCA_ENVIRONMENT=productionRegister and onboard production devices with production OTPs.
Checklist
Configuration
- [ ]
ZATCA_ENVIRONMENT=production - [ ]
ZATCA_ENCRYPTION_KEYset, backed up in a secrets manager (not only.env) - [ ]
ZATCA_ARTIFACT_DISKis private, backed up, shared between servers - [ ]
QUEUE_CONNECTIONis notsync; Redis (or similar) for queue and cache - [ ] TLS verification on (default);
ZATCA_CA_BUNDLEset if needed - [ ] Seller address and IDs correct (they are printed on every invoice)
- [ ] Correction policies (
zatca.correction.*) confirmed with your tax advisor - [ ] Retention period (
retention.years) confirmed with your tax advisor
Processes
- [ ] Cron runs
php artisan schedule:runevery minute - [ ] Queue workers run under Supervisor/Horizon with
--tries=1 - [ ] Optional:
zatca:outbox:relay --daemonunder Supervisor - [ ] Workers restart on deploy (
php artisan queue:restart)
Monitoring
- [ ] Listeners for
InvoiceRejected,InvoiceSubmissionFailed,InvoiceReportingDeadlineAtRisk,InvoiceReportingDeadlineBreached,CertificateExpiring - [ ] Alert on failing
zatca:chain:verify - [ ] Someone owns the daily review of
REJECTED/FAILED/MANUAL_REVIEWinvoices
Integration
- [ ] B2B invoices are given to buyers only after
CLEARED, as the cleared XML - [ ] Receipts print the QR from the response
- [ ] Your clients retry with the same idempotency key
- [ ] HTTP API (if enabled) is behind authentication
Database
- [ ] Backups include all
zatca_*tables - [ ] Tables are InnoDB (MySQL/MariaDB)