Pakistan Digital Invoicing Solution

Great progress

Now that you have a better grasp on how tax rates work, you can completely ignore my earlier attempts to get a starting setup – which is just that.

Custom Fields would work too. In fact, they would work better since they will carry over Sale Type to invoice lines after selecting a Tax Code.

Yes, now each Sales Line requires users to select additional fields: Sale Type, SRO Schedule No, and SRO Item Serial No.

However, this will negatively impact the user experience due to the added complexity in the form layout.

The Extension should now be functioning properly; I’ve successfully submitted invoices multiple times during testing.

In this integration, users must have a clear understanding of transaction details such as Sale Type, Tax Rate, SRO Item Serial Number, and SRO Schedule Number, and ensure that they match the selected Sandbox Scenario.

Also, be sure to use NTN/CNIC values that match the ones used when requesting the token, as well as for the Registered Buyer/Customer — the NTN/CNIC must be registered with FBR.

For Buyer Name, Province, and Address, you may use placeholder or realistic test data.

FBR Extension v25.07.12.0002

FBR Extension Open Source Repository
Thank you to @uzair94, @Syed_Salman_Ali, @Ealfardan and all the members who participated in bringing this project to life.

3 Likes

You’re very welcome! It was a pleasure contributing.Glad we could make it happen.

2 Likes

@Mabaega thanks for this great effort in short time :+1:

1 Like

good job bro i want this one i am struggling with my POS software integration with FBR but unable to do this maybe your program help me to find out where i am wrong by the way i am new on this forum just wandering from site to site to get hint or info how to properly solve my issue and end’s up here so i am hoping your help would be valuable for me

@reahan007 welcome to forum.
Please follow the link.

i personally get this bearer token from documentation the one i get on my fbr portal is not in use i test it on the app that @uzair94 has created it says incorrect check your credentials and also i try to make request with that one on the postman get issue like unauthorized access so i try with one that i get from documentation 906b1cd8-0d10-3a91-8234-8ec88e376bd7 and it works in app that brother create and also when i use it to make request on this endpoint https://esp.fbr.gov.pk:8244/DigitalInvoicing/v1/PostInvoiceData_v1 i get 200ok response but there is still some issues like i did not get any invoice number infact i get this {
“$id”: “1”,
“version”: “1.0”,
“statusCode”: 200,
“errorMessage”: “Object reference not set to an instance of an object.”,
“result”: “”,
“timestamp”: “2025-07-16T20:28:28.5441807+05:00”,
“errors”: {
“$id”: “2”,
“$values”:
}
}

hi bro i try your app it validate token but when i try to submit json for invoice get this :{
“$id”: “1”,
“version”: “1.0”,
“statusCode”: 200,
“errorMessage”: “Object reference not set to an instance of an object.”,
“result”: “”,
“timestamp”: “2025-07-16T20:28:28.5441807+05:00”,
“errors”: {
“$id”: “2”,
“$values”:
}
}

and this message body i use :
{
“invoiceType”: 1,
“POSID”: 816598,
“USIN”: “INV0001”,
“invoiceDate”: “2024-05-16”,
“sellerNTNCNIC”: “0786909”,
“sellerBusinessName”: “General business”,
“sellerAddress”: “Rawalpindi”,
“sellerProvince”: “Punjab”,
“businessDestinationAddress”: “Karachi”,
“buyerNTNCNIC”: “1234567890123”,
“buyerBusinessName”: “John Doe”,
“buyerProvince”: “Sindh”,
“buyerAddress”: “Karachi”,
“items”: [
{
“productCode”: “29321900”,
“hsCode”: “99260000”,
“productDescription”: “OTHER”,
“rate”: 17,
“uoM”: “KG”,
“quantity”: 100,
“valueSalesExcludingST”: 1000,
“salesTaxApplicable”: 170,
“salesTaxWithheldAtSource”: 150,
“totalValues”: 1170,
“saleType”: “Services”
}
]
}

