If you need to know whether a PAN your user typed is real, what the Income Tax Department's record says about it, and whether the name on that record is the name your user gave you, you make one authenticated call: POST /v1/verify/pan. You send the ten-character number and, if you have it, the name. You get back a JSON object with a valid flag, the status of the PAN, the registered name when the record exists, and a name-match verdict and score when you supplied a name.
This page is the long version of that sentence. It explains what is inside a PAN and why the fourth letter matters to your routing logic, what the lookup actually returns and what it leaves out, how to read the name-match fields without inventing a threshold, what "valid" does and does not mean, how errors, retries, billing and rate limits behave, and what changes between the sandbox and production. It ends with worked examples, a list of mistakes we see in integrations, and answers to the questions developers and compliance teams ask most. If you only want the endpoint contract, the API reference is shorter.
What a PAN lookup tells you, and what it cannot
A Permanent Account Number is a record in the Income Tax Department's database. A lookup asks that database three things: does this number exist, in what state is the record, and what name is held against it. That is all. The lookup does not ask who is sitting at your keyboard.
This distinction decides where PAN verification belongs in your flow. A match between the number and a name proves the pair is consistent. It does not prove that the person submitting them is the holder, because anyone who has seen a PAN card can type the details. Teams that treat a PAN match as proof of identity end up with accounts opened by someone holding a borrowed card. Teams that treat it as one consistency check, followed by something that proves possession (a selfie match, a bank account in the same name, a signed document), get the benefit of the cheap check without the false confidence.
Three other things a PAN check does not do. It does not tell you whether a business is trading, registered for GST or solvent; those are separate registries, covered by the GSTIN, CIN and Udyam APIs. It does not return an address, a date of birth or a phone number, and you should not go looking for them in the response. And it is not a legal clearance: whether a result satisfies a rule that applies to you is a decision for your compliance owner, not something an API can settle.
Reading a PAN: the ten characters and the fourth letter
Every PAN follows the pattern AAAAA9999A: five letters, four digits, one letter. The characters are not random, and knowing what they encode lets you do useful work before you spend a single API call.
| Position | What it carries |
|---|---|
| 1 to 3 | An alphabetic series issued by the department. Treat as opaque. |
| 4 | The holder category: who or what this PAN was issued to. |
| 5 | First letter of the holder's surname (individuals) or of the entity's name (everyone else). |
| 6 to 9 | A running number from 0001 to 9999. |
| 10 | An alphabetic check character. The calculation is not published for general use, so do not try to validate it yourself. |
The fourth letter is the one worth building on. It tells you what kind of holder the number belongs to:
| 4th letter | Holder category |
|---|---|
| P | Individual (a person) |
| C | Company |
| H | Hindu Undivided Family |
| F | Firm, including a limited liability partnership |
| A | Association of persons |
| B | Body of individuals |
| T | Trust |
| L | Local authority |
| J | Artificial juridical person |
| G | Government |
Two practical uses follow. First, you can check the category locally. If your onboarding form says the customer is a private limited company and the PAN has P in the fourth position, something is wrong before any network call happens, and a free client-side check saves a paid server call. Second, the category tells you which follow-up APIs make sense: a C PAN opens the door to a CIN lookup and a PAN to GSTIN search, while a P PAN belonging to a sole proprietor is the natural input for PAN to Udyam.
The fifth letter is useful in a narrower way. For an individual it is the first letter of the surname, so a customer called Meera Iyer should have a PAN whose fifth character is I. A mismatch is a signal worth logging, though it is not proof of anything: names get changed on marriage, spellings differ between documents, and people sometimes hold a PAN issued under an older name. Use it as a soft hint to prompt the user to re-check their entry, never as a rejection rule.
One more structural fact: the StampMitra API validates the shape of the number (five uppercase letters, four digits, one uppercase letter) and nothing about the fourth letter. A PAN with an unusual fourth character fits the pattern and goes through to the lookup, which will simply say it is not valid. The helper below, which you can paste into your own code, decodes the category so you can compare it to what the user told you.
const PAN_RE = /^[A-Z]{5}[0-9]{4}[A-Z]$/;
const HOLDER = {
P: "individual", C: "company", H: "huf", F: "firm_or_llp", A: "aop",
B: "boi", T: "trust", L: "local_authority", J: "juridical_person", G: "government",
};
export function inspectPan(raw) {
const pan = String(raw ?? "").replace(/\s+/g, "").toUpperCase();
if (!PAN_RE.test(pan)) return { ok: false, pan };
return { ok: true, pan, holder: HOLDER[pan[3]] ?? "unknown", fifth: pan[4] };
}The request: fields, normalisation and what gets rejected
The endpoint takes a JSON body with two fields. pan is required and must match ^[A-Z]{5}[0-9]{4}[A-Z]$. name is optional, a string of at most 256 characters. The API rejects properties it does not know with a 400, so a typo such as fullName fails loudly instead of being ignored. Authentication is a bearer key with the verification.pan.read scope, sent as Authorization: Bearer <key> (the x-api-key header is also accepted).
Normalise before you send. Trim the string, remove internal spaces (people paste PANs with a space after the fifth character), and uppercase it. The validator is strict about case and will return a 400 for abcde1234f rather than fixing it for you, which is the right behaviour for an API and the wrong one for a form, so do the cleanup yourself. Ambiguous characters deserve a second look: the letter O and the digit 0, and the letter I and the digit 1, are the usual confusions. If the pattern fails and swapping one of those characters would make it pass, offer the correction to the user instead of silently applying it.
Send the name the way it would be printed on the card. That means the legal name, not a nickname, not a trade name, and without honorifics such as "Mr" or "Shri". For an entity PAN, send the registered legal name. A name is the only input that produces name-match fields, so if you have one, send it; if you do not, omit the field rather than sending an empty string.
Here is the smallest useful call.
curl -X POST "https://api-b2b.stampmitra.in/v1/verify/pan" \
-H "Authorization: Bearer $STAMPMITRA_API_KEY" \
-H "Idempotency-Key: 6f1b7f0e-3c59-4d61-9d4e-5a0f2b8f9a11" \
-H "Content-Type: application/json" \
-d '{"pan":"ABCDE1234F","name":"Rahul Kumar"}'The Idempotency-Key header is optional but worth sending on every call. The section on retries explains why.
What comes back, field by field
The request and response tables below are rendered from the same API data as the reference page, so they cannot disagree with it. Read them with one rule in mind: only referenceId and valid are guaranteed on every answer. Everything else is optional and appears only when the record exists and the registry returned it. A negative answer is deliberately sparse.
Request parameters
| Field | Type | Description |
|---|---|---|
Authorizationrequired | header | Bearer <api-key> (e.g. sk_test_... in sandbox, sk_live_... in production). The x-api-key header is also accepted. |
panrequired | string | PAN, format ABCDE1234F. |
name | string | Name to match against records (max 256 chars). |
Response fields
| Field | Type |
|---|---|
referenceId | string |
pan | string |
type | string |
valid | boolean |
registeredName | string |
fatherName | string |
panStatus | string |
panStatusCode | string |
panStatusDescription | string |
nameMatchResult | string |
nameMatchScore | string |
aadhaarSeedingStatus | string |
aadhaarSeedingStatusDescription | string |
lastUpdatedAt | string |
message | string |
A few fields need more than a table row.
referenceId has the form SMV-YYYYMMDD-XXXXXXX and is StampMitra's own identifier for the call. It is present even when valid is false. Store it next to your internal customer id; it is what support asks for. It is not an idempotency key, and sending it back to the API does nothing.
registeredName is the name held against the PAN. It is personal data. Store it only if you have a documented reason, and keep it out of logs.
panStatus is a label for the record's state, accompanied in the reference example by a short code and a description. The sample shows a valid, existing PAN. The registry can report other states, and the next chapter explains how to treat them without hard-coding a list you will have to maintain.
message is a human-readable sentence. Display it in an internal tool if you like. Do not parse it, because wording can change and your branching logic should not depend on it.
Treat unknown fields as additive. Ignore properties you do not use, and do not fail a request because a new field appeared.
What "valid" means, and why it is not the same as "operative"
valid: true says the registry found the number. It is a statement about existence. panStatus says what state the record is in. The two answer different questions, and conflating them is the most common modelling mistake with PAN data.
In the reference example the status code is E, described as an existing and valid PAN. That is the state you want to see. The registry can also carry other states for a record that exists: PANs that have been deleted or deactivated, PANs marked as fake, and existing PANs whose holder has undergone an event such as death, merger, partition or liquidation. Provider documentation lists several codes for these (codes starting with E for existing-but-affected records, and letters such as N, X, D and F for deleted, deactivated or flagged records), but the list is not something we guarantee to be exhaustive or stable. Our advice is to branch on three outcomes only: the record is valid and the status is the plain valid one, the record exists but carries any other status, or the record was not found. Send the middle group to a human or ask the user for a different document. Log the whole response so that a reviewer can see the exact status.
There is a related policy question that your compliance owner should answer, not your code. The response reports whether Aadhaar is linked to the PAN. Indian tax rules have required many PAN holders to link the two, and a PAN that was not linked by the deadline can be treated as inoperative until the position is regularised. The rules and dates have changed over time, so check the current position before you encode any consequence. What the API gives you is the link flag on the record. It does not verify anyone's Aadhaar, and StampMitra does not offer Aadhaar-based verification. Decide with your compliance owner whether an unlinked PAN blocks onboarding, triggers a message to the user, or is simply recorded.
A short decision table keeps the logic honest.
| What you see | What it suggests | Typical action |
|---|---|---|
valid: true, plain valid status | Record exists and is in good standing | Continue; run the name check |
valid: true, any other status | Record exists but something happened to it | Manual review or ask for another document |
valid: false | The registry has no such valid record | Ask the user to re-enter once; then escalate |
| HTTP 400 | Your input failed the format rule | Fix input; not a verdict on the PAN |
| HTTP 502 | The source could not be reached | Retry with backoff; no verdict exists |
Name matching: score, verdict and how to set your own policy
When you pass name and the PAN is valid, the response includes a verdict string and a numeric score from 0 to 100. The verdict values observed from the registry side are MATCH, GOOD_PARTIAL_MATCH, POOR_PARTIAL_MATCH and NO_MATCH. The score may arrive as a number or as a numeric string depending on the response version, so always parse it with Number() before comparing it.
We do not publish the comparison algorithm or a recommended cut-off, and this page will not invent one. Treat the verdict and score as inputs to a policy that you own. A reasonable starting point, which you should adjust against your own data, looks like this: accept automatically on MATCH; send GOOD_PARTIAL_MATCH to a light check, such as asking the user to confirm that the name shown is theirs; send POOR_PARTIAL_MATCH and NO_MATCH to review or re-entry. Keep the thresholds in configuration and version them, so you can explain months later why an application was handled the way it was.
What makes a name differ from the record? Understanding the common causes lets you fix inputs instead of loosening policy.
| Variation | Example | What to do |
|---|---|---|
| Initials versus expanded names | R. K. Sharma against Rajesh Kumar Sharma | Ask for the name as printed on the card |
| Name order | Kumar Rahul against Rahul Kumar | Collect given and family names in separate fields, join in card order |
| Honorifics and suffixes | Shri, Smt, Mr, Dr | Strip before sending |
| Spelling and transliteration | Mohammed, Mohammad, Muhammad | Expect partial matches; do not auto-reject |
| Married-name changes | Maiden name on the PAN | Offer a path to explain, with a supporting document |
| Entity names | Pvt Ltd against Private Limited | Send the registered legal name |
| Trade names | Brand name instead of legal name | Never send a brand for a PAN lookup |
The row that causes the most avoidable rejections is the entity one. People type "Acme Traders" into a field that should hold "Acme Traders Private Limited" and then wonder why a valid company PAN scores poorly. If your form collects both a brand name and a legal name, label them clearly and send only the legal one.
Do not auto-reject on a partial match alone. A person with one weak signal and otherwise consistent data is more likely to be a typo than a fraudster. Reject on repeated failure, or on a mismatch combined with other risk signals, and give the user one clear chance to correct their input first.
Calling the API from Node.js and Python with real error handling
Both clients below do the same things: normalise and pre-check the PAN, send an idempotency key, retry only the failures that can succeed on a retry, and separate transport problems from verdicts. The key is read from the environment and the full PAN is never logged.
// verify-pan.mjs (Node.js 18+)
import { randomUUID } from "node:crypto";
const BASE = "https://api-b2b.stampmitra.in";
const PAN_RE = /^[A-Z]{5}[0-9]{4}[A-Z]$/;
const RETRYABLE = new Set([429, 502, 503, 504]);
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
export async function verifyPan(rawPan, name) {
const pan = String(rawPan ?? "").replace(/\s+/g, "").toUpperCase();
if (!PAN_RE.test(pan)) return { outcome: "bad_input" };
const body = JSON.stringify({ pan, ...(name?.trim() ? { name: name.trim() } : {}) });
const key = randomUUID(); // reuse the SAME key across retries of this one request
for (let attempt = 1; attempt <= 4; attempt++) {
let res;
try {
res = await fetch(`${BASE}/v1/verify/pan`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.STAMPMITRA_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": key,
},
body,
signal: AbortSignal.timeout(20_000),
});
} catch {
if (attempt === 4) return { outcome: "unavailable" };
await sleep(2 ** attempt * 500 + Math.random() * 250);
continue;
}
const json = await res.json().catch(() => ({}));
if (res.ok) {
return {
outcome: json.valid === true ? "valid" : "not_valid",
referenceId: json.referenceId,
panStatus: json.panStatus,
verdict: json.nameMatchResult,
score: json.nameMatchScore === undefined ? undefined : Number(json.nameMatchScore),
};
}
const err = json.error ?? {};
if (RETRYABLE.has(res.status) && attempt < 4) {
await sleep(2 ** attempt * 500 + Math.random() * 250);
continue;
}
return { outcome: res.status === 402 ? "wallet_empty" : "error", status: res.status, code: err.code, requestId: err.requestId };
}
}# verify_pan.py (Python 3.9+, pip install requests)
import os, re, time, uuid, random, requests
BASE = "https://api-b2b.stampmitra.in"
PAN_RE = re.compile(r"^[A-Z]{5}[0-9]{4}[A-Z]$")
RETRYABLE = {429, 502, 503, 504}
def verify_pan(raw_pan, name=None):
pan = re.sub(r"\s+", "", raw_pan or "").upper()
if not PAN_RE.match(pan):
return {"outcome": "bad_input"}
payload = {"pan": pan}
if name and name.strip():
payload["name"] = name.strip()
key = str(uuid.uuid4()) # one key per logical request, reused on retry
for attempt in range(1, 5):
try:
r = requests.post(
f"{BASE}/v1/verify/pan",
json=payload,
headers={
"Authorization": f"Bearer {os.environ['STAMPMITRA_API_KEY']}",
"Idempotency-Key": key,
},
timeout=20,
)
except requests.RequestException:
if attempt == 4:
return {"outcome": "unavailable"}
time.sleep(2 ** attempt * 0.5 + random.random() * 0.25)
continue
body = r.json() if r.content else {}
if r.ok:
score = body.get("nameMatchScore")
return {
"outcome": "valid" if body.get("valid") is True else "not_valid",
"referenceId": body.get("referenceId"),
"panStatus": body.get("panStatus"),
"verdict": body.get("nameMatchResult"),
"score": float(score) if score is not None else None,
}
if r.status_code in RETRYABLE and attempt < 4:
time.sleep(2 ** attempt * 0.5 + random.random() * 0.25)
continue
err = body.get("error", {})
return {"outcome": "wallet_empty" if r.status_code == 402 else "error",
"status": r.status_code, "code": err.get("code"), "requestId": err.get("requestId")}Notice what the return values separate: bad_input means your own pre-check failed and no call was made; not_valid is a completed verdict about the PAN; unavailable means no verdict exists and the application should wait; wallet_empty is an operational alert for your team, not something a customer should see. The official SDKs, listed on the SDKs page, add typed responses and the same retry behaviour. For a longer walk through a typed wrapper see the guide on verifying PAN in Node.js and Python, and for the whole error catalogue see API errors and handling.
Errors, retries and idempotency
Every error body has one shape: { "error": { "code", "message", "requestId" } }. Branch on the HTTP status and code, never on message, and log requestId with every failure.
400Validation errorBAD_REQUESTpan must match the format ABCDE1234F
401Missing or invalid API keyUNAUTHORIZEDMissing or invalid API key.
402Insufficient wallet balancePAYMENT_REQUIREDInsufficient fulfilment wallet balance to cover this call.
403Valid key, missing required scopeFORBIDDENAPI key is valid but lacks the required scope for this endpoint.
429Rate limitedTOO_MANY_REQUESTSRate limit exceeded: 60 requests per 60 seconds for this endpoint.
502Upstream verification service unreachableINTERNAL_ERRORUnable to reach the order/customer service right now
Three groups cover everything. The deterministic group is 400, 401 and 403: a malformed PAN, a missing or wrong key, a key without the scope. Retrying changes nothing, so surface these to a developer. 402 means your wallet cannot cover the call; top up, then retry. The transient group is 429, 502 and its relatives; retry these with exponential backoff and jitter, capped at a few attempts.
The reason to send an Idempotency-Key is the timeout. Suppose your request leaves, the server completes the lookup, debits your wallet, and the response is lost on the way back. Without a key, your retry is a new call and you pay twice. With a key, the retry returns the stored response for the same key and body without running the lookup again or debiting a second time. Generate one key per logical verification, keep it across the retries of that verification, and use a fresh key for the next one. Two details to know: reusing a key with a different body (a different PAN, say) is rejected with a 422 IDEMPOTENCY_KEY_REUSED rather than silently answered, and a second request with the same key that arrives while the first is still running receives a 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After header saying the original is still in progress. Wait, then resend the identical request.
Billing, rate limits and what you can monitor
Billing follows the outcome. A call that completes with an answer is billed, and that includes valid: false, because the registry produced a determination. A call that fails (a 400, a 429, a 502) is not billed. In sandbox nothing is billed. Production calls are deducted from your prepaid wallet at the per-call rate, which on pay-as-you-go is ₹5 before GST and lower on the Growth and Scale plans; the pricing page has the current table. If the wallet cannot cover a call, the API refuses it with a 402 before the lookup runs, so you do not get an unbilled answer.
The practical consequence is that every avoidable call costs money. Validate the shape locally. De-duplicate within a batch. Do not re-verify a PAN you verified recently for the same purpose unless a rule or a risk trigger says you must.
Rate limits are per plan, not per endpoint. One bucket per environment and organisation, shared by all of your keys and routes, resets each minute. At the time of writing the allowance is 60 requests per minute on pay-as-you-go, 300 on Growth and 1,000 on Scale, and a sandbox key is capped at 10 a minute and 200 a day per organisation. An over-limit call returns a 429 with a message that names the limit. Because the window is a fixed minute, a burst straddling a boundary can briefly pass more than the nominal figure, so pace jobs below the limit instead of riding it. Adding keys does not add capacity, and rotating keys to get around the limit is prohibited by the acceptable use policy.
For monitoring, every call, successful or not, appears in your request logs in the dashboard and through the logs endpoint. How long they are kept depends on the plan (30, 90 or 365 days at the time of writing). Alert on the share of 402, 429 and 502 responses, not just on the count of failures, and chart valid: false as a proportion of all calls. A sudden jump in that proportion usually means a front-end regression in how the PAN is captured, not a wave of bad customers.
Sandbox and production: what is the same and what is not
Sandbox keys start with sk_test_ and production keys with sk_live_. The base URL and the request are identical; the key alone selects the environment.
Sandbox answers come from a deterministic stand-in, not from the registry. Two inputs are reserved: SNDBX0000A always returns a valid PAN with the status VALID and a synthetic registered name (TEST USER), and with a name in the request it reports a full-score match. SNDBX9999F always returns valid: false with the status INVALID. Any other well-formed PAN gets a stable but arbitrary answer: the same number always gets the same result, and roughly two in three come back valid. Every name in a sandbox reply is synthetic. Note that SNDBX0000A decodes to category B in the fourth position, so if your routing logic branches on holder category, the test PAN will look like a body of individuals; test your category branches with your own fixtures.
Sandbox is also deliberately small. It allows 10 requests a minute and 200 a day per organisation (the day resets at midnight IST), after which the API returns a 429, and it keeps call history for 30 days, so it is for proving an integration, not for load testing or for measuring name-match accuracy. The readiness runner in your dashboard runs scripted scenarios without using up those limits. Sandbox responses are built from a simpler fixture than production ones, so do not assert on optional fields beyond referenceId, valid and the ones in the table above.
The checklist for moving to production is short. Apply for production access from the dashboard; it is reviewed, and passing sandbox tests does not guarantee approval. Fund the wallet with margin and alert on low balance. Create a production key with only the scopes you need, restrict it by IP if your plan supports that, and keep it in a secrets manager. Check that every status in the error table has a user-facing message and an alert path. Then ship behind a flag, starting with staff PANs and a small slice of traffic. The longer treatment of keys and environments is in the guide on sandbox versus production API keys.
A worked example: onboarding a payout vendor
Take an invented marketplace, Kaveri Traders Marketplace, which pays vendors weekly and wants to avoid paying the wrong name. A vendor signs up as a sole proprietor and enters a PAN, the name "Suresh Menon" and a bank account.
Step one is local. The code trims and uppercases the PAN, matches the pattern, and decodes the fourth letter, which is P. The vendor chose "Individual or sole proprietor" on the form, so the category agrees. Step two is the paid lookup, with the name and a fresh idempotency key. The response is valid: true, status plain valid, verdict GOOD_PARTIAL_MATCH, score in the high eighties. The marketplace policy treats that as "confirm with the user": the vendor sees "We found this PAN registered to SURESH MENON. Is that your legal name?" and clicks yes; the click is recorded with a timestamp.
Step three moves to the next check. The registered name, not the typed one, goes to the bank account verification call, because the bank record should match the legal name. If the vendor also supplies a GSTIN, the first two characters give the state, characters three to twelve must equal the PAN, and the GSTIN API confirms the registration. The marketplace stores five things and nothing else: its own vendor id, referenceId, the masked PAN, the outcome with the status, and the id of the consent record. If the PAN had come back with an unusual status, the application would have gone to a reviewer with the full response attached, and the vendor would have seen a neutral message asking for another document.
Cost modelling for this flow is simple. A weekly onboarding run of N new vendors costs N times the per-call rate for PAN, plus the same multiple for each further API in the chain, plus 18% GST. De-duplication matters: if a vendor re-submits after fixing a typo, the first call was already billed, so fix obvious problems client-side before the first call. A vendor master of several thousand records re-verified once a year is a batch job that should run through a queue at a rate comfortably under your plan's per-minute limit.
Using PAN with the other verification APIs
PAN is usually the first link of a chain and rarely the whole chain. Which link comes next depends on the question you are asking.
| You need to know | Call next | Why |
|---|---|---|
| Which GST registrations belong to this PAN | PAN to GSTIN | Resolves the PAN to its GSTINs and their states |
| Whether a GSTIN the user typed is live | GSTIN | Registration status, legal and trade name |
| Whether the entity is a registered company | CIN | Company record and directors |
| Whether an MSME registration exists | PAN to Udyam, then Udyam | Finds the registration, then verifies it |
| Whether money will reach the right person | Bank account | Account existence and name at bank |
Order the calls by cost and certainty. Do the local checks first, then PAN, then only the dependent calls that the PAN result justifies. If the PAN fails, stop; every call after it would be built on sand. For an end-to-end design for lenders and fintechs, see the KYC use case, and for the broader PAN walkthrough the guide on PAN verification in India. If you drive the API from an AI assistant, the MCP server and the Build with AI page show how.
Edge cases and odd inputs
Real traffic contains inputs no test plan predicted. These are the ones worth handling on purpose.
- Lowercase, spaces and pasted junk. Normalise before validating; do not rely on the server to repair input.
- O versus 0, I versus 1. Offer a corrected suggestion when one substitution makes the pattern pass.
- Minors. A minor can hold a PAN, and it carries category
P. The name on the record is the minor's, not the guardian's. - Non-resident holders. A PAN does not imply Indian residence. Do not infer residency from it.
- Entities with a personal-looking name. A proprietorship has no PAN of its own; the proprietor's individual PAN is used. A firm or an LLP has an
F. Check the category against what the user declared before you assume anything. - A valid PAN with a status other than plain valid. Treat as review, not as a pass and not as an automatic rejection.
- Name on the record is in capitals and has fewer words than your input. Records often hold a short form; the name-match fields exist to absorb this.
- No name supplied. You get existence and status only; absence of a match verdict is not a failure.
- A second request for the same PAN a minute later. Cache a recent successful answer for your stated purpose, or use an idempotency key if it is a retry of the same action.
- Holder deceased or entity dissolved. The status will usually say so. Decide in advance what your product does.
Mistakes we see, and how to avoid them
The first mistake is treating HTTP 200 as approval. A 200 means the call completed. The verdict is in valid, the status and the name-match fields. The second is forwarding raw errors to end users; map 400 to "please check your PAN", map 429 and 502 to "we could not verify right now, please try again", and send 401, 402 and 403 to your own alerting. The third is comparing nameMatchScore as a string, or as a number in some places and a string in others; parse it once, at the boundary. The fourth is hard-coding the list of statuses; the list can change and an unknown value should mean review. The fifth is calling the API from a browser or mobile app, which exposes your key and bypasses your throttle. The sixth is logging full PANs in application logs or error trackers; log referenceId and requestId instead. The seventh is running tests with a production key, which debits the wallet and processes real personal data.
A subtler mistake is to collect the name after the PAN check, then run the lookup without it. You pay for a call that cannot produce name-match fields and then pay again when you add the name. Collect both first.
Consent, storage and logging in general terms
A PAN and the name attached to it are personal data about an identifiable person. The ease of the lookup is the reason to be strict about purpose. Show a notice before you collect the number that says what you will verify and why. Record who consented, when, and to which text, and keep that record next to the stored referenceId. Use the result only for the stated purpose. Do not run lookups on people who did not give you their PAN for that purpose, and do not use the API to build lists; the acceptable use policy prohibits enumeration of information you are not authorised to access.
Minimise what you keep. A compact audit row is enough: your customer id, referenceId, a masked PAN, valid, the status, the verdict and score, the version of your acceptance rule, a timestamp and the consent record id. Leave out the registered name and any father's name unless a documented requirement exists. Restrict who inside your company can see the fields that remain. India's Digital Personal Data Protection Act, 2023 sets rules on consent, purpose and erasure that are being brought into force in phases; this page is general information and not legal advice, so confirm the current position and your obligations with qualified counsel. The developer privacy policy and the data processing addendum describe how responsibilities are divided between you and StampMitra.
Sources and what to confirm
- StampMitra PAN verification reference, API docs: endpoint, scope, parameters, response and error examples, checked against the product data in 2026.
- StampMitra pricing and authentication pages: per-call rates, plan limits, key model and environments, read in 2026.
- StampMitra acceptable use policy: purpose limits and the ban on rate-limit evasion and enumeration, read in 2026.
- Income Tax Department of India guidance on the PAN structure and status codes: the category letters are widely published and stable, but confirm any rule you intend to code against the current official guidance, and treat the status code list as non-exhaustive.
- Digital Personal Data Protection Act, 2023, published by the Ministry of Electronics and Information Technology: confirm the current commencement position before relying on any summary, including this one.
Sandbox test values
Send one of these values as pan with a sandbox key (sk_test_...) to get that outcome. They are fake, valid in format, and never reach a real source or your wallet. Send with it: name: Rahul Kumar. Add the header X-Sandbox-Delay-Ms (up to 3000) to hold the reply and test your client timeout.
| Scenario | Input to send | What you get back |
|---|---|---|
| Valid PAN | SNDBX0001F | 200 |
| PAN not found / invalid number | SNDBX0002F | 200 |
| Name does not match | SNDBX0003F | 200 |
| Verification source times out | SNDBX0005F | 502INTERNAL_ERROR |
| Verification source unavailable | SNDBX0006F | 502INTERNAL_ERROR |
| Rate limited | SNDBX0007F | 429TOO_MANY_REQUESTS |
| Wallet balance too low | SNDBX0008F | 402PAYMENT_REQUIRED |
| Invalid format | SNDBX0000 | 400BAD_REQUEST |
Frequently asked questions
Does a PAN match prove that the person submitting it owns the PAN?
No. A match shows that the number and the name are consistent with the Income Tax Department record. Anyone who has seen a PAN card can type the same details, so pair the check with something that proves possession, such as a selfie match, a bank account in the same name or a signed document.
What does the fourth letter of a PAN mean, and does the API validate it?
The fourth letter is the holder category: P for an individual, C for a company, H for a Hindu Undivided Family, F for a firm or LLP, A for an association of persons, B for a body of individuals, T for a trust, L for a local authority, J for an artificial juridical person and G for government. The API only checks the overall pattern, so decode the letter yourself.
What is the difference between valid and the PAN status?
The valid flag says the registry found the number. The status says what state the record is in. A record can exist and still carry a status other than the plain valid one, for example after a deletion, a death or a merger, so branch on both and send unusual statuses to review.
How should I use nameMatchResult and nameMatchScore?
Use them as inputs to a policy you own. The verdict values seen are MATCH, GOOD_PARTIAL_MATCH, POOR_PARTIAL_MATCH and NO_MATCH, and the score runs from 0 to 100. StampMitra does not publish the comparison algorithm or a cut-off, so keep your thresholds in versioned configuration.
Am I charged when the PAN comes back as not valid?
Yes. A call that completes with an answer is billed, and valid false is an answer. Calls that fail with a 400, 429 or 502 are not billed, and sandbox calls are never billed. Validate the format locally before calling so you do not pay for typos.
What happens if my request times out after the server has already processed it?
Send an Idempotency-Key header and reuse the same key when you retry. The retry then returns the stored response without running a second lookup or a second debit. Reusing a key with a different body is rejected with a 422 IDEMPOTENCY_KEY_REUSED.
What are the rate limits for PAN verification?
The limit is per plan and shared by all your keys and routes in an environment, counted per minute. At the time of writing it is 60 requests per minute on pay-as-you-go, 300 on Growth and 1,000 on Scale, with 10 for a sandbox key, plus 200 requests a day per organisation. Check the pricing page for current figures.
Which PAN numbers can I use to test in the sandbox?
SNDBX0000A always returns a valid PAN with the status VALID and a synthetic name, and SNDBX9999F always returns not valid. Any other well-formed PAN gets a stable but arbitrary result, with about two in three coming back valid. All names in sandbox replies are synthetic.
Can I verify a PAN without sending a name?
Yes. Without a name you learn whether the record exists and what its status is, but you get no name-match verdict or score. If you do have a name, send it with the first call, because adding it later means paying for a second call.
Does the response include the holder's address, date of birth or phone number?
No. The documented response carries the registered name, the status, the match fields and the Aadhaar link flag, plus the reference id. Do not build features that depend on an address or a date of birth coming back from this endpoint.
Does StampMitra offer Aadhaar-based verification through this API?
No. The PAN response reports whether Aadhaar is linked to the PAN record, which is a flag on the PAN, but StampMitra does not offer Aadhaar-based verification. Ask your compliance owner what an unlinked PAN should mean for your product.
Can I cache a PAN verification result?
You can keep a recent result for the purpose you collected it for, which saves money on double submits and retries. Decide the retention window with your compliance owner, store the minimum fields and mask the PAN. Re-verify when a rule or a risk trigger requires fresh data.