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
create and release abilities; high-value releases need a second approver.submitted_at is set; route users to the credit-note flow.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.
