0% found this document useful (0 votes)
1K views28 pages

Technical Documentation For DI API

The document outlines the technical specifications for the Digital Invoicing API (DI API) from Pakistan Revenue Automation (PRAL), detailing its purpose, data sharing modes, and web methods for integration with the Federal Board of Revenue (FBR). It emphasizes the need for security tokens for API access and provides sample JSON data structures for invoice posting and validation. The document is confidential and intended for internal use only, with a draft status and scheduled review in April 2025.

Uploaded by

invalidmatrix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views28 pages

Technical Documentation For DI API

The document outlines the technical specifications for the Digital Invoicing API (DI API) from Pakistan Revenue Automation (PRAL), detailing its purpose, data sharing modes, and web methods for integration with the Federal Board of Revenue (FBR). It emphasizes the need for security tokens for API access and provides sample JSON data structures for invoice posting and validation. The document is confidential and intended for internal use only, with a draft status and scheduled review in April 2025.

Uploaded by

invalidmatrix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Technical Specification for DI API

Confidential Information:
The information provided in this document is intended solely for the DI API from PRAL. The contents of this
document may not be reproduced or divulged outside the intended organizations without the express
written permission of PRAL.

PAKISTAN REVENUE AUTOMATION (PVT.) LTD


PRAL – Head office, Software Technology Park-III, Plot No. 156, Service Road (North), Industrial Area, I-9/3,
Islamabad. Pakistan
DI API Technical Specification

Document Information
Category Information
Document Technical Specifications Document
Project-Module Technical Specification for DI API
Title
Version 1.0
Author Muhammad Umair Siddique
Status Draft
Reviewer(s) Mehboob Ur Rehman, Sohail Anjum
Review Date 7-April-2025
Updated By
Updated Date 14-Apr-2025
Approver
Issue Date
Distribution SD Wing
Document Internal External
Category
Privacy Level Public PRAL Confidential Customer Confidential
Disclaimer This document contains confidential information. Do not distribute this
document without prior approval from PRAL.

Review History
Sr. # Reviewer R/V Date Remarks
1.
2.
3.
4.

2
Document Version :1.0 PRAL © 2025 – All rights reserved Page 2 of 28
DI API Technical Specification

Contents
1. Purpose ................................................................................................................................................. 4
2. Data Sharing Mode ............................................................................................................................... 5
3. Web API................................................................................................................................................. 5
3.1. Web API Security........................................................................................................................... 5
3.2. Web Methods Details ................................................................................................................... 5
4. Digital Invoicing API............................................................................................................................... 6
4.1. Web method for Digital Invoicing - Post ....................................................................................... 6
4.2. Web method for Digital Invoicing - Validate............................................................................... 11
5. Digital Invoicing Reference APIs.......................................................................................................... 18
5.1. Web method for Digital Invoicing – Province Code .................................................................... 18
5.2. Web method for Digital Invoicing – Document Type ID ............................................................. 19
5.3. Web method for Digital Invoicing – Item Code .......................................................................... 20
5.4. Web method for Digital Invoicing – SRO Item ID ........................................................................ 21
5.5. Web method for Digital Invoicing – Transaction Type ID ........................................................... 22
5.6. Web method for Digital Invoicing – ID of the UOM .................................................................... 22
5.7. Web method for Digital Invoicing – ID of the SRO...................................................................... 24
5.8. Web method for Digital Invoicing – ID of The Rate .................................................................... 25
5.9. Web method for Digital Invoicing – HS Code.............................................................................. 26
5.10. Web method for Digital Invoicing – Item ID ........................................................................... 27
6. Digital Invoicing Logo & QR Code........................................................................................................ 28

3
Document Version :1.0 PRAL © 2025 – All rights reserved Page 3 of 28
DI API Technical Specification

1. Purpose
The purpose of this document is to facilitate Supply Chain Operators to understand the
methods for Digital Invoice Data sharing with FBR.

Figure 1 - Invoice Focalization Process

ERP or equivalent software will be integrated with FBR as per the following steps:
• Each ERP or equivalent software will register in the FBR system from which it wants to
upload the invoice data.
• Taxpayers will integrate their ERP/System with FBR Digital Invoicing System as per
provided details in the Section (3) Integration Steps with FBR.

