Online PAN Verification Process API Using PHP Laravel
Permanent Account Number (PAN) is a unique code that acts as an identification for Indian citizens who pay Income Tax. This 10-character alphanumeric identifier is assigned to all individuals identifiable under the Income Tax Act, 1961. An example is BJSPK7865D. This is issued by the Income Tax Authority of India and acts as a proof of identification. The primary usage of PAN is to identify and track all financial transactions and ensure the absence of tax evasion by tracking all economic transactions, especially those of high net worth individuals (HNI).
PAN has become an indispensable tool for KYC for India focused applications. Here is a short tutorial on how to integrate PAN verification into your app.
The PAN API Integration facility is an interface that allows the user to make an online verification of PAN by accessing the verification-site through a software application.
Following are the steps to achieve the verification process
- Digital Signature Certificate
- NSDL e-Gov Registration
- Server Setup
- Integration with Laravel
1. Digital Signature Certificate (DSC)
The entity must have a Digital Signature Certificate (Class II or Class III) from any of the licensed Certifying Authorities specified below for digitally signing the application and the files uploaded online.
The Digital Signature Certificate can be procured from the following Certifying Authorities.
- Institute of Development & Research in Banking Technology (IDRBT)
- (n)Code Solutions
- Capricorn Identity Services
Pre-requisite for the API is a Digital Signature Certificate. We need to apply for a DSC , in the name of the applicant. When we are going for a hosted environment, in a cloud server a .PFX format is required. This can be acquired from eMudhra or any other certificate providers.
2.NSDL e-Gov Registration
Online PAN verification must be done by registering with NSDL e-Gov with DSC (Digital Signature Certificate) from Certifying Authorities.
Details required to be provided at the time of online registration are as mentioned below:
- Organisational Details
- Reason for availing PAN verification facility
- Payment details
- Digital Signature Certificate (DSC)
- Details of DSC are optional at the time of online registration. However, DSC is mandatory for PAN verification. For details related to DSC, kindly refer https://www.tin-nsdl.com/pan-verify/pan-verification-prerequisite.php
Once the registration is made, the entity should forward the following documents to NSDL e-Gov:
- Authorisation letter
- Signed copy of the Terms & Conditions should be provided on the letterhead of the Entity
- Demand Draft/ Cheque (subject to realization) for applicable Charges
- Screen shots of DSC*
- Supporting document to category (if applicable & requested by NSDL e-Gov). For ex. RBI certificate, SEBI certificate etc.
Get Digital Signature Certificate from Certifying Authorities in the format of .pfx file and password.
Download Java based sample code for PAN verification API( using “java based .pfx code”).
Extract the file using NSDL user account password.
To run the API, you need to have latest Java installed on your server.
Set class-path in the following manner.
- To create the pan folder within the public folder and move the sample code, .pfx file.
- Open Terminal and type the following (Replace /path/to/ with the path to the respective files)
To convert pfx into a jks (java key store) run the keystore converter.
- Move to deliverable folder, compile the p2j.java & pkcs7gen.java files using below command
- convert pfx into a jks using below command
certi.pfx is the name of the .pfx file containing the certificate and the private key.
pfxpswd is the password of the pfx.
oupt.jks is the name of the java key store which will be generated by executing p2j.
To modify the APIBased.java file.Open the APIBased.java file in editor, find the below code
Replace the below code
Replace the new URL for API
For generating the .sig file and calling api, we have to run the bellow java command
The sample output will be like this:
Here “1” is the return code and followed by details.
Return Codes with Descriptions
User not authorized
No PANs Entered
User validity has expired
Number of PANs exceeds the limit (5)
Not enough balance
Not an HTTPs request
POST method not used
Slab Change Running
4.Integration with Laravel
Integrating with Laravel using shell execution command.Here are a few code snippets for the Laravel API calls.
Add the following route in the routes.php:
Add the following controller file PanVerificationController.php with function panVerification
Sample API call for Aadhaar verification: