Skip to content

Configuration ​

All options live in config/zatca.php (publish with php artisan vendor:publish --tag=zatca-config). Options marked ⚠ follow the package's reading of ZATCA's documents where ZATCA has not stated the rule explicitly; confirm them with ZATCA or your tax advisor.

Environment and endpoints ​

KeyEnvDefaultDescription
environmentZATCA_ENVIRONMENTsandboxsandbox, simulation or production. Default for new devices
endpoints.sandboxZATCA_SANDBOX_URL…/e-invoicing/developer-portal
endpoints.simulationZATCA_SIMULATION_URL…/e-invoicing/simulation
endpoints.productionZATCA_PRODUCTION_URL…/e-invoicing/core
timezoneZATCA_TIMEZONEAsia/RiyadhUsed to render IssueDate/IssueTime; stored times are UTC

Database ​

KeyEnvDefaultDescription
database.connectionZATCA_DB_CONNECTIONnullConnection for package tables (null = default)
database.table_prefixZATCA_TABLE_PREFIXzatca_Lowercase, max 16 characters
database.foreign_keysZATCA_DB_FOREIGN_KEYStrueSet false only for partitioned MySQL tables
database.max_payload_bytes1 MiBMaximum invoice JSON size
database.store_linesZATCA_STORE_LINEStrueStore calculated lines and VAT breakdown per document

Tenancy ​

KeyEnvDefaultDescription
tenancy.modeZATCA_TENANCY_MODEnonenone, column, database (see tenancy)
tenancy.resolvernullClass implementing TenantResolver

Security ​

KeyEnvDefaultDescription
security.encryption_keyZATCA_ENCRYPTION_KEYnullMaster key for private keys and secrets. Falls back to APP_KEY with a warning
security.previous_encryption_keysZATCA_PREVIOUS_ENCRYPTION_KEYS[]Old keys, comma-separated, after a rotation
security.kmsnullClass implementing KeyManagementService
security.verify_tlsZATCA_VERIFY_TLStrueCannot be false in production
security.ca_bundleZATCA_CA_BUNDLEnullPath to a CA bundle

Certificate requests (CSR) ​