4
Document Version :1.0 PRAL © 2025 – All rights reserved Page 4 of 28
DI API Technical Specification

2. Data Sharing Mode


Digital Invoicing sharing mode will be real-time using Web API shared by FBR. The Data
Format of this service will be as per object models referred below in this document.

3. Web API
This Web API resides on PRAL ESP (Enterprise Service Platform) and is exposed with
methods to facilitate Digital Invoicing sharing between Supply Chain Operators and FBR.

3.1. Web API Security


This Web API is secured and will require a security token to be passed in the header of
each request. This security token will be issued by PRAL and given to Supply Chain
Operators along with all URLs to access the web API. This security token will have a validity
of 5 Years, and a new token will be requested by the Supply Chain Operators upon expiry,
and a new security token will automatically be issued to access these services.

Figure 1 below illustrates how to pass this token in the header of each request using
Postman.

Figure 2 Security Key added with the word "Bearer" will be passed on in Value of parameter
Authorization

3.2. Web Methods Details


Web APIs expose different web methods for data sharing. The details of these web
methods are as follows.
• Digital Invoicing API
• Digital Invoicing Reference APIs

5
Document Version :1.0 PRAL © 2025 – All rights reserved Page 5 of 28
DI API Technical Specification

4. Digital Invoicing API


• Web method for Digital Invoicing - Post
• Web method for Digital Invoicing - Validate
Note: DI data acquisition API URL's are mentioned in this document will remain the same for
Sandbox and Production routing will be based on the security token being used.

4.1. Web method for Digital Invoicing - Post


The first web method (postinvoicedata) will be used on a real time basis. The API
consumer will have to send object model mentioned below. This method will take
following parameters and will return JSON response as shown in example below.
URL: https://gw.fbr.gov.pk/di_data/v1/di/postinvoicedata

4.1.1. Sample JSON Data:


Input Parameters of the first web method (postinvoicedata) will be as follows:
Note: Invoice Header will only be added once in the object model.

"invoiceType": "Sale Invoice",

"invoiceDate": "2024-05-16",

"sellerBusinessName": "Business Name",

"sellerAddress": "Rawalpindi",

"sellerProvince": "Punjab",

"buyerNTNCNIC": "1234567890123",

"buyerBusinessName": "John Doe",

"buyerProvince": "Sindh",

"buyerAddress": "Karachi",

"invoiceRefNo": "",

6
Document Version :1.0 PRAL © 2025 – All rights reserved Page 6 of 28
DI API Technical Specification

"items": [

"hsCode": "99260000",

"productDescription": "OTHER",

"rate": “17%”,

"uoM": "KG",

"quantity": 100,

"totalValues": 1170.00,

"valueSalesExcludingST": "1000",

"salesTaxApplicable": 170,

"salesTaxWithheldAtSource": 50.00,

"extraTax": 75.00,

"furtherTax": 90.00,

"sroScheduleNo": "SRO123",

"fedPayable": 0,

"discount": 0,

"saleType": "Services",

"sroItemSerialNo": "1"

} ,

7
Document Version :1.0 PRAL © 2025 – All rights reserved Page 7 of 28
DI API Technical Specification

"hsCode": "99260001",

"productDescription": "OTHER",

"rate": “18%”,

"uoM": "KG",

"quantity": 10,

"totalValues": 1170.00,

"valueSalesExcludingST": "1000",

"salesTaxApplicable": "170",

"salesTaxWithheldAtSource": 50.00,

"extraTax": 75.00,

"furtherTax": 90.00,

"sroScheduleNo": "SRO123",

"fedPayable": 0,

"discount": 0,

"saleType": " Goods",

"sroItemSerialNo": "2"

]}

8
Document Version :1.0 PRAL © 2025 – All rights reserved Page 8 of 28
DI API Technical Specification

Invoice Field Description

Json
JSON Field required sample data Description
DataType
Date and time when the invoice
invoiceDate datetime Required "2024-05-16"
was issued.
sellerBusinessName string Required "General business" Seller Business Name
sellerAddress string Required "Rawalpindi" Seller business Address
sellerProvince string Required "Punjab" Seller province
buyerNTNCNIC string Required 1234567890123 Buyer Registration No
buyerBusinessName string Required "John Doe" Buyer Name
Total number of items in the
buyerProvince string Required "Sindh"
invoice.
Total discount applied to the
buyerAddress string Required "Karachi"
invoice.

• Sales Invoice
InvoiceType Int Required 1 • Purchase Invoice
• Debit Note

Required
only in case
7327556DI1744111990654 Reference Invoice no for the
invoiceRefNo String of
debit/credit note
debit/credit
note

Invoice Items Field Description

Json
JSON Field required sample data Description
DataType
HS Code is applicable to
hsCode string Required "99260000" manufacturer-cum-retailer issuing
electronic invoices
productDescription string Required "OTHER" Product detail
Tax Rate (ratE_DESC from
rate string Required 17%
reference API 5.8)
uoM string Required "KG" Unit of Measurement
quantity int Required 100 Item Quantity
totalValues double Required 1170.00 Total Sales Value
valueSalesExcludingST double Required 1000 Sales Value Excluding sales tax
Amount of Sales Tax/ FED in sales
salesTaxApplicable int Required 170
tax mode
salesTaxWithheldAtSource double Required 150.00 Sales Tax Withheld at source
sroScheduleNo string Optional "SRO123" SRO Schedule No

9
Document Version :1.0 PRAL © 2025 – All rights reserved Page 9 of 28
DI API Technical Specification

sroItemSerialNo string Optional "1" Item serial number


furtherTax double Optional 70.00 Further Tax
discount double Optional 70.00 Discount

fedPayable double Optional 70.00 Federal excise duty payable

saleType string Required "Services" Type of Sale

extraTax double Optional 0.00 Extra Tax

4.1.2. Sample JSON Response:

{
"invoiceNumber": "8885801DI1740728862069",

"dated": "2/28/25, 12:47 PM ",

"validationResponse": {

"statuscode": "00",

"status": "valid",

"errors": "",

"invoiceStatuses": [

{
"itemSNo": "1"

"statuscode": "00",

"status": "Valid",

"invoiceNo": "8885801DI1740728862069",

"remarks": "",
},

10
Document Version :1.0 PRAL © 2025 – All rights reserved Page 10 of 28
DI API Technical Specification

"itemSNo": "2"

"statuscode": "00",

"status": "Valid",

"invoiceNo": "8885801DI1740728862069",

"remarks": "",
},
]
}
}

S. No Field Message
1. Invoice Number Invoice Number issued by FBR System
2. Status Code 00 - Valid
01 – Invalid
3. Exception Details of the errors
4. Invoice Status Item Serial Number
Statuscode (00 valid, 01 Invalid)
Status (“Valid or invalid)
Invoice Number (Invoice Number Issued by FBR
System)
Remarks:

4.1.3. HTTP Status Codes:

S. No Status Code Message


1. 200 Ok
2. 401 Unauthorized
3. 500 Internal Server Error (Contact Administrator)

4.2. Web method for Digital Invoicing - Validate


The second web method (validateinvoicedata) will be used on a real time basis. API
consumer will have to send object model mentioned below. This method will take
following parameters and will return Json response as shown in example below.
URL: https://gw.fbr.gov.pk/di_data/v1/di/validateinvoicedata

11
Document Version :1.0 PRAL © 2025 – All rights reserved Page 11 of 28
DI API Technical Specification

4.2.1. Sample JSON Data:


Input Parameters of the first web method validate) will be as follows:
Note: Invoice Header will only be added once in the object model.

"invoiceType": "Sale Invoice",

"invoiceDate": "2024-05-16",

"sellerBusinessName": "Business Name",

"sellerAddress": "Rawalpindi",

"sellerProvince": "Punjab",

"buyerNTNCNIC": "1234567890123",

"buyerBusinessName": "John Doe",

"buyerProvince": "Sindh",

"buyerAddress": "Karachi",

"invoiceRefNo": "",

