Technology

Quick answer: FBR Digital Invoicing (DI) is Pakistan’s real-time e-invoicing system for sales tax. Your POS, ERP or billing software sends each invoice as JSON to the DI API run by PRAL (Pakistan Revenue Automation). FBR returns an FBR invoice number, which your software prints on the invoice with a QR code and the Digital Invoicing logo. You register in IRIS, whitelist your server’s IP address, pass sandbox test scenarios, and then go live with a production token. Integration goes through one of two routes: PRAL, which integrates registered persons free on request, or an FBR-licensed integrator.

We have built DI integrations ourselves, including the one inside HisaabPOS, our cloud POS for Pakistani shops. This guide covers the whole integration for business owners and for developers wiring it into their own software: the endpoints, payload, error codes and correction rules.

Who has to integrate with FBR Digital Invoicing?

S.R.O. 69(I)/2025 substituted Chapter XIV of the Sales Tax Rules. It requires registered persons to issue electronic sales tax invoices through a system integrated with FBR, either via PRAL or a licensed integrator. The deadlines were set and then reset by later notifications (S.R.O. 709(I)/2025 and S.R.O. 1413(I)/2025). S.R.O. 1852(I)/2025 then replaced them with a final timetable phased by category of registered person, and the last date was 31 December 2025. In March 2026, Sales Tax General Order (STGO) 01 of 2026 confirmed that a business may use more than one licensed integrator and set the 72-hour rule for corrections. In October 2026, e-invoicing was also reported to extend to federal excise and Islamabad services.

Two systems often get confused:

  • FBR Digital Invoicing covers sales-tax-registered persons such as manufacturers, importers, wholesalers and distributors.
  • FBR POS Integration is the older real-time system for Tier-1 retailers’ tills. Under the rules, retailers already integrated through FBR POS are treated as integrated.

Provincial authorities such as PRA and SRB run their own systems for services. If you are not sure which applies to you, read FBR POS Integration vs Digital Invoicing vs PRA and SRB or watch the Urdu explainer video.

How the Digital Invoicing flow works

  1. Your software builds the invoice: seller and buyer details, items, HS codes, quantities, units of measure, sale type, tax rate and amounts.
  2. It sends the invoice as JSON over HTTPS to PRAL’s DI API, with the business’s security token in the Authorization: Bearer header, from a whitelisted IP address.
  3. The API validates the data. If it passes, FBR records the invoice and returns an FBR invoice number.
  4. Your software prints that number on the invoice with a QR code (version 2.0, 25×25, 1 × 1 inch) and the FBR Digital Invoicing logo, as PRAL’s specification requires. It also stores the response for your records.

FBR Digital Invoicing API endpoints

PRAL’s technical specification (v1.12) defines two main web methods: validate, which checks an invoice without recording it, and post, which submits it for real.

  • Post: https://gw.fbr.gov.pk/di_data/v1/di/postinvoicedata (sandbox: postinvoicedata_sb)
  • Validate: https://gw.fbr.gov.pk/di_data/v1/di/validateinvoicedata (sandbox: validateinvoicedata_sb)

Sandbox and production tokens are different, so never mix them. Reference APIs supply the lookups an invoice needs: province codes, HS codes, units of measure, rate IDs, SRO schedules and items, and the buyer’s registration status (STATL).

A shortened example request:

{
  "invoiceType": "Sale Invoice",
  "invoiceDate": "2026-11-12",
  "sellerNTNCNIC": "your 7-digit NTN or 13-digit CNIC",
  "sellerBusinessName": "...", "sellerProvince": "Punjab", "sellerAddress": "...",
  "buyerNTNCNIC": "...", "buyerBusinessName": "...", "buyerProvince": "Sindh",
  "buyerAddress": "...", "buyerRegistrationType": "Registered",
  "invoiceRefNo": "",
  "scenarioId": "SN001",
  "items": [{
    "hsCode": "...", "productDescription": "...", "rate": "18%",
    "uoM": "Numbers, pieces, units", "quantity": 1,
    "valueSalesExcludingST": 1000, "salesTaxApplicable": 180,
    "totalValues": 0, "fixedNotifiedValueOrRetailPrice": 0,
    "salesTaxWithheldAtSource": 0, "extraTax": "", "furtherTax": 0,
    "sroScheduleNo": "", "fedPayable": 0, "discount": 0,
    "saleType": "Goods at standard rate (default)", "sroItemSerialNo": ""
  }]
}

scenarioId is only sent in the sandbox. A successful post returns invoiceNumber, dated and a validationResponse with statusCode, status and per-item invoiceStatuses. Take the exact values for each field from the reference APIs and the specification.

Step-by-step: integrating your POS or ERP

1. Choose your integrator

Legally there are two routes:

  • PRAL as integrator: free of charge. Your own developer connects to the API, using PRAL’s sandbox and support.
  • An FBR-licensed integrator: usually charges, and handles the technical side, including IP whitelisting, for you.

In practice, many businesses use billing software that has DI built in. With HisaabPOS, you enter your IRIS token in the till settings and HS codes are mapped by product category. Each sale is then filed with FBR, and the FBR invoice number and QR code print on the receipt (setup video in Urdu).