KeyEnvDefaultDescription
csr.curvesecp256k1Key curve (as in ZATCA's SDK)
csr.solution_providerZATCA_SOLUTION_PROVIDERCodingTripletsPart 1 of the EGS serial
csr.solution_modelZATCA_SOLUTION_MODELlaravel-zatcaPart 2 of the EGS serial
csr.serial_attributesurnamesurname (OID 2.5.4.4) or serialNumber (2.5.4.5) for the EGS serial

Storage ​

KeyEnvDefaultDescription
storage.driverZATCA_ARTIFACT_DRIVERdatabasedatabase: signed/cleared XML in the artifact row (gzip + base64). filesystem: on storage.disk
storage.diskZATCA_ARTIFACT_DISKlocalFilesystem driver: private disk for signed/cleared XML
storage.rootzatcaFolder on the disk
storage.encrypt_localZATCA_ENCRYPT_ARTIFACTSfalseEncrypt stored XML

HTTP (calls to ZATCA) ​

KeyEnvDefaultDescription
http.timeout30Seconds
http.connect_timeout10Seconds
http.max_rpsZATCA_MAX_RPS0Optional ceiling on requests per second to ZATCA, shared by all workers. 0 = off
http.max_in_flight_per_deviceZATCA_MAX_IN_FLIGHT_PER_DEVICE2Parallel calls per device
http.circuit.failures5Consecutive connection failures / timeouts / 5xx before the circuit opens (429 opens it at once)
http.circuit.open_seconds30First open period; doubles on every re-open
http.circuit.max_open_seconds600Longest open period
http.circuit.probe_seconds120A half-open probe that never reports back is replaced after this
cache_storeZATCA_CACHE_STOREdefaultCache store shared by all workers (circuit breaker, rate ceiling)

Outbox ​

KeyDefaultDescription
outbox.scheduletrueRegister relay, prune, chain verify, deadline check and reconcile with the scheduler
outbox.max_attempts10Handler failures before a message is dead-lettered
outbox.lease_seconds600A dispatched message is dispatched again if its job has not finished by then
outbox.dispatch_on_sync_driverfalseWith the sync queue driver, leave jobs to the relay instead of running them in the request

Queues ​

KeyEnvDefaultDescription
queues.connectionZATCA_QUEUE_CONNECTIONnullQueue connection (null = default)
queues.names.b2c_reportingzatca-b2c-reportingB2C reporting
queues.names.b2c_retryzatca-b2c-retryB2C retries
queues.names.b2b_generationzatca-b2b-generationSigning of b2b()->submit() invoices
queues.names.b2b_clearancezatca-b2b-clearanceB2B clearance
queues.names.b2b_retryzatca-b2b-retryB2B retries
queues.names.b2c_generationzatca-b2c-generationReserved (B2C is signed in the request)
queues.names.device_onboardingzatca-device-onboardingReserved (onboarding runs in the calling process: OTPs are never queued)
queues.names.device_renewalzatca-device-renewalReserved
queues.names.outboxzatca-outboxReserved
queues.names.maintenancezatca-maintenanceReserved
queues.high_water_mark5000Pending submissions before backpressure (503)

Retries ​

KeyDefaultDescription
retry.b2b.max_attempts10
retry.b2b.backoff_seconds60 … 43200Delay before each retry (randomised 50–100 %)
retry.b2c.max_attempts10
retry.b2c.backoff_seconds30 … 10800
retry.b2c_deadline_margin_hours4Unknown outcomes: last automatic B2C attempt at least this long before the deadline
retry.outage.b2b_window_hours24ZATCA unavailable: B2B retried this long after the first attempt (B2C: until the reporting deadline). These retries do not count towards max_attempts
retry.outage.max_delay_seconds900Longest gap between outage retries

B2C ​

KeyEnvDefaultDescription
b2c.reporting_deadline_hours24Reporting window after issuance
b2c.deadline_alert_hours[12, 4, 1]Hours before the deadline at which InvoiceReportingDeadlineAtRisk fires (12 h: page someone during a ZATCA outage)
b2c.reporting_modeZATCA_B2C_REPORTING_MODEqueuequeue or sync
b2c.infer_standard_vat_categorytrueMissing category + 15 % → S with a warning

B2B ​

KeyDefaultDescription
b2b.require_buyer_identificationtrueReject buyers without VAT number or other ID before signing (BR-KSA-81)
b2b.on_clearance_deactivated ⚠reportOn HTTP 303: report the same document, or manual_review

Corrections ⚠ ​

KeyDefaultDescription
correction.b2b_keep_invoice_numbertrueCorrected B2B document keeps the invoice number
correction.b2b_update_issue_datetrueCorrected B2B document gets the reissue date
correction.b2c_keep_invoice_numbertrueCorrected B2C document keeps the invoice number
correction.b2c_keep_issue_datetrueCorrected B2C document keeps the original issue date
correction.credit_note_for_rejectedfalseRefuse corrections of rejected invoices (credit note required instead)
correction.four_eyesfalseCorrections need approval by a different user

API ​

KeyEnvDefaultDescription
api.enabledZATCA_API_ENABLEDfalseRegister the HTTP API
api.prefixZATCA_API_PREFIXapi/zatcaURL prefix
api.middleware['api']Extra middleware for the API routes
api.authZATCA_API_AUTHbasicbasic: HTTP Basic with the credentials below (401 for everyone while they are empty). none: your api.middleware authenticates
api.basic.usernameZATCA_API_USERNAMEBasic auth username
api.basic.passwordZATCA_API_PASSWORDBasic auth password (long and random)
api.batch_max500Reserved: batch endpoint not available yet

Performance ​

KeyEnvDefaultDescription
performance.signing_key_memory_ttlZATCA_SIGNING_KEY_TTL300Seconds a decrypted signing key stays in worker memory (0 = off)
performance.max_in_flight_issuanceZATCA_MAX_IN_FLIGHT_ISSUANCE200API: concurrent issuance requests before 429
performance.counter_lock_wait_ms2000Wait for a busy device
performance.max_in_flight_per_device8Reserved: not enforced yet
performance.shed_when_outbox_lag_seconds300Reserved: not enforced yet
performance.advisory_chain_lockfalseExtra cache lock around issuance

Devices ​

KeyEnvDefaultDescription
devices.renewal_warning_days[30, 14, 7, 1]CertificateExpiring thresholds
devices.schedule_expiry_checktrueRegister the daily expiry check
devices.sandbox_skip_compliance_checksZATCA_SANDBOX_SKIP_COMPLIANCE_CHECKSfalseDeveloper portal only

Retention ​

KeyDefaultDescription
retention.years ⚠6Retention period; confirm with your tax advisor
retention.outbox_processed_days14Processed outbox rows are deleted after this

Dashboard ​

KeyEnvDefaultDescription
ui.enabledZATCA_UI_ENABLEDtrueRegister the dashboard routes
ui.prefixZATCA_UI_PREFIXadmin/zatcaURL prefix
ui.domainZATCA_UI_DOMAINnullServe only on this domain
ui.middleware['web', 'auth']Middleware stack (your authentication)
ui.guardZATCA_UI_GUARDnullAuth guard for the current user (null = default)
ui.route_name_prefixzatca.Route name prefix
ui.themelightlight, dark or auto
authorization.resolvernullClass implementing PermissionResolver (null = Zatca::auth() callback, then Gates/Spatie)

Not affiliated with or endorsed by ZATCA. Verify regulatory requirements with ZATCA and your tax advisor.