"items": [

"hsCode": "99260000",

"productDescription": "OTHER",

"rate": “17%”,

"uoM": "KG",

12
Document Version :1.0 PRAL © 2025 – All rights reserved Page 12 of 28
DI API Technical Specification

"quantity": 100,

"totalValues": 1170.00,

"valueSalesExcludingST": "1000",

"salesTaxApplicable": 170,

"salesTaxWithheldAtSource": 50.00,

"extraTax": 75.00,

"furtherTax": 90.00,

"sroScheduleNo": "SRO123",

"fedPayable": 0,

"discount": 0,

"saleType": "Services",

"sroItemSerialNo": "1"

} ,

"hsCode": "99260001",

"productDescription": "OTHER",

"rate": “18%”,

"uoM": "KG",

"quantity": 10,

"totalValues": 1170.00,

13
Document Version :1.0 PRAL © 2025 – All rights reserved Page 13 of 28
DI API Technical Specification

"valueSalesExcludingST": "1000",

"salesTaxApplicable": "170",

"salesTaxWithheldAtSource": 50.00,

"extraTax": 75.00,

"furtherTax": 90.00,

"sroScheduleNo": "SRO123",

"fedPayable": 0,

"discount": 0,

"saleType": " Goods",

"sroItemSerialNo": "2"

]}

Invoice Field Description

Json
JSON Field required sample data Description
DataType
Date and time when the invoice was
invoiceDate datetime Required "2024-05-16"
issued.
sellerBusinessName string Required "General business" Seller Business Name
sellerAddress string Required "Rawalpindi" Seller Business Address
sellerProvince string Required "Punjab" Seller Province
buyerNTNCNIC string Required 1234567890123 Buyer NTN Registration no
buyerBusinessName string Required "John Doe" Buyer Name
buyerProvince string Required "Sindh" Total number of items in the invoice.
Total discount applied to the
buyerAddress string Required "Karachi"
invoice.

14
Document Version :1.0 PRAL © 2025 – All rights reserved Page 14 of 28
DI API Technical Specification

• Sales Invoice
• Purchase Invoice
InvoiceType Int Required 1
• Debit Note
• Credit Note
Required
only in case
7327556DI1744111990654 Reference Invoice no for the
invoiceRefNo String of
debit/credit note
debit/credit
note

Invoice Items Description

Json
JSON Field required sample data Description
DataType
HS Code is applicable to
hsCode string Required "99260000" manufacturer-cum-retailer issuing
electronic invoices
productDescription string Required "OTHER" Product detail
Tax Rate (ratE_DESC from
rate string Required 17%
reference API 5.8)
uoM string Required "KG" Unit of Measurement
quantity int Required 100 Item Quantity
totalValues double Required 1170.00 Buyer NTN Registration no
valueSalesExcludingST double Required 1000 Sales Value Excluding sales tax
salesTaxApplicable int Required 170 Amount of Sales Tax
salesTaxWithheldAtSource double Required 150.00 Sales tax withheld at source
sroScheduleNo string Optional "SRO123" SRO Schedule No.
furtherTax double Optional 70.00 Further Tax
discount double Optional 70.00 Discount
Federal excise duty payable in
fedPayable double Optional 70.00
sales tax mode
sroItemSerialNo string Optional "1" SRO Item Serial Number
saleType string Required "Services" Sale Type
extraTax double Optional 0.00 Extra Tax

4.2.2. Sample Json Response:

"dated": "2/28/25, 3:42 PM",


15
Document Version :1.0 PRAL © 2025 – All rights reserved Page 15 of 28
DI API Technical Specification

