Quickstart
What is Setu PAN API?
Setu PAN API allows you to use just one API to verify your customer’s PAN details. We directly connect with NSDL, to maintain the best uptimes.
What can I do with this product?
Use our lightweight PAN API to verify your customer, with their consent—to check identity during onboarding, enable other financial products or to enable income tax filing/verification.
Here’s a quick overview of the PAN API. Additionally, here are the URLs you would need for this API—
- Sandbox—
https://dg-sandbox.setu.co - Production—
https://dg.setu.co - Headers—Contact Setu for providing the credentials required to successfully call Setu APIs. This contains:
x-client-idx-client-secretx-product-instance-id
Verify PAN
Call this API to verify a PAN provided by your customer. A quick explanation of the request params—
panis the PAN value. It may belong to different categories like Person, Company, Trust, Goverment, Firm, etc.consentindicates if you have collected consent from your customer. To get a successful verification, it must containYory.reasonis the explanation of why you are requesting for PAN from your customer. It should be explained in 20 characters or more.
While the implementation of consent and reason
cannot be enforced by Setu, we recommend collecting explicit consent from your
customers and also explaining to your customers the reason why you are
verifying their PAN.
While testing on Sandbox, you may use the following sample values—
- Use ABCDE1234A for a valid PAN
- Use ABCDE1234B for an invalid PAN, i.e, a PAN number has been found but is invalid. A PAN is considered invalid by NSDL for different reasons. For e.g, if it is a blacklisted one, or maybe because it is not linked to an Aadhaar card.
- If you use any other values for
pan, you will get a 404 PAN not found error.
SUCCESS Your request has a valid pan and Setu has processed your request successfully.
Request
POST /api/verify/pan
{
"pan": "ABCDE1234A",
"consent": "Y" ,
"reason": "Reason for verifying PAN set by the developer"
} Response
{
"data": {
"aadhaar_seeding_status": "LINKED", // optional
"category": "Individual",
"full_name": "John Doe",
"first_name": "John Hartwell",
"middle_name": "Walter",
"last_name": "Doe"
},
"message": "PAN is valid",
"verification": "success",
"traceId": "1-6346a91a-620cf6cc4f68d2e30316881e"
} SUCCESS Setu has processed your request successfully, but the request has an invalid pan
Request
POST /api/verify/pan
{
"pan": "ABCDE1234AZZ",
"consent": "Y" ,
"reason": "Reason for verifying PAN set by the developer"
} Response
{
"verification": "failed",
"message": "PAN is invalid"
} BAD REQUEST Your request does not have consent recorded as yes, from your customer’s end. This is indicated by y or Y against the consent param.
Request
POST /api/verify/pan
{
"pan": "ABCDE1234A",
"consent": "N" ,
"reason": "Reason for verifying PAN set by the developer"
} Response
{
"error": {
"code": "consent_not_given",
"detail": "Consent is required and should be Y/y.",
"traceId": "" // unique identifier for this error
}
} BAD REQUEST The reason
specified for verifying PAN details is not sufficiently long—it
should be greater than 20 characters.
Request
POST /api/verify/pan
{
"pan": "ABDPB123H",
"consent": "Y" ,
"reason": "reason < 20 chars"
} Response
{
"error": {
"code": "insufficient_reason_length",
"detail": "Reason should be at least 20 characters in length.",
"traceId": "" // unique identifier for this error
}
} FAILURE Setu has processed your
request successfully but the PAN does not exist.
Request
POST /api/verify/pan
{
"pan": "ABDPB123H",
"consent": "Y" ,
"reason": "Reason for verifying PAN set by the developer"
} Response
{
"message": "PAN not found.",
"verification": "failed"
}