The Comprehensive Guide to FBR Digital Invoicing (DI API v1.12) for Pakistani Businesses
A technical and architectural walkthrough on integrating your ERP or billing system with the Federal Board of Revenue's real-time sales tax gateway, handling cryptographic IRNs, and passing sandbox verification.
The Federal Board of Revenue (FBR) has accelerated the rollout of mandatory digital sales tax invoicing across Pakistan. While Tier-1 retailers and large manufacturers were the initial targets, the requirement now extends across registered wholesale distributors, importers, and service enterprises.
The architectural challenge for engineering teams lies in low-latency reliability. When a retail customer or wholesale buyer is standing at the billing counter, an ERP system cannot afford to freeze while waiting for an external government gateway response.
At WaslTek, when engineering Lejora, we architected an asynchronous queue pipeline with optimistic local record locking. The sales record is compiled and validated against Pakistan HS codes and CNIC/NTN formats client-side. The encrypted payload is transmitted to https://gw.fbr.gov.pk/di_data/v1/di/ in under 800ms.
Should the gateway experience network latency, our fallback mechanism stamps the transaction with an 'Offline Pending' status, prints the preliminary challan, and automatically retries in the background with exponential backoff until the immutable 18-digit IRN and verification QR code are retrieved and archived.
Have Questions About This Architecture?
Our engineering squad is available to discuss specific implementation details or help you integrate these architectural patterns.
