ZatcaX PHP & Laravel SDK
A server-side SDK for connecting PHP applications to the ZatcaX e-invoicing platform. It signs every request, manages the ZATCA certificate lifecycle, submits standard and simplified invoices, and exposes PDF and QR output URLs.
Signed requests
HMAC-SHA256 signing with client ID and domain headers.
Certificate lifecycle
Onboard, import, renew, and inspect compliance activity.
Fluent invoice builders
Build parties, addresses, items, invoices, credit notes, and debit notes.
Two integration modes
Laravel Facade and service container, or a framework-free PHP client.
Typical integration flow
Install and configure
Add the package, then provide your base URL, client ID, client secret, and authorized domain.
Obtain a certificate
Create a compliance request with a Fatoora OTP, or import an existing certificate and private key.
Build and submit invoices
Use InvoiceBuilder or pass the equivalent array payload to the invoice resource.
Store response identifiers
Keep the invoice UUID and request ID to display status, activity, PDF, and QR outputs.
Minimal Laravel example
use ZatcaX\SDK\Builders\InvoiceBuilder;
use ZatcaX\SDK\Laravel\Facades\Zatca;
$invoice = InvoiceBuilder::make()
->ownerUuid($ownerUuid)
->id(1001)
->simplified()
->supplier($supplier)
->customer($customer)
->addItem($item);
$response = Zatca::invoice()->submit($invoice);
if ($response->isSuccessful()) {
$invoiceData = $response->getData();
}
Requirements and package setup
ConfigurationCredentials, domains, timeouts, and SSL
Laravel guideFacade, builders, certificates, and invoices
Standalone PHPUse the SDK without Laravel
API referenceEvery public class, method, and enum
Error handlingExceptions, response inspection, and recovery