"validationResponse": {

"status": "Valid",

"statuscode": "00",

"errors": "",

"invoiceStatuses": [

{
"itemSNo": "1"

"statuscode": "00",

"status": "Valid",

"invoiceNo": "null",

"remarks": "",
},
{
"itemSNo": "2"

"statuscode": "00",

"status": "Valid",

"invoiceNo": "null",

"remarks": "",
}

16
Document Version :1.0 PRAL © 2025 – All rights reserved Page 16 of 28
DI API Technical Specification

S. No Field Message
1. Status Code 00 - Valid
01 – Invalid
2. Exception Details of the errors
3. Invoice Status Item Serial Number
Statuscode (00 valid, 01 Invalid)
Status (“Valid or invalid)
Invoice Number (Invoice Number Issued by FBR
System)
Remarks:

4.2.3. Http Status Codes:

S. No Status Code Message


1. 200 Ok
2. 401 Unauthorized
3. 500 Internal Server Error (Contact Administrator)

17
Document Version :1.0 PRAL © 2025 – All rights reserved Page 17 of 28
DI API Technical Specification

5. Digital Invoicing Reference APIs


• Web method for Digital Invoicing – Province Code
• Web method for Digital Invoicing – Document Type
• Web method for Digital Invoicing – Item Code
• Web method for Digital Invoicing – SRO item ID
• Web method for Digital Invoicing – Transaction Type ID
• Web method for Digital Invoicing – UOM ID
• Web method for Digital Invoicing – SRO ID
• Web method for Digital Invoicing – Sale Type To Rate
• Web method for Digital Invoicing – HS_UOM
• Web method for Digital Invoicing – SRO item ID

5.1. Web method for Digital Invoicing – Province Code

This Web method (provinces) HTTP meth Get will be used on a real time basis. API
consumer will have to send object model mentioned below. This method will take
following parameters and will return Json response as shown in example below.
URL: https://gw.fbr.gov.pk/pdi/v1/provinces

5.1.1. Sample JSON Data:


API requires no request input.

5.1.2. Sample Json Response:

[ {
"stateProvinceCode": 7,
"stateProvinceDesc": "PUNJAB"
},
{
"stateProvinceCode": 8,
"stateProvinceDesc": "SINDH"
}
]

18
Document Version :1.0 PRAL © 2025 – All rights reserved Page 18 of 28
DI API Technical Specification

S. No Field Description
1. StateprovinceCode Province code
2. stateprovinceDesc Description on the province
5.1.3. Http Status Codes:

S. No Status Code Message


1. 200 Ok
2. 401 Unauthorized
3. 500 Internal Server Error (Contact Administrator)

5.2. Web method for Digital Invoicing – Document Type ID


This Web method (doctypecode) HTTP meth Get will be used on a real time basis. API
consumer will have to send object model mentioned below. This method will take
following parameters and will return Json response as shown in example below.
URL: https://gw.fbr.gov.pk/pdi/v1/doctypecode

5.2.1. Sample JSON Data:


API requires no request input.

5.2.2. Sample Json Response:

[{
"docTypeId": 4,
"docDescription": "Sale Invoice"
},
{
"docTypeId": 9,
"docDescription": "Debit Note"
}]

S. No Field Description
1. docTypeId Id for the document type
2. docDescription Description of the document type

19
Document Version :1.0 PRAL © 2025 – All rights reserved Page 19 of 28
DI API Technical Specification

5.2.3. Http Status Codes:

S. No Status Code Message


1. 200 Ok
2. 401 Unauthorized
3. 500 Internal Server Error (Contact Administrator)

5.3. Web method for Digital Invoicing – Item Code


This Web method (itemdesccode) HTTP meth Get will be used on a real time basis. API
consumer will have to send object model mentioned below. This method will take
following parameters and will return Json response as shown in example below.
URL: https://gw.fbr.gov.pk/pdi/v1/itemdesccode

5.3.1. Sample JSON Data:


API requires no request input.

5.3.2. Sample Json Response:

[{
"hS_CODE": "8432.1010",
"description": "NUCLEAR REACTOR, BOILERS, MACHINERY AND
MECHANICAL APPLIANCES; PARTS THEREOF. - AGRICULTURAL,
HORTICULTURAL OR FORESTRY MACHINERY FOR SOIL PREPARATION OR
CULTI- VATION; LAWN OR SPORTS GROUND ROLLERS. - CHISEL
PLOUGHS"
},
{
"hS_CODE": "0304.7400",
"description": "FISH AND CRUSTACEANS, MOLLUSCS AND OTHER
AQUATIC INVERTEBRATES - FISH FILLETS AND OTHER FISH MEAT
(WHETHER OR NOT MINCED), FRESH, CHILLED OR FROZEN. - HAKE
(MERLUCCIUS SPP., UROPHYCIS SPP.)"
}]

S. No Field Description
1. Hs_Code HS Code
2. description Description of the HSCode

20
Document Version :1.0 PRAL © 2025 – All rights reserved Page 20 of 28
DI API Technical Specification

5.3.3. Http Status Codes:

S. No Status Code Message


1. 200 Ok
2. 401 Unauthorized
3. 500 Internal Server Error (Contact Administrator)

5.4. Web method for Digital Invoicing – SRO Item ID


This Web method (sroitemcode) HTTP meth Get will be used on a real time basis. API
consumer will have to send object model mentioned below. This method will take
following parameters and will return Json response as shown in example below.
URL: https://gw.fbr.gov.pk/pdi/v1/sroitemcode

5.4.1. Sample JSON Data:


API requires no request input.

5.4.2. Sample Json Response:

[
{
"srO_ITEM_ID": 724,
"srO_ITEM_DESC": "9"
},
{
"srO_ITEM_ID": 728,
"srO_ITEM_DESC": "1"
}
]
S. No Field Description
1. Sro_ITEM_ID SRO item id
2. srO_ITEM_DESC SRO Item Description

5.4.3. Http Status Codes:

S. No Status Code Message


1. 200 Ok
2. 401 Unauthorized
3. 500 Internal Server Error (Contact Administrator)

21
Document Version :1.0 PRAL © 2025 – All rights reserved Page 21 of 28
DI API Technical Specification

5.5. Web method for Digital Invoicing – Transaction Type ID


This Web method (transtypecode) HTTP meth Get will be used on a real time basis. API
consumer will have to send object model mentioned below. This method will take
following parameters and will return Json response as shown in example below.
URL: https://gw.fbr.gov.pk/pdi/v1/transtypecode

5.5.1. Sample JSON Data:


API requires no request input.

5.5.2. Sample Json Response:

[
{
"transactioN_TYPE_ID": 82,
"transactioN_DESC": "DTRE goods"
},
{
"transactioN_TYPE_ID": 87,
"transactioN_DESC": "Special procedure cottonseed"
},
{
"transactioN_TYPE_ID": 111,
"transactioN_DESC": "Electricity Supplied to marble/granite
industry"
}
]
S. No Field Description
1. transactioN_TYPE_ID Transaction type id
2. transaction_DESC Description of the transaction type
5.5.3. Http Status Codes:

S. No Status Code Message


1. 200 Ok
2. 401 Unauthorized
3. 500 Internal Server Error (Contact Administrator)

5.6. Web method for Digital Invoicing – ID of the UOM


This Web method (uom) HTTP meth Get will be used on a real time basis. API consumer
will have to send object model mentioned below. This method will take following
parameters and will return Json response as shown in example below.
22
Document Version :1.0 PRAL © 2025 – All rights reserved Page 22 of 28
DI API Technical Specification

URL: https://gw.fbr.gov.pk/pdi/v1/uom

5.6.1. Sample JSON Data:


API requires no request input.

5.6.2. Sample Json Response:

[
{
"uoM_ID": 77,
"description": "Square Metre"
},
{
"uoM_ID": 13,
"description": "KG"
}
]
S. No Field Description
1. UOM_ID ID of the UOM
2. Description Description of the UOM
5.6.3. Http Status Codes:

S. No Status Code Message


1. 200 Ok
2. 401 Unauthorized
3. 500 Internal Server Error (Contact Administrator)

23
Document Version :1.0 PRAL © 2025 – All rights reserved Page 23 of 28
DI API Technical Specification

5.7. Web method for Digital Invoicing – SRO Schedule


This Web method (srosched) HTTP meth Get will be used on a real time basis. API
consumer will have to send object model mentioned below. This method will take
following parameters and will return Json response as shown in example below.
URL: https://gw.fbr.gov.pk/pdi/v1/srosched

5.7.1. Sample JSON Data:


API requires no request input.

5.7.2. Sample Json Response:

[
{
"srO_ID": 7,
"srO_DESC": "Zero Rated Gas"
},
{
"srO_ID": 8,
"srO_DESC": "5th Schedule"
}

]
S. No Field Description
1. SRO_ID ID of the SRO
2. srO_DESC Description of the SRO
5.7.3. Http Status Codes:
S. No Status Code Message
1. 200 Ok
2. 401 Unauthorized
3. 500 Internal Server Error (Contact Administrator)

24
Document Version :1.0 PRAL © 2025 – All rights reserved Page 24 of 28
DI API Technical Specification

5.8. Web method for Digital Invoicing – ID of The Rate


This Web method (SaleTypeToRate) HTTP meth Get will be used on a real time basis.
API consumer will have to send object model mentioned below. This method will take
following parameters and will return Json response as shown in example below.
URL: https://gw.fbr.gov.pk/pdi/v2/SaleTypeToRate?date=24-Feb-
2024&transTypeId=18&originationSupplier=1

5.8.1. Sample JSON Data:


API requires the following input as a query string.
S. No Field Description
1. date Date
2. transTypeId ID of the transaction type
3. originationSuppl Province ID

5.8.2. Sample Json Response:

[
{
"ratE_ID": 734,
"ratE_DESC": "18% along with rupees 60 per kilogram",
"ratE_VALUE": 18
}
,
{
"ratE_ID": 280,
"ratE_DESC": "0%",
"ratE_VALUE": 0
}
]
S. No Field Description
1. Rate_ID ID of the rate
2. rate_DESC Description of the rate
3. Rate_VALUE Value of the rate
5.8.3. Http Status Codes:

S. No Status Code Message


1. 200 Ok
2. 401 Unauthorized
3. 500 Internal Server Error (Contact Administrator)

25
Document Version :1.0 PRAL © 2025 – All rights reserved Page 25 of 28
DI API Technical Specification

5.9. Web method for Digital Invoicing – HS Code with UOM


This Web method (HS_UOM) HTTP method Get will be used on a real time basis. API
consumer will have to send object model mentioned below. This method will take
following parameters and will return Json response as shown in example below.
URL: https://gw.fbr.gov.pk/pdi/v2/HS_UOM?hs_code=5904.9000&annexure_id=3

5.9.1. Sample JSON Data:


API requires the following input as a query string.
S. No Field Description
1. Hs_code HS code
2. Annexureid Sales annexure id

5.9.2. Sample Json Response:

[
{
"uoM_ID": 77,
"description": "Square Meter"
}
]

]
S. No Field Description
1. uoM_ID ID of the unit of measure
2. description Description of the unit of measure
5.9.3. Http Status Codes:

S. No Status Code Message


1. 200 Ok
2. 401 Unauthorized
3. 500 Internal Server Error (Contact Administrator)

26
Document Version :1.0 PRAL © 2025 – All rights reserved Page 26 of 28
DI API Technical Specification

5.10. Web method for Digital Invoicing – SRO Item ID


This Web method (SROItem) HTTP meth Get will be used on a real time basis. API
consumer will have to send object model mentioned below. This method will take
following parameters and will return Json response as shown in example below.
URL: https://gw.fbr.gov.pk/pdi/v2/SROItem?date=2025-03-25&sro_id=389

5.10.1. Sample JSON Data:


API requires the following input as a query string.
S. No Field Description
1. Date Date
2. Sro_id Sro id

5.10.2. Sample Json Response:

[
{
"srO_ITEM_ID": 17853,
"srO_ITEM_DESC": "50"
},
{
"srO_ITEM_ID": 17854,
"srO_ITEM_DESC": "51"
}

]
S. No Field Description
1. Sro_ITEM_ID Item id
2. Sro_ITEM_DESC Description of the Item
5.10.3. Http Status Codes:

S. No Status Code Message


1. 200 Ok
2. 401 Unauthorized
3. 500 Internal Server Error (Contact Administrator)

27
Document Version :1.0 PRAL © 2025 – All rights reserved Page 27 of 28
DI API Technical Specification

6. Digital Invoicing Logo & QR Code Printing


The below Digital Invoicing System logo and QR code must be printed on each invoice issued by
the taxpayers.

Ensure the following specifications for QR Code Printing:

QR Code Version: 2.0 (25×25)


QR Code Dimensions: 1.0 x 1.0 Inch.

Use FBR Digital Invoicing System image to print on receipts

28
Document Version :1.0 PRAL © 2025 – All rights reserved Page 28 of 28

You might also like