API documentation
The Digital Invoicing API lets you issue FBR-verified invoices directly from your own software. Your system sends the invoice data; we submit it to FBR and return the IRN and QR code in real time.
What you can do
- Create an invoice and receive its IRN and QR code in real time.
- Check the status of a submission — verified, pending, or failed.
- Retrieve and list previously issued invoices.
- Receive webhooks when an invoice is verified or fails, so your system stays in sync.
- Test end-to-end in a sandbox before switching to live keys.
Getting access
Email hi@digitalinvoicing.co with your business name and NTN to request API access. You’ll receive sandbox and live API keys and the full endpoint reference.
Authentication
All requests are made over HTTPS and authenticated with your API key, sent as a Bearer token in the Authorization header. Keep your live key secret and use your sandbox key for testing.
Authorization: Bearer YOUR_API_KEY
Example: issue an invoice
A request carries the invoice details — seller, buyer, line items, and tax — and the response returns the FBR IRN and QR code. Illustrative shape:
POST /v1/invoices
{
"seller": { "ntn": "1234567-8" },
"buyer": { "name": "Acme Traders", "ntn": "7654321-0" },
"items": [
{ "description": "Cotton fabric", "quantity": 40, "unitPrice": 1550, "taxRate": 18 }
]
}
Illustrative response:
{
"status": "verified",
"invoiceNumber": "INV-2026-04871",
"irn": "8827-4451-9903",
"qrCode": "https://.../qr/8827-4451-9903.png"
}
Errors and reliability
- Standard HTTP status codes — 2xx for success, 4xx for validation problems, 5xx for temporary issues.
- Validation errors returned by FBR (for example, an invalid registration number) are passed back so you can correct and resubmit.
- If FBR is briefly unavailable, submissions are queued and retried automatically — your invoices aren’t lost.
Get started
Ready to build? Email hi@digitalinvoicing.co for your API key, or see plans and pricing.