FBR POS Documentation
FBR POS Documentation
Table of Contents
Introduction
Scope
Defination and Acronyms
POS Registration
Installation of the FBR Software Fiscal Component
Integration of Software Fiscalization Component
Invoice Model Details
.Net Code Example: Fill the invoice object
WebClient to post data to provided URL and get the response
Web Client to post data from Cloud and get the response
Sample JSON Format to POST to IMS Component
Posting Model in Postman
GET Endpoint
POST Endpoint
Uninstall
Technical Support
Introduction
The purpose of the document is to facilitate TIER 1 RETAILER to understand methods for invoice data sharing with FBR. The software fiscal component will be installed on the same computer on which POS is installed. The Fiscal component will be integrated with POS system to fiscalize the invoice and returns Fiscal Invoice
Number. For further guidance on integration of retail outlets with board’s computerized system, please follow the Sales Tax Rules,2006 Chapter XIV-AA Online Integration of Tier-1 Retailers.
Register each POS in FBR system from which you want to upload the data. Details are given in Section POS Registration.
Download the software component from the FBR website
Install the software on the local computer (*internet connection is required for this step).
Taxpayer will integrate their system with FBR software component as per provided details in the Section Integration of Taxpayer System with FBR System.
Scope
The scope of the document is limited to technical description of FBR software fiscal component. FBR Software Fiscal component will reside on the same system where the POS is installed by the taxpayer. It will fiscalize each invoice generated through the POS on real time and generate unique fiscal invoice number for each invoice to
print on receipt with QR code. Software fiscal component will periodically move recorded invoices data to FBR online system through an independent process.
POS Registration
Tier 1 Retail sector will register their POS for each branch using eFBR portal by providing the required data.
For POS registration, log in on web site https://e.fbr.gov.pk with your user credential and get registered by accessing the page Registration à POS Client Registration
On successful submission of data, FBR will generate POS registration number which will be referenced in compiling each invoice into required format.
Business Information
Contact Information
localhost/pos_fbr/ 1/7
1/9/24, 1:01 PM localhost/pos_fbr/
Branch Information
Pos Details
To facilitate taxpayers, 2 separate Software components shall be made available i.e. a software component for testing and another for live transactions.
For the integration of taxpayer POS with FBR software fiscal Component require following steps:
8. An integrated retailer to prominently display on each outlet a sign board bearing FBR’s official logo along with the text “Integrated with FBR”. The registration number of each POS has also to be prominently displayed.
localhost/pos_fbr/ 2/7
1/9/24, 1:01 PM localhost/pos_fbr/
9. The invoice data will be uploaded on FBR Servers by the Software fiscal Component automatically.
Following are the Steps for the installation of the FBR Software Component.
Figure 8 – Set Up
localhost/pos_fbr/ 3/7
1/9/24, 1:01 PM localhost/pos_fbr/
Figure 10 – Installation
Invoice Data 1
https://www.fbr.gov.pk/categ/customs-tariff/51149/70853/131188
Quantity double Compulsory 1.00
TaxRate float Compulsory 17
SaleValue double Compulsory 1,298 (Actual Sale Price on which Tax Calculated) Exclusive of Tax and Discount
Discount double Optional 380.00
FurtherTax double Optional 0.00
TaxCharged double Compulsory 221 (Actual Tax )
TotalAmount double Compulsory 1,519
InvoiceType Int Compulsory 1. New
3. Credit
localhost/pos_fbr/ 4/7
1/9/24, 1:01 PM localhost/pos_fbr/
11. 3rd Schedule New
( If an item falls under 3rd schedule category then use 11 for new item and use 12 for
3rd schedule item return invoice. )
Invoice Item 1
objInv.InvoiceNumber = string.Empty;
objInv.POSID = 123123;
objInv.USIN = “123457”;
objInv.DateTime = DateTime.Now;
objInv.BuyerNTN = “1234567-9”;
objInv.BuyerCNIC = “12345-1234567-8”;
objInv.BuyerPhoneNumber = “0345-1234567”;
objInv.PaymentMode = 1;
objInv.TotalSaleValue = 0;
objInv.TotalQuantity = 0;
objInv.TotalBillAmount = 0;
objInv.TotalTaxCharged = 0;
objInv.Discount = 1000;
objInv.FurtherTax = 100;
objInv.InvoiceType = 1;
objInv.Items = Items();
objItem.ItemCode = “0000”;
objItem.Quantity = 3;
objItem.TotalAmount = Convert.ToDouble(3000.00);
objItem.SaleValue = Convert.ToDouble(3180);
objItem.TaxCharged = Convert.ToDouble(180);
objItem.TaxRate = 6;
objItem.PCTCode = “11001010”;
objItem.FurtherTax = 20;
objItem.InvoiceType = 1;
objItem.Discount = 500;
lst.Add(objItem);
return lst;
Below code is used to call the WebAPI. JSON string is passed to the function along with API URL to which data is being posted.
using System.Net.Http;
using Newtonsoft.Json;
if (response.IsSuccessStatusCode)
Console.WriteLine(“———————————————“);
Console.WriteLine(response.Content.ReadAsStringAsync().Result);
Web Client to post data from Cloud and get the response
Below code is used to call the WebAPI. JSON string is passed to the function along with API URL to which data is being posted.
Sandbox URL:
https://esp.fbr.gov.pk:8244/FBR/v1/api/Live/PostData
Production URL:
https://gw.fbr.gov.pk/imsp/v1/api/Live/PostData
using System.Net.Http;
using Newtonsoft.Json;
if (response.IsSuccessStatusCode)
Console.WriteLine(“———————————————“);
Console.WriteLine(response.Content.ReadAsStringAsync().Result);
localhost/pos_fbr/ 5/7
1/9/24, 1:01 PM localhost/pos_fbr/
Sample JSON Format to POST to IMS Component
{
“InvoiceNumber”:””,
“POSID”:110014,
“USIN”:”USIN0″,
“DateTime”:”2020-01-01 12:00:00″,
“BuyerNTN”:”1234567-8″,
“BuyerCNIC”:”12345-1234567-8″,
“BuyerName”:”Buyer Name”,
“BuyerPhoneNumber”:”0000-0000000″,
“TotalBillAmount”:0.0,
“TotalQuantity”:0.0,
“TotalSaleValue”:0.0,
“TotalTaxCharged”:0.0,
“Discount”:0.0,
“FurtherTax”:0.0,
“PaymentMode”:1,
“RefUSIN”:null,
“InvoiceType”:1,
“Items”:[
{
“ItemCode”:”IT_1011″,
“ItemName”:”Test Item”,
“Quantity”:1.0,
“PCTCode”:”11001010″,
“TaxRate”:0.0,
“SaleValue”:0.0,
“TotalAmount”:0.0,
“TaxCharged”:0.0,
“Discount”:0.0,
“FurtherTax”:0.0,
“InvoiceType”:1,
“RefUSIN”:null
},
{
“ItemCode”:”IT_1012″,
“ItemName”:”Test Item”,
“Quantity”:1.0,
“PCTCode”:”11001010″,
“TaxRate”:0.0,
“SaleValue”:0.0,
“TotalAmount”:0.0,
“TaxCharged”:0.0,
“Discount”:0.0,
“FurtherTax”:0.0,
“InvoiceType”:1,
“RefUSIN”:null
}
]}
Request:
Open new tab in Postman and write URL: http://localhost:8524/api/IMSFiscal/Get . Now click send button to check the response from the Fiscalization Service.
Response:
“Service is responding”
POST Endpoint
Request:
Change type from Get to POST and then Select raw radio button on Postman and change Text to JSON. Add the sample json mention in section Sample JSON Format to POST to IMS Component.
Now click send button to check the response from the Fiscalization Service.
Response:
“InvoiceNumber”: “9000052011142444901”,
“Code”: “100”,
“Errors”: null
Uninstall
localhost/pos_fbr/ 6/7
1/9/24, 1:01 PM localhost/pos_fbr/
You have to uninstall the sandbox component properly before trying to reinstall the live component. Please do not uninstall IMS component from control panel. To properly uninstall the component, follow these steps:
Technical Support
Email: helpline@fbr.gov.pk
Phone: (051) 111-772-772
localhost/pos_fbr/ 7/7