can you help me to debug what’s the issue and also when i make this request on postman with this url https://esp.fbr.gov.pk:8244/DigitalInvoicing/v1/PostInvoiceData_v1 i get this {
“$id”: “1”,
“version”: “1.0”,
“statusCode”: 200,
“errorMessage”: “Object reference not set to an instance of an object.”,
“result”: “”,
“timestamp”: “2025-07-16T20:28:28.5441807+05:00”,
“errors”: {
“$id”: “2”,
“$values”:
}
}

and on your created app get this :

{
  "fault": {
    "code": 900908,
    "message": "Resource forbidden ",
    "description": "Access failure for API: /di_data/v1, version: v1 status: (900908) - Resource forbidden "
  }
}

good work bro i am also on the same track i make POS software for a client and now for another one with FBr integration struggling so i am sure we can work together what you say

1 Like

Regarding the integration of Manager with PRAL FBR,
I’ve noticed that some users are utilizing Multiple Tax Rates to handle Extra Tax and Further Tax.

Currently, the FBR Extension generates 105 Tax Codes based on the tax rates applicable since 2024. These Tax Codes appear to be inefficient, as they do not include Extra Tax and Further Tax, which may be required for certain item types and sale types.

The most efficient approach is to allow users to create their own Tax Codes based on their specific business needs.

For items that require Extra Tax and/or Further Tax, users can create Tax Codes with multiple rates. The FBR Extension will automatically pick up the correct rates based on the names provided. Make sure to use the following names: SalesTax, FurtherTax, and ExtraTax.

Additionally, users must specify the Sale Type for each Tax Code via a Custom Field.

Previously, the Sale Type was determined based on the Reporting Category of the Tax Code. Moving forward, the Sale Type will be retrieved from a dedicated SaleType Custom Field, which must be manually selected by the user when creating a new Tax Code.

This change allows for greater flexibility and accuracy, especially in scenarios where Extra Tax and Further Tax are required based on the nature of the item or the transaction type.

If anyone has other ideas or suggestions, please feel free to share them.

2 Likes

I’ve just returned from vacation and finally had a chance to look over the latest build. Many thanks to @Mabaega for the prompt response and for delivering a working solution so quickly—great job!

I’ll be testing the application in detail today and will share a full review shortly. In the meantime, I have one suggestion that could improve usability:

  • Add an “FBR Submission Status” column on the main Sales Invoices page This would let users see at a glance whether each invoice has been successfully submitted to FBR, is pending, or encountered an error. It should save time and reduce the need to open each record individually.

Looking forward to providing more feedback after my tests. Thanks again to the development team for the hard work.

2 Likes

I believe we don’t need a separate status to determine whether an invoice has been reported or not.
An invoice that has been successfully reported and approved will receive an Invoice Number from the PRAL server, which will be recorded in the Manager invoice.

If the submission fails, the user simply needs to resend the invoice until it is successfully delivered and approved.

3 Likes

your thinking is right but the problem is that we sometime have to stop some invoice for submission if payment is late from client end. having that column helps us in keeping record of that.

@Mabaega also could you please guide me in how many and where where i have to make customs fields. for your integration.

There’s no need to manually create Custom Fields — all Custom Fields required for the integration will be automatically created by the FBR Extension during the Integration Setup.

@uzair94

You can keep record of submitted invoice to PRAL/FBR like this.

If the FBR invoice number is not filled it means invoice is not submitted yet. This is automatically possible.

1 Like

@Khurram_Shahzad , @uzair94

Based on the Invoice Number issued by FBR, is there a link or URL where the buyer can view the invoice they received? Or is there a dedicated application provided to verify the invoice through the QR code printed on the invoice?

@Mabaega There is a App called Tax Asaan through which we can scan qr code and verify invoice.

1 Like

mines are not created could anyone share me the working manager business file so i can test the integration and also try to implement this extension in my usual setup

Just create a new business and select Pakistan as the country.
Then, create and display one invoice — the FBR Extension should automatically show the Integration Setup.