ZatcaX
Home Documentation Overview
PHP 8.1+ · Laravel auto-discovery · Standalone PHP

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

1

Install and configure

Add the package, then provide your base URL, client ID, client secret, and authorized domain.

2

Obtain a certificate

Create a compliance request with a Fatoora OTP, or import an existing certificate and private key.

3

Build and submit invoices

Use InvoiceBuilder or pass the equivalent array payload to the invoice resource.

4

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();
}