FBR Sandbox Scenarios: PRAL Sandbox Testing for Digital Invoicing

Published: 3 November 2026 | Updated: 5 November 2026 | Reading time: 12 minutes | Published by the FinSmart Team

Before a business can transmit live invoices to FBR, it must pass sandbox testing on the test environment of the Digital Invoicing API run by PRAL (Pakistan Revenue Automation (Pvt.) Ltd, FBR's IT arm). FBR defines 28 test scenarios, SN001 to SN028. This guide explains what the scenarios are, which ones apply to your business, how to run them, and how the production token is issued once they pass. For software that supports every scenario, see FBR digital invoicing software.

What is the PRAL sandbox?

The sandbox is the test environment of the PRAL Digital Invoicing API. Invoices posted there are not legal tax records. It is where you confirm that your system formats the invoice correctly, receives FBR's validation response, handles error codes and stores the FBR invoice number, all before going live.

Prerequisites: Before You Test

Step 1: Enrol on IRIS and get the sandbox token

  1. Log in to IRIS (https://iris.fbr.gov.pk/) and open the Digital Invoicing section
  2. Choose API integration and select your business nature (one or more) and your sector (one)
  3. Complete the technical details; once PRAL accepts the application, the sandbox environment opens
  4. View the sandbox environment details to see your sandbox security token
  5. Keep the token confidential; do not share it by email or chat

The sandbox token and the production token are separate. See how PRAL API tokens are issued.

Step 2: Configure your system for sandbox

In FinSmart:

  1. The FinSmart team adds your sandbox token to your business during onboarding; it is stored server-side and used only on the server
  2. Log in and choose Sandbox mode
  3. Sandbox invoices use their own invoice numbering, separate from production
  4. Each sandbox invoice carries a Scenario ID field (SN001 to SN028)

Step 3: Prepare test data

The 28 FBR Sandbox Scenarios

Each scenario is a sale type FBR wants to see handled correctly. The scenario ID goes in the invoice payload in sandbox mode only.

Scenario Description Sale type
SN001Goods at standard rate to registered buyersGoods at Standard Rate (default)
SN002Goods at standard rate to unregistered buyersGoods at Standard Rate (default)
SN003Sale of steel (melted and re-rolled)Steel Melting and Re-rolling
SN004Sale by ship breakersShip Breaking
SN005Reduced rate saleGoods at Reduced Rate
SN006Exempt goods saleExempt Goods
SN007Zero-rated saleGoods at Zero Rate
SN008Sale of Third Schedule goods3rd Schedule Goods
SN009Cotton spinners' purchase from cotton ginners (textile)Cotton Ginners
SN010Telecom servicesTelecommunication Services
SN011Toll manufacturing sale by the steel sectorToll Manufacturing
SN012Sale of petroleum productsPetroleum Products
SN013Electricity supply to retailersElectricity Supply to Retailers
SN014Sale of gas to CNG stationsGas to CNG Stations
SN015Sale of mobile phonesMobile Phones
SN016Processing or conversion of goodsProcessing / Conversion of Goods
SN017Goods where FED is charged in sales tax modeGoods (FED in ST Mode)
SN018Services where FED is charged in sales tax modeServices (FED in ST Mode)
SN019ServicesServices
SN020Sale of electric vehiclesElectric Vehicle
SN021Sale of cement or concrete blocksCement / Concrete Block
SN022Sale of potassium chloratePotassium Chlorate
SN023Sale of CNGCNG Sales
SN024Goods listed in SRO 297(I)/2023Goods as per SRO 297(I)/2023
SN025Drugs sold at a fixed sales tax rate (Eighth Schedule, serial 81)Non-Adjustable Supplies
SN026Retailer sale to end consumer, standard rateGoods at Standard Rate (default)
SN027Retailer sale to end consumer, Third Schedule goods3rd Schedule Goods
SN028Retailer sale to end consumer, reduced rateGoods at Reduced Rate

Which Scenarios Must Your Business Pass?

You do not have to pass all 28. IRIS lists the eligible scenarios for the business nature and sector you selected during enrolment, and only those must succeed. As a guide:

Sector selected on IRIS Scenarios typically required
All other sectors (for example a manufacturer or distributor)SN001, SN002, SN005, SN006, SN007, SN015, SN016, SN017, SN021, SN022, SN024
SteelThe common set plus SN003, SN004, SN011
FMCGThe common set plus SN008
TextileThe common set plus SN009
TelecomThe common set plus SN010
Petroleum / Electricity / Gas distributionThe common set plus SN012, SN013 or SN014 respectively
ServicesThe common set plus SN018, SN019
AutomobileThe common set plus SN020
CNG stationsThe common set plus SN023
PharmaceuticalsThe common set plus SN025
Wholesale / retailThe common set plus SN008, SN026, SN027, SN028

The exact list is shown on your IRIS sandbox dashboard (Eligible, Successful, Pending and Unsuccessful scenarios). Treat the IRIS list as the source of truth.

How to Run a Scenario

Steps to test

  1. Create an invoice in FinSmart in sandbox mode and set the Scenario ID
  2. Choose a buyer whose registration type matches the scenario (registered for SN001, unregistered for SN002 and so on)
  3. Add items with the HS code, unit of measure, sale type and rate the scenario calls for
  4. Click Validate FBR Invoice and fix any error codes
  5. Click Submit to FBR; FinSmart validates again, locks the invoice while it is being submitted, and stores the response
  6. Check the scenario status on the IRIS sandbox dashboard

Expected response

FBR response: Valid

Status: Valid (status code 00)

FBR invoice number: returned in the response and stored on the invoice

QR code: generated from the FBR invoice number and printed on the PDF

IRIS dashboard: the scenario moves from Pending to Successful

What to verify

When a Scenario Fails

FBR returns numeric error codes at invoice level and at item level. A failed submission has no FBR invoice number, so you simply correct the data and submit again.

FBR response: Invalid

Status: Invalid (status code 01)

Example item error: 0053 "Provided registration type does not match with buyer's profile"

Where it shows: in FinSmart's validation feedback, and in the Error Details pop-up on the IRIS sandbox dashboard

Common error codes in sandbox

Error code Cause Solution
0002 Buyer NTN or CNIC in the wrong format NTN must be 7 digits, CNIC 13 digits
0053 Buyer registration type does not match the buyer's profile Check the registration type through FBR's registration service and correct the customer record
0052 / 0099 HS code not valid for the sale type, or unit of measure not valid for the HS code Pick the HS code and UoM from FBR reference data; see the HS code and UoM guide
0077 / 0078 SRO schedule number or item serial number missing on a reduced-rate, zero-rated or exempt item Select the SRO schedule and item serial for the rate and date
0104 Calculated sales tax does not match the rate Recalculate the tax from the rate FBR returns for the sale type and date
0070 Sales tax withheld sent for an unregistered buyer Withholding applies only to registered or government (FTN) buyers
Timeout (101504) No response from the sandbox endpoint Check on IRIS whether the invoice was recorded before resubmitting; FinSmart flags the invoice and asks you to verify before "Force Resubmit"

See FBR error codes explained and buyer verification for more.

Scenario-Specific Fields to Watch

FinSmart's item form supports all of these fields: sales tax, further tax, withholding, extra tax, FED, discount, fixed/notified/retail value, SRO schedule and item serial, and rates as a percentage, rupees per unit or both.

Sandbox Testing Checklist

Check What to confirm Status Notes
1. Eligible scenarios listed IRIS shows the scenarios for your business nature and sector ☐ Correct the business nature or sector on IRIS if the list looks wrong
2. Standard-rate scenarios SN001 and SN002 return Valid with an FBR invoice number ☐ Baseline for every business
3. Reduced, exempt and zero-rated SN005 to SN007 pass with SRO schedule and item serial ☐ Most common source of 0077 / 0078 errors
4. Sector scenarios Your sector's additional scenarios pass ☐ For example SN025 for pharma, SN009 for textile
5. Error handling Validation feedback shows the error code and the item it belongs to ☐ Correct and resubmit without creating duplicates
6. Timeout handling A timed-out invoice is flagged and verified on IRIS before resubmission ☐ Prevents duplicate submissions
7. Printed invoice PDF shows the FBR invoice number and QR code ☐ Required on every live invoice
8. Audit trail Every FBR request and response is logged ☐ Useful for support and audits

Common Sandbox Troubleshooting

Q: My invoice looks correct but FBR returned Invalid. What happened?

A: Read the error code and the item number in the response. The most common causes are a buyer registration type that does not match FBR's profile (0053), a unit of measure that is not allowed for the HS code (0099), and missing SRO schedule or item serial fields on reduced-rate or exempt items (0077, 0078).

Q: How many times can I test?

A: There is no fixed number. Sandbox invoices are not tax records, so you can repeat a scenario until it passes.

Q: Can I delete or edit sandbox invoices?

A: Sandbox submissions are test records and do not go into your sales tax return. In FinSmart a submitted invoice is locked in both modes; edits and cancellations of live invoices happen on IRIS within FBR's 72-hour rule.

Q: When do I move from sandbox to production?

A: When every eligible scenario on your IRIS dashboard shows Successful. At that point IRIS generates the production token. You are ready when:

Moving from Sandbox to Production

⚠️ Production is real

Once you move to production, every submitted invoice is a legal tax record. It cannot be edited or deleted in FinSmart; corrections happen on IRIS within 72 hours of submission or by month end, whichever comes first.

Steps to go live

  1. Confirm the scenarios: check that every eligible scenario on IRIS shows Successful.
  2. Get the production token: IRIS generates it automatically once the eligible scenarios pass; view it under the production environment details. See PRAL API tokens.
  3. Add it to FinSmart: the FinSmart team stores the production token for your business, separately from the sandbox token.
  4. Log in to production mode: production submissions ask for confirmation before they are sent.
  5. Submit your first invoice: confirm FBR returns the invoice number and that the invoice appears on IRIS.
  6. Print and deliver: the invoice now carries the FBR invoice number and QR code.

Ready to Test?

FinSmart supports all 28 sandbox scenarios, validates every invoice before submission, and logs every FBR request and response. Sandbox testing before go-live is included, and the FinSmart team guides you through it.

Book a free demo

Related Reading