How to Get the PRAL API Token: Step-by-Step FBR Setup
To transmit invoices to FBR through the Digital Invoicing API, your business needs a security token issued by PRAL (Pakistan Revenue Automation (Pvt.) Ltd, FBR's IT arm). Tokens are issued through the Digital Invoicing enrolment on IRIS, FBR's online portal. This guide walks through the process.
- Sandbox token: issued once your Digital Invoicing enrolment is accepted. It authenticates calls to the sandbox (test) endpoints.
- Production token: generated by IRIS after every sandbox scenario eligible for your business nature and sector has passed. It authenticates calls to the live endpoints.
- Both are bearer tokens sent in the Authorization header of each API call. They are issued per taxpayer (per NTN), and sandbox and production tokens are separate.
Prerequisites: Before You Start
You will need the following:
| Requirement | Why it is needed | Where to get it |
|---|---|---|
| Business NTN (7 digits) | Identifies your business to FBR; the token is issued against it | Your FBR registration |
| Active sales tax registration (STRN) | Digital Invoicing applies to registered persons under the Sales Tax Act 1990 | Check your status on IRIS (https://iris.fbr.gov.pk); register first if needed |
| IRIS login | Enrolment and the tokens are handled on IRIS | Your IRIS user ID and password |
| Technical contact details | IRIS asks for a technical contact person, mobile and email, the software type (cloud or on-premises) and version | FinSmart provides the software details during onboarding |
| Server IP addresses | When PRAL is your Licensed Integrator, the IPs that will call the API are whitelisted | FinSmart supplies its server IPs for your enrolment |
Complete NTN and sales tax registration before enrolling for Digital Invoicing.
Step-by-Step: Getting the Tokens
Step 1: Log in to IRIS
- Open https://iris.fbr.gov.pk in your browser
- Enter your IRIS user ID and password and sign in
- Confirm that the business name and NTN shown are correct
Step 2: Open Digital Invoicing and choose the integration mode
- Open the Digital Invoicing section
- Choose API Integration (for businesses using invoicing software such as FinSmart)
- Choose your Licensed Integrator: PRAL provides integration and sandbox testing free of cost, or you can select another FBR Licensed Integrator. FinSmart connects through the PRAL API.
- Check that your sales tax registration is active
- Check whether your business category is covered yet; deadlines are phased by category under SRO 709(I)/2025 and later FBR notifications (see the FBR Notifications page)
- Raise a query with PRAL's Digital Invoicing support (DI CRM) if the option should be there
Step 3: Enter technical details, business nature and sector
- Fill in the technical contact person, mobile and email
- Enter the software type and version (FinSmart gives you these)
- Tick your business nature (manufacturer, importer, exporter, distributor, wholesaler, retailer, service provider, other; more than one is allowed)
- Select one sector (for example FMCG, pharmaceuticals, textile, steel, services, or all other sectors)
Business nature and sector decide which sandbox scenarios you must pass. Choose them carefully.
Step 4: IP whitelisting
- Enter the server IP addresses that will call the API (FinSmart provides these)
- Submit the application
- Once PRAL accepts the IPs, the sandbox environment opens
Step 5: View the sandbox token
- Open the Sandbox Environment step
- Click View Web API Environment Details
- The pop-up shows the sandbox endpoints and the sandbox security token
- Share it with the FinSmart team through the onboarding channel agreed with you, not by open email or chat
The FinSmart team stores it for your business server-side. You can now log in to FinSmart in sandbox mode and work through the scenarios.
Step 6: Pass the eligible sandbox scenarios
The sandbox dashboard on IRIS lists your eligible scenarios and shows which are successful, pending or unsuccessful. Submit an invoice for each eligible scenario until all of them show Successful. See the sandbox scenarios guide.
Step 7: Get the production token
- When every eligible scenario has passed, IRIS generates the production token automatically
- Open the Production Environment step and click View Security Token
- Pass it to the FinSmart team through the agreed onboarding channel; it is stored separately from the sandbox token
Log in to FinSmart in production mode. Production submissions ask for confirmation before they are sent, because each one is a legal tax record.
Keeping Your Tokens Safe
Do:
- ✓ Treat the token like a password; anyone holding it can post invoices in your name
- ✓ Keep it only where it is needed. FinSmart stores each business's tokens server-side and uses them only on the server; they are never sent to the browser
- ✓ Limit IRIS access to the people who manage your enrolment
- ✓ Keep the sandbox and production tokens clearly separated
Do not:
- ✗ Paste the token into open email threads, group chats or documents
- ✗ Publish it in code repositories or screenshots
- ✗ Hand the production token to anyone who has not completed your onboarding
Configuring FinSmart with Your Tokens
You do not enter tokens in the FinSmart app yourself:
- The FinSmart team sets up your business and stores the sandbox token (and later the production token) for it
- You log in and choose Sandbox or Production mode; the server uses the matching token
- Invoice numbering is kept separate for each mode
- Every FBR request and response is written to a server-side audit log for your business
Token Maintenance
How long does a token last?
- PRAL's technical documentation describes the token as long-lived (currently five years from issue)
- The IRIS user manual does not describe renewal or regeneration; if a token stops working, raise it with PRAL's Digital Invoicing support
When to act
| Situation | Action |
|---|---|
| The API returns an authentication error with a token that used to work | Check that the right token is used for the right environment, then contact PRAL's DI support through the CRM |
| The token has been exposed | Contact PRAL's DI support immediately and ask for the token to be replaced |
| Switching from one invoicing system to another | Give the new provider the token through a secure channel and remove it from the old system |
Troubleshooting: Common Issues
❌ "Digital Invoicing option not visible in IRIS"
Solution:
- Check that your sales tax registration is active on IRIS
- Check the latest FBR notification for your business category on the FBR Notifications page
- Raise a query with PRAL's Digital Invoicing support (DI CRM)
❌ "The API rejects the token"
Solution:
- Make sure the sandbox token is used in sandbox mode and the production token in production mode
- Check that the token was copied in full, with no spaces
- Check that the server IP is whitelisted (when PRAL is your integrator)
❌ "No production token yet"
Solution:
- Open the sandbox dashboard on IRIS and look for scenarios still marked Pending or Unsuccessful
- Fix the error shown in the Error Details pop-up and submit the scenario again
- The production token appears only when every eligible scenario is Successful
Next Steps
1. Test in sandbox
Work through the sandbox scenarios eligible for your business nature and sector.
2. Review FBR reference data
Get familiar with FBR error codes and HS codes and units of measure.
3. Get the production token
Once every eligible scenario passes, view the production token on IRIS and pass it to the FinSmart team.
4. Go live
Submit your first real invoice, confirm the FBR invoice number and QR code on the PDF, and check the invoice on IRIS.
Quick Reference: Token Checklist
Before you go live, make sure that:
- ☐ Digital Invoicing enrolment on IRIS is complete
- ☐ Business nature and sector are correct
- ☐ Server IPs are whitelisted (PRAL as integrator)
- ☐ The sandbox token is stored in FinSmart
- ☐ Every eligible sandbox scenario shows Successful on IRIS
- ☐ The production token has been issued and stored in FinSmart
- ☐ Your team knows how to read validation feedback and handle timeouts
Need Help?
Contact FinSmart: info@finsmart.pk | WhatsApp: +92 316 8222144
PRAL Digital Invoicing support: the DI CRM at https://dicrm.pral.com.pk, or the FBR helpline listed on fbr.gov.pk
Book a free demo