1. Home
  2. UAE E-Invoicing Hub
  3. Custom ERP & Integration

Custom ERP & Integration

Adding UAE E-Invoicing to a PHP or Laravel System

A large share of UAE business software runs on PHP. This is how to make it compliant without rewriting it.

SZ
Sahil ZainiCRM & ERP Development
·2026-11-24·3 min read
Updated 24 Nov 2026 · checked against MoF Guidelines v2.0

A PHP or Laravel application can meet UAE e-invoicing requirements by adding four components: a mapping from its invoice model to a PINT AE document, a validator that runs the published schematron rules, a queued job that submits the document to the Accredited Service Provider's API through an adapter interface, and a status model that records each acknowledgement. The open-source pint-ae library provides generation and validation; the adapter pattern keeps provider-specific code isolated so you can switch ASPs.

Key facts at a glance

  • Library: pint-ae (PHP, open source) for PINT AE generation and validation.
  • Pattern: InvoiceMapper → Validator → Queue job → ProviderAdapter → StatusTracker.
  • Use Laravel queues (database or Redis) for durable, retryable submission.
  • Keep provider credentials in .env / secrets, never in the repository.
  • Validate before dispatching the job; reject early, locally.

Mapping your invoice model

$doc = PintAe\Invoice::create()
  ->id($invoice->number)
  ->issueDate($invoice->issued_at)
  ->currency('AED')
  ->seller(Party::fromCompany($company))      // TIN (0235), TRN, structured address
  ->buyer(Party::fromCustomer($invoice->customer))
  ->buyerReference($invoice->po_number)
  ->lines($invoice->lines->map(fn($l) => Line::make(
        $l->description, $l->qty, $l->unit_code, $l->unit_price,
        VatCategory::fromCode($l->vat_code))))
  ->allowances($invoice->document_discounts);

$xml = $doc->toXml();
$report = PintAe\Validator::validate($xml);   // schema + schematron
if ($report->hasFatal()) { throw new InvalidDocument($report); }

The mapping is where data gaps surface. Make the Party factory throw if a B2B customer lacks a TIN or a country code, so the failure is explicit and early.

Queued submission with an adapter

interface AspAdapter {
  public function submit(string $xml, string $idempotencyKey): SubmitResult;
  public function status(string $providerRef): StatusResult;
}

class SubmitEInvoice implements ShouldQueue {
  public $tries = 8; public $backoff = [60, 300, 900, 3600];
  public function handle(AspAdapter $asp) {
    $r = $asp->submit($this->xml, $this->invoice->number);
    $this->invoice->recordAck('provider_accepted', $r);
  }
}

Bind the interface to the concrete adapter for your chosen provider in a service provider. Switching ASPs becomes a binding change plus credentials.

Status, webhooks and reconciliation

Expose a webhook route for providers that push status, with signature verification, and a scheduled command that polls status for documents older than a few minutes without a terminal state. Store each acknowledgement as a row with type, timestamp and raw payload. A daily artisan command compares accepted documents with the provider's report and emails exceptions.

Controls in a Laravel app

PoliciesSeparate create and release abilities; high-value releases need a second approver.
ObserversBlock updates and deletes on invoices once submitted_at is set; route users to the credit-note flow.
Audit logRecord who released, from which IP, with the XML hash.
ArchiveStore XML, responses and PDF on object storage with versioning; keep the hash in the database.

Where Zaini Developers fits in

pint-ae is our open-source PHP toolkit, and FORMA is our production PHP platform built on the same engine. We can integrate your existing Laravel or plain-PHP system or deliver the compliance layer as a service your app calls.

Book a free consultation →

Frequently asked questions

Does pint-ae submit to the ASP?

pint-ae generates and validates documents. Submission is provider-specific and lives in an adapter you write or we supply.

Which PHP versions are supported?

Modern PHP 8.x. Check the repository README for the current minimum.

Can I use this in a non-Laravel PHP app?

Yes. The library is framework-agnostic; the queue and adapter patterns translate to any framework or plain PHP with a cron-driven worker.

How do I handle inbound invoices in PHP?

Receive from the provider via webhook or polling, validate with pint-ae, map to your purchase model and queue for matching.

This guide explains published UAE rules in plain language and is not tax or legal advice; confirm your own position with a registered tax adviser. Zaini Developers is not an Accredited Service Provider (ASP); we build and connect systems that transmit through MoF-accredited ASPs. Product names belong to their owners.
Free E-Invoicing Readiness CheckAnswer 8 quick questions and get your score and action plan.
Check my readiness

Let's build together

Need your system e-invoicing ready?
We build and connect it.

We build e-invoicing-ready ERP, CRM and POS systems and connect existing software to UAE e-invoicing.

Chat on WhatsApp