2. Register in IRIS, whitelist your IP and get the sandbox token

The business (not the developer) logs in to IRIS, opens Digital Invoicing and registers. It picks its integrator, enters business and technical details, and gives the public IP addresses of the server that will call the API (one to three, or a file for more). When PRAL is the integrator, PRAL approves the IP whitelisting; with another integrator, that integrator handles it. Requests from an IP that isn’t whitelisted are blocked. The sandbox token then appears in IRIS. Treat it like a password: keep it on the server, encrypted, per business, and never put it in a mobile app or browser code.

3. Map your data to FBR’s codes

Most of the work is here. Every product needs:

  • an HS code;
  • a unit of measure that FBR accepts for that HS code;
  • a sale type and rate that match each other;
  • an SRO schedule and item number where a reduced or special rate applies.

For registered buyers, record their NTN or CNIC and check their status in STATL before invoicing. Sales to unregistered buyers are reported with the “Unregistered” buyer type. Fetch valid values from the reference APIs instead of hard-coding them, and cache them so billing stays fast.

4. Validate, then post, in the sandbox

Call validate while you build, then post. IRIS lists the test scenarios that apply to your business type and sector, for example standard-rate goods, reduced rates, exempt and zero-rated goods, third-schedule items, sales to unregistered buyers and debit notes. Each scenario needs its own correctly built invoice, so build payloads from real reference data rather than one fixed template.

5. Move to production

Once every required scenario passes, IRIS generates the production token. Switch to the production endpoints with that token and post live invoices in real time. A common mistake is using a sandbox token on a production URL, or the reverse.

6. Handle failures, corrections and records

  • Network failures: queue the invoice and retry it automatically, so a weak connection never loses a sale.
  • Rejections: show the operator the error in plain words, together with the field that caused it.
  • Corrections within 72 hours: under STGO 01 of 2026, a genuine mistake can be cancelled, deleted or edited through FBR’s system within 72 hours of the invoice being generated.
  • Corrections after 72 hours: these need prior approval from the concerned Commissioner Inland Revenue. Since November 2026 you apply in IRIS under “Application for Amendment in Electronic Sales Tax Invoice (after 72 hrs)”. Build your software so edits stop at 72 hours and route the user to this process.
  • Records: keep every request and response. The Sales Tax Act requires records to be kept for six years.

Common DI API error codes

  • 0005: invoice date in the wrong format. Use YYYY-MM-DD.
  • 0046: rate is empty. Send a rate that matches the sale type.
  • 0052: HS code doesn’t match the sale type.
  • 0008: salesTaxWithheldAtSource must be zero or equal to the sales tax amount.
  • 0088: invalid invoice number. Use letters and digits, with hyphens only between characters.
  • 0401: the seller NTN/CNIC doesn’t match an authorised token. It must be a 7-digit NTN or 13-digit CNIC.
  • HTTP 401: missing or wrong token, or the wrong environment.

Other frequent causes: a unit that isn’t allowed for the HS code, a sale type, rate and SRO that don’t agree, and buyer details that don’t match STATL.

How much does DI integration cost?

Integration through PRAL is free, though your own developer’s time is not. Licensed integrators set their own fees. Billing software with DI built in usually includes it in the subscription (see HisaabPOS plans). If you run your own ERP or custom billing system, a direct integration makes sense, and our development team builds and maintains them. For most shops, pharmacies, restaurants and distributors, software that already has DI is faster and cheaper to run, because FBR keeps updating its rules and reference data. See the full HisaabPOS feature list.

FAQ

Can I integrate directly without a licensed integrator?

Yes. Choose PRAL as your integrator in IRIS. Your own developer then connects to the API, and PRAL provides the sandbox and IP whitelisting at no charge.

Do small retail shops need Digital Invoicing?

Digital Invoicing applies to sales-tax-registered persons, and many small shops are not registered for sales tax. Tier-1 retailers have their own FBR POS Integration requirement. Check your status with your tax adviser.

What does a customer see on a digital invoice?

The FBR invoice number, a QR code and the FBR Digital Invoicing logo, printed on the invoice or receipt.

Can I fix a mistake after an invoice is filed?

Yes. Within 72 hours you can correct a genuine mistake through the system. After that, you apply in IRIS and the Commissioner Inland Revenue decides.

What happens if a business does not integrate?

Chapter XIV makes a registered person who doesn’t integrate, or who tampers with the system, liable to penalty under section 33 of the Sales Tax Act, 1990. FBR has also said it is tightening enforcement in 2026. Ask your tax adviser how this applies to you.

Get Digital Invoicing working without writing code

Start a 1-month free trial of HisaabPOS (no card needed). It covers billing, stock, khata and FBR Digital Invoicing on the web, Android and Windows. If you need DI connected to your own system instead, contact our team.

Sources: PRAL, Technical Specification for DI API v1.12 and DI User Manual v1.5; FBR, Sales Tax General Order 01 of 2026. This guide is general information, not tax advice.

Author

admin

Leave a comment

Your email address will not be published. Required fields are marked *