FBR Digital Invoicing (DI) API Guide for Pakistan: What Integrators Need to Know

Illustration for: FBR Digital Invoicing (DI) API Guide for Pakistan: What Integrators Need to Know

The FBR Digital Invoicing (DI) API is the technical interface PRAL maintains for licensed integrators and invoicing software to validate and submit sales tax invoices to the Federal Board of Revenue. This article explains what the API does in plain language - for the official specification, use FBR/PRAL documentation (e.g. DI API Technical Specification and User Manual on FBR download pages).

What the DI API is for

Instead of manually re-entering each invoice on IRIS, compliant software sends structured JSON (or equivalent) payloads to FBR endpoints. The API checks business rules - seller and buyer identifiers, line items, HS codes, tax rates, discounts - and returns success with an invoice reference and QR payload, or validation errors you must correct before posting.

Sandbox vs production

Integrators receive separate credentials for sandbox and production. Sandbox mirrors FBR validation rules without affecting live tax records. You must pass mandated scenarios (sale types, buyer types, etc.) before FBR enables production posting for your registration.

Typical API flow

  1. Authenticate with tokens issued after IRIS Digital Invoicing registration.
  2. Submit invoice header and line items in the prescribed schema.
  3. Receive validation response; fix errors and retry if needed.
  4. On success, persist FBR invoice number, QR code data, and status in your database.
  5. Generate customer PDF with embedded QR per FBR format requirements.

Data fields integrators care about

Payloads generally include seller NTN, buyer registration type and NTN/CNIC, invoice date, sale type, HS code per line, quantity and UOM, value excluding sales tax, sales tax amount, further tax, extra tax, withheld tax where applicable, and SRO references when required. Mismatches between your ERP and FBR master data (UOM for an HS code) are the most common API rejection reasons.

Who should read the technical spec

Developers building a custom ERP connector or evaluating software should read PRAL's DI API specification and user manual. Finance leaders can rely on certified software (e.g. Taxora.pk) that already implements the spec and exposes business-friendly screens instead of raw API calls.

DI CRM and support

PRAL operates a Digital Invoicing CRM for integration issues during and after go-live. Keep FBR registration numbers and integrator tickets handy when validation errors are unclear - often the fix is a master data sync, not a code bug.

Next steps with Taxora.pk

Taxora.pk implements FBR/PRAL workflows so you do not need to build against the DI API from scratch. For process guidance, read how to connect PRAL and bulk invoice upload.