# Voter ID API

> Verify a Voter ID in real time. Endpoint: `POST https://api-b2b.stampmitra.in/v1/verify/voter-id`.

Price: ₹5 per successful call, pay-as-you-go (lower on Growth and Scale). Sandbox keys are free. Prices exclude 18% GST.

- HTML docs: https://developer.stampmitra.in/docs/verification/voter-id
- Product page: https://developer.stampmitra.in/products/voter-id
- Pricing: https://developer.stampmitra.in/pricing
- Authentication: https://developer.stampmitra.in/docs/auth

## Verify Voter ID

`POST https://api-b2b.stampmitra.in/v1/verify/voter-id`

Required scope: `verification.voter.read`

Validates and verifies a Voter ID. Requires the `verification.voter.read` scope on the API key. Metered as `voter.verify` after a successful response - usage is only recorded (and the fulfilment wallet debited, for priced services) once verification completes successfully. The response below is the exact real shape returned by `/v1/verify/voter-id`, including its `referenceId` field.

### Parameters

- `Authorization` (header, required): Bearer <api-key> (e.g. sk_test_... in sandbox, sk_live_... in production). The x-api-key header is also accepted.
- `voterId` (string, required): EPIC / Voter ID number, format ABC1234567.
- `name` (string, optional): Name to match against records.

### Request example

```json
{
  "voterId": "UAI4574761",
  "name": "HARSHIT PRAJAPATI"
}
```

### Response example

```json
{
  "referenceId": "SMV-20260927-7H83M1",
  "verificationId": "VRF-4C8P2WJ6ZK9T",
  "valid": true,
  "status": "VALID",
  "epicNumber": "UAI4574761",
  "name": "HARSHIT PRAJAPATI",
  "nameInRegionalLang": "हर्षित",
  "age": "23",
  "relationType": "FTHR",
  "relationName": "RAJ PRAJAPATI",
  "relationNameInRegionalLang": "राज",
  "fatherName": "RAJ PRAJAPATI",
  "dob": "2000-12-07",
  "gender": "Male",
  "address": "GOVT JUNIOR COLLEGE SIRWAR",
  "photoUrl": "https://example.com/voter-photos/UAI4574761.jpeg",
  "splitAddress": {
    "district": [
      "INDORE"
    ],
    "state": [
      "Madhya Pradesh"
    ],
    "city": [
      "SANER"
    ],
    "pincode": "560034",
    "country": [
      "IN",
      "IND",
      "INDIA"
    ],
    "addressLine": "GOVT JUNIOR COLLEGE SIRWAR"
  },
  "state": "Madhya Pradesh",
  "assemblyConstituencyNumber": "211",
  "assemblyConstituency": "SANER",
  "parliamentaryConstituencyNumber": "25",
  "parliamentaryConstituency": "INDORE",
  "partNumber": "27",
  "partName": "SIRWAR",
  "serialNumber": "713",
  "pollingStation": "GOVT JUNIOR COLLEGE SIRWAR"
}
```

### Response fields

| Field | Type | Description |
| --- | --- | --- |
| `referenceId` | string | StampMitra's own transaction id for this call (SMV-YYYYMMDD-XXXXXXX). Always present, including on a negative result. |
| `verificationId` | string | StampMitra's own id for this verification (VRF- followed by 12 base32 characters). Generated for every call, unique to it. Always present. Quote it in support requests. |
| `valid` | boolean | Whether the voter ID is valid. Always present. |
| `status` | string | Outcome of the lookup: VALID or INVALID. |
| `epicNumber` | string | The voter ID (EPIC) number that was looked up. |
| `name` | string | The voter's registered name, when the voter ID is valid. |
| `nameInRegionalLang` | string | The voter's name in the regional language of the roll. |
| `age` | string | The voter's age in years, as a string, when available. |
| `relationType` | string | Type of the relation named on the roll (for example FTHR for father, HUSB for husband). |
| `relationName` | string | Name of the relative named on the roll. |
| `relationNameInRegionalLang` | string | The relative's name in the regional language of the roll. |
| `fatherName` | string | The voter's father's name, when the roll gives it. |
| `dob` | string | The voter's date of birth, ISO yyyy-mm-dd, when the roll has one. |
| `gender` | string | The voter's gender, when the voter ID is valid. |
| `address` | string | The registered address as one line, when the voter ID is valid. |
| `photoUrl` | string | A link to the voter photo, when the roll has one. A link only, never image data; it can expire, so fetch it promptly. |
| `splitAddress` | object | The registered address split into parts. |
| `splitAddress.district` | array | District(s). |
| `splitAddress.state` | array | State name(s), as a flat list. |
| `splitAddress.city` | array | City or town name(s). |
| `splitAddress.pincode` | string | PIN code. |
| `splitAddress.country` | array | Country, as the codes and name given by the registry. |
| `splitAddress.addressLine` | string | The address as one line. |
| `state` | string | The registered state, when the voter ID is valid. |
| `assemblyConstituencyNumber` | string | Assembly constituency number. |
| `assemblyConstituency` | string | Assembly constituency name. |
| `parliamentaryConstituencyNumber` | string | Parliamentary constituency number. |
| `parliamentaryConstituency` | string | Parliamentary constituency name. |
| `partNumber` | string | Part number of the electoral roll. |
| `partName` | string | Part name of the electoral roll. |
| `serialNumber` | string | Serial number of the voter within the part. |
| `pollingStation` | string | Name of the polling station. |

### Errors

- 401: Missing or invalid API key
- 403: Valid key, missing required scope
- 400: Validation error
- 402: Insufficient wallet balance
- 429: Rate limited
- 502: Upstream verification service unreachable

Notes: Input format is validated up front - a malformed pan/gstin/etc. fails fast with a 400 rather than being submitted for verification. referenceId (format SMV-YYYYMMDD-XXXXXXX) is StampMitra's own transaction id for this call and is always present, including on a negative (valid: false / found: false) result - both positive and negative determinations are completed, billable verifications. This is not an idempotency key. verificationId (format VRF-XXXXXXXXXXXX) is StampMitra's own id for this verification, generated for every call; quote it in support requests. Every field except referenceId, verificationId and valid is optional and is omitted when the electoral roll does not provide it. Dates are ISO yyyy-mm-dd strings and age is a string. photoUrl is a link only, never image data, and can expire. The voter's personal details are masked in your call records; the response itself carries them in full.

# Voter ID Verification API for India: EPIC Lookup, Name Match and Age Checks

> POST a voterId, with the name you expect, to /v1/verify/voter-id using a key with the verification.voter.read scope. The response carries the full voter record: valid, name, dob, gender, age, address, state, the relative, constituencies and polling station, a photo link, plus a referenceId and a verificationId. It proves the number exists in the record, not that the applicant is the cardholder, and there is no name-match score.

A voter ID verification API takes the number printed on an Elector's Photo Identity Card, known as the EPIC number, and returns what the electoral record holds for it: the name (also in the regional language of the roll), the relative named on it, date of birth, gender, age, address, constituencies, roll part and polling station. With StampMitra you send `POST /v1/verify/voter-id` with a `voterId` and, optionally, the `name` you expect, using a key that carries the `verification.voter.read` scope. The response comes back with a `valid` flag, a `status`, those record fields, and a `referenceId` and `verificationId` for your records.

This page is for the developer adding an ID-document step to onboarding and for the compliance or operations owner who has to decide what that step proves. It is deliberately practical about the awkward parts: an address that was correct at the last electoral roll revision, a date of birth you might use for an age gate, names that were transliterated from a regional language, and a card that tells you nothing about whether the person holding it is the person on it. If you only need the field list, the [Voter ID API reference](/docs/verification/voter-id) has it. Here you will find what to do with the fields.

Contract details here are drawn from StampMitra's Voter ID API reference; where that reference says nothing, the page says nothing too. It is general information, not legal advice.

## Key takeaways

- Endpoint: `POST https://api-b2b.stampmitra.in/v1/verify/voter-id`. Body: `voterId`, plus an optional `name`. Scope: `verification.voter.read`.
- The response guarantees `referenceId`, `verificationId` and `valid`. Everything else is optional and appears when the electoral roll provides it: `status`, `epicNumber`, `name`, `nameInRegionalLang`, `age`, the relative fields, `fatherName`, `dob`, `gender`, `address`, `splitAddress`, `photoUrl`, `state`, the constituency, part and polling station fields. The photo is only a link, and there is no name-match score, so you do the name comparison yourself.
- Price is the standard verification rate, ₹5 per completed call on pay-as-you-go, excluding GST. Sandbox is free and never debits the wallet.
- A valid result shows that the number exists in the record. It does not show that the applicant is the person on the card.
- Address and age come from the record as it stood at its last update. Use them to corroborate, not as the final word on where someone lives today.
- Date of birth, gender and address are personal data. Keep them out of logs and store only what the decision needs.
- Malformed input returns `400` and is not billed. A negative result is a completed, billed check.
- Voter ID works best as one document in a ladder with PAN, driving licence and bank account checks, ordered by cost and by what you need to prove.

## What an EPIC is and what the lookup returns

The Election Commission of India issues the Elector's Photo Identity Card to registered voters, and the number on it identifies the voter's entry in the electoral roll. Under the hood the lookup resolves that number to the roll entry. StampMitra's reference does not name the upstream source or describe update frequency, so treat the response as a snapshot of the entry at the moment of the call.

The sample response for a valid number:


Reading the fields in the order that matters for decisions:

`valid` is the headline. If it is false, there is nothing further to interpret: the number did not resolve to a record, and the right action is to ask the user to re-enter or to offer another document.

`name` is the elector's name as held in the record. This is the field you compare with your applicant's name. In the documented sample it is upper case.

`dob` is the date of birth as an ISO calendar date, and `age` is a string such as `"23"`. Treat `dob` as the primary value and compute age yourself at the time of your decision; the returned `age` is a convenience that reflects the moment the record was read.

`gender` is a word such as `Male` in the sample. Do not assume values beyond those you have seen.

`address` is the address as one free-text line, and `state` is the state of the electoral roll entry. If you intend to compare the address with a structured address from your form, use `splitAddress`, which gives the same address in parts: `district`, `state`, `city` and `country` are lists of strings, and `pincode` and `addressLine` are strings.

`nameInRegionalLang` is the name in the regional language of the roll, and `relationType`, `relationName` and `relationNameInRegionalLang` name the relative recorded against the voter (`FTHR` in the sample stands for father). `fatherName` repeats the father's name when the roll gives it. Keep the regional-language text as a string and do not try to transliterate it yourself for matching.

`assemblyConstituency`, `parliamentaryConstituency` (each with its number), `partNumber`, `partName`, `serialNumber` and `pollingStation` place the voter in the roll. They are useful for support and audit, and rarely needed for a yes or no decision.

`photoUrl` is a link to the photo held against the entry, when there is one. It is a link only, never image data, and it can expire, so fetch it promptly if you need it and do not store the link as a permanent reference.

`status` is `VALID` or `INVALID` and agrees with `valid`; branch on `valid`.

`referenceId` is StampMitra's transaction identifier in the format `SMV-YYYYMMDD-XXXXXXX`. It is present on every completed call, including a negative one, and it is not an idempotency key. `verificationId` (format `VRF-` plus 12 characters) is StampMitra's own id for this verification, generated for every call; quote it in support requests.

### What the record cannot tell you

A voter ID check is a record lookup. Be explicit about its limits in your policy and your product copy.

**It does not prove who is presenting the card.** The response can carry a link to the roll photo, but that does not tie the number to the person in front of you: someone can type a real EPIC number that belongs to another person. If your risk model needs to tie the document to the applicant, pair it with a selfie and liveness step or another check that carries a biometric, which this endpoint does not provide.

**It does not prove current residence.** An address is whatever the electoral roll holds. People move, and updates to the roll lag behind.

**It is not a citizenship determination.** An EPIC establishes enrolment as an elector. How your regulator treats it as an identity or address document depends on your sector, so check the current rules that apply to you rather than assuming.

**It carries no name-match score.** The `name` field you may send is documented as the name to match against records, but the documented response shows no match result. Do not build logic that looks for a field that is not in the contract. Compare the returned `name` with your applicant's name yourself.

## Handling the date of birth

Age gates are a common reason to verify an ID. The temptation is to read the returned `age` and compare. A more reliable pattern is to derive age from `dob` at the moment you need it, in Indian Standard Time.

```js
export function ageOn(dobIso, today = new Date()) {
  const [y, m, d] = dobIso.split("-").map(Number);
  // Compare calendar dates, not timestamps, so the birthday itself counts.
  const t = new Date(today.getTime() + 5.5 * 3600_000); // shift to IST
  let age = t.getUTCFullYear() - y;
  const before = t.getUTCMonth() + 1 < m || (t.getUTCMonth() + 1 === m && t.getUTCDate() < d);
  if (before) age -= 1;
  return age;
}

export function meetsMinimumAge(voter, minimum = 18) {
  return ageOn(voter.dob) >= minimum;
}
```

Two cautions. First, a returned `dob` may be a placeholder or approximate in an older record, for example a date of 1 January of the birth year. If your decision hangs on a narrow margin, such as someone turning eighteen this month, send the case to review and ask for a second document. Second, if the applicant typed a date of birth into your form, compare it with the record's `dob` and treat a mismatch as a reason to look, not an automatic rejection, because transposed digits happen.

## Matching the name

Names in the electoral record can differ from names on other documents for ordinary reasons: the roll was prepared in a regional language and transliterated, a surname comes first, a middle name is missing, honorifics were dropped. Plan for a gray zone.

A workable approach is to normalise both strings to upper case, remove punctuation and honorifics, split into tokens and compare token sets, allowing initials to match full names.

```js
const STOP = new Set(["SHRI", "SMT", "MR", "MRS", "MS", "DR", "KUMARI"]);

export function nameTokens(raw) {
  return String(raw)
    .toUpperCase()
    .replace(/[^A-Z\s]/g, " ")
    .split(/\s+/)
    .filter((t) => t && !STOP.has(t));
}

export function nameOverlap(a, b) {
  const A = nameTokens(a), B = nameTokens(b);
  if (A.length === 0 || B.length === 0) return 0;
  const hit = (x, y) => x === y || (x.length === 1 && y.startsWith(x)) || (y.length === 1 && x.startsWith(y));
  const matched = A.filter((x) => B.some((y) => hit(x, y))).length;
  return matched / Math.max(A.length, B.length);
}
```

Map the overlap into three bands: a high overlap passes, a middle band goes to a person, a low overlap fails. Choose the cut-offs from a sample of your own real applicants, not from sandbox, whose names are synthetic. Write the thresholds down with a date.

## Using the address sensibly

The address arrives as one free-text string, with `splitAddress` giving the same address in parts. People sometimes expect to use it as proof of current address, which it is not. Use it for three modest things instead.

**Corroboration.** Compare the state, and where present the pincode, with what the applicant declared. A different state is worth a question, not a rejection.

**Pre-fill with confirmation.** Offering the address back to the user to confirm or correct saves typing, provided you show it and let them edit it. Do not silently store it as their current address.

**Fraud signals.** The same address string appearing across many unrelated applicants in a short window is a pattern to look at, though you must store the address to see it, so weigh that against the minimisation advice below.

```js
export function extractPincode(address) {
  const m = String(address).match(/\b[1-9]\d{5}\b/);
  return m ? m[0] : null;
}
```

A pincode is six digits and does not begin with zero, which is enough for the pattern above. The record's address may not contain one, so the function returns `null` rather than guessing.

## Input handling and the EPIC format

The documented sample is `ABC1234567`: three letters followed by seven digits, ten characters in all, and the validation message reads "voterId must match the format ABC1234567". Users type these from a card photo, so expect lower case, spaces and the confusion between the letter `O` and zero.

```js
export function normaliseVoterId(raw) {
  return String(raw).toUpperCase().replace(/[\s\-.]/g, "");
}
```

Do not write a stricter pattern of your own. Older cards and some state series do not follow the three-letter, seven-digit shape, and an over-strict client rule will reject real voters. Normalise lightly and let the API validate. A malformed value returns `400 BAD_REQUEST` before verification and is not billed; the message names the field so you can show it to the user.

## Billing and failure behaviour

- Metered as `voter.verify`, recorded after a successful response. In production the wallet is debited when the verification completes.
- The price is the standard verification rate, ₹5 per completed call on pay-as-you-go and lower on higher plans. See the [pricing page](/pricing). Rates exclude 18% GST.
- A negative result, for example a number that does not resolve, is a completed verification. It is recorded, billed and returns a `referenceId`.
- `400`, `401` and `403` do not complete a verification and are not billed.
- `402 PAYMENT_REQUIRED` means insufficient wallet balance; top up rather than retry.
- `429 TOO_MANY_REQUESTS` is the rate limit. The documented example reads "Rate limit exceeded: 60 requests per 60 seconds for this endpoint." In sandbox it can also be a sandbox limit (10 a minute or 200 a day per organisation; code `SANDBOX_RATE_LIMIT`, `SANDBOX_DAILY_LIMIT` or `SANDBOX_IP_LIMIT`).
- `502 INTERNAL_ERROR` means the upstream service could not be reached. No completed check, no completed-call charge. Retry with backoff.
- `referenceId` is not an idempotency key and the route documents no idempotency header, so a timed-out call may already have been billed.

| Status | Code | Meaning | Your action |
|---|---|---|---|
| 400 | `BAD_REQUEST` | `voterId` does not match the format | Show the message, ask for correction |
| 401 | `UNAUTHORIZED` | Missing or invalid key | Fix deployment |
| 402 | `PAYMENT_REQUIRED` | Wallet balance insufficient | Top up, alert operations |
| 403 | `FORBIDDEN` | Key lacks `verification.voter.read` | Issue a key with the scope |
| 429 | `TOO_MANY_REQUESTS` | Rate limit or sandbox limit (`SANDBOX_RATE_LIMIT`, `SANDBOX_DAILY_LIMIT` or `SANDBOX_IP_LIMIT`) | Back off with jitter |
| 502 | `INTERNAL_ERROR` | Upstream unreachable | Retry with backoff |

Every error uses one envelope, `{ "error": { "code", "message", "requestId" } }`, so one parser handles them all and the `requestId` is what support asks for.



## Why a check fails, and what to say to the user

Failure messages to end users should be specific without being accusatory.

- **The number does not resolve.** Most often a typo, a card photo misread, or a number from a different series. Ask the user to re-check the card and offer another document if they cannot.
- **The number resolves but the name differs.** Often transliteration. Show the user the name you hold and let them confirm which is theirs rather than telling them the check failed.
- **The date of birth differs.** Ask whether they entered it correctly. If the record's date is a placeholder, a second document settles it.
- **The service is unavailable.** A `502` is not the user's problem. Tell them it is temporarily unavailable and let them continue or resume later.

Keep the technical code for your logs and the plain reason for the screen.

## Where voter ID verification fits in a workflow

**Field-force and agent onboarding.** A company recruiting agents across towns often finds that people have a voter ID but may not have every other document. The flow collects the EPIC number, verifies it, compares the name, shows the address for confirmation, and moves on to a bank account check for payouts. The voter ID is the identity anchor.

**Microfinance and group lending.** Applicants frequently carry a voter ID as their primary document. A lender verifies it, computes age from `dob` against its eligibility range, and records the `referenceId` on the file. The address is used to corroborate the branch catchment, not as legal proof of residence.

**Age-restricted services.** Where a service must confirm an adult user, the date of birth from a verified document is a stronger input than a self-declared one. The check does not tell you the person on the other end is the document holder, so combine it with other controls where the stakes justify it.

**Customer data refresh.** A business updating stale customer records can verify a number the customer supplies and offer the returned address for confirmation. Never overwrite the customer's own address without their confirmation.

## The document ladder: voter ID with PAN, driving licence and bank checks

No single document answers every question. Think of a ladder, and stop climbing when you have what the decision needs.

| You need to establish | Reach for | Why |
|---|---|---|
| A person exists and has a government-issued identity | [Voter ID](/products/voter-id), [Driving Licence](/products/driving-license) or [Passport](/products/passport) | Different people hold different documents |
| A tax identity and registered name | [PAN verification](/products/pan) | Names and the PAN status that finance teams rely on |
| A real account to pay | [Bank account verification](/products/bank-account) | Confirms the account and the holder name |
| A business entity | [GSTIN verification](/products/gstin) | Legal and trade names, status |

Run the document the applicant volunteers first, then the one your finance or regulatory rules require. If the voter ID name and the PAN name agree, and the bank account name agrees with both, you have three independent records that are mutually consistent, which is considerably stronger than any one of them. Stop at the first hard failure. Because the checks have different rates, running the cheapest decisive one first saves money without losing signal.

## Integration walkthrough

### cURL

```bash
curl -X POST "https://api-b2b.stampmitra.in/v1/verify/voter-id" \
  -H "Authorization: Bearer $STAMPMITRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"voterId":"ABC1234567","name":"Rahul Kumar"}'
```

### Node.js

The [Node.js SDK](/sdks/node) and [Python SDK](/sdks/python) wrap this endpoint if you prefer a client library. The raw calls show exactly what they do.

```js
// Node 18+ (built-in fetch)
const BASE = "https://api-b2b.stampmitra.in";

export async function verifyVoterId({ voterId, name }, { timeoutMs = 20000 } = {}) {
  const res = await fetch(`${BASE}/v1/verify/voter-id`, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.STAMPMITRA_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ voterId: normaliseVoterId(voterId), ...(name ? { name } : {}) }),
    signal: AbortSignal.timeout(timeoutMs),
  });
  const body = await res.json().catch(() => ({}));
  if (res.ok) return { kind: "completed", result: body };
  const { code, message, requestId } = body.error ?? {};
  const retryable = res.status === 429 || res.status === 502;
  return { kind: retryable ? "retry" : "failed", status: res.status, code, message, requestId };
}
```

### Python

```python
import os, re, requests

BASE = "https://api-b2b.stampmitra.in"

def verify_voter_id(voter_id: str, name: str | None = None, timeout: int = 20) -> dict:
    payload = {"voterId": re.sub(r"[\s\-.]", "", voter_id.upper())}
    if name:
        payload["name"] = name
    resp = requests.post(
        f"{BASE}/v1/verify/voter-id",
        headers={"Authorization": f"Bearer {os.environ['STAMPMITRA_API_KEY']}"},
        json=payload,
        timeout=timeout,
    )
    body = resp.json() if resp.content else {}
    if resp.ok:
        return {"kind": "completed", "result": body}
    err = body.get("error", {})
    return {
        "kind": "retry" if resp.status_code in (429, 502) else "failed",
        "status": resp.status_code,
        "code": err.get("code"),
        "message": err.get("message"),
        "requestId": err.get("requestId"),
    }
```

### Turning the result into an outcome

```js
export function assessVoter(result, applicant, { minOverlap = 0.85, minAge = 18 } = {}) {
  if (result.valid !== true) return { outcome: "reject", reason: "not_found", referenceId: result.referenceId };
  const overlap = nameOverlap(applicant.name, result.name);
  const reasons = [];
  if (overlap < minOverlap) reasons.push("name_unclear");
  if (applicant.dob && applicant.dob !== result.dob) reasons.push("dob_differs");
  if (!meetsMinimumAge(result, minAge)) reasons.push("under_minimum_age");
  return {
    outcome: reasons.length === 0 ? "approve" : "review",
    reasons,
    referenceId: result.referenceId,
  };
}
```

The function rejects only on a record that does not resolve. Everything else that is not a clean match goes to a reviewer, because the cost of a wrongly rejected genuine applicant is usually higher than the cost of a short manual look.

## Edge cases and odd inputs

- **Placeholder dates of birth.** Some records hold a date such as 1 January of the birth year. Send narrow-margin age decisions to review.
- **Regional-language names.** The same person may be written differently across documents. Allow transliteration variance and keep a reviewer in the loop.
- **Card photos misread.** `0` versus `O`, `1` versus `I`, `5` versus `S`. Show the number back to the user in a clear typeface and let them confirm before the call.
- **Duplicate cards.** A person can hold a replacement card with a different number after a transfer or correction. A negative on an old number does not mean the person is not enrolled; ask for the current card.
- **Newly enrolled voters.** A number issued recently may not appear yet. Retry later and offer an alternative document meanwhile.
- **Empty or short addresses.** Treat the address as optional and tolerate an empty string.
- **E-EPIC downloads.** A digital copy of the card carries the same number. Normalise it like any other.
- **Case and spacing in `name`.** Normalise before comparing.
- **Applicants under eighteen.** An EPIC exists only for enrolled electors, so a younger applicant is a signal to look more closely at the document and the age.

## Audit logging and monitoring

What should a record of a voter ID check contain? Enough to reconstruct the decision, and no more. Your applicant ID, the `referenceId`, the outcome with reason codes, the name-overlap score and the thresholds that applied, the HTTP status, the `requestId` for errors and a timestamp. Not the EPIC number, the name, the date of birth, the gender, the address, or the raw response. When debugging needs a link between a log line and an EPIC, store a keyed hash.

StampMitra's own request logs are available at `GET /v1/logs` and in the dashboard, kept for as long as your plan allows, up to 365 days on Scale. Your decision records are yours to retain according to what your audits require.

Three trends deserve attention. A climbing review rate often follows a form or OCR change. A climbing rate of `400` responses points at the client, usually normalisation. And a cluster of `502` calls is a cue to degrade gracefully, for instance by letting the applicant continue with a different document while the service recovers. Keep `429` and `402` counts on the same board.

## Modelling the cost

A voter ID check is a standard-rate call. The costs that matter are retries and fallbacks.

```js
export function monthlyVoterCost({ applicants, voterShare = 0.4, retryShare = 0.2, pricePerCall }) {
  const voterApplicants = applicants * voterShare;
  const calls = voterApplicants * (1 + retryShare);
  return { calls: Math.ceil(calls), cost: Math.ceil(calls) * pricePerCall };
}
```

Suppose a lender onboards 5,000 applicants a month, 40 percent choose voter ID as their document, and 20 percent of those need a second attempt because of a misread number. That is 2,000 first attempts and 400 retries, 2,400 calls. Multiply by your plan's standard rate and add 18% GST on the top-up. A UI that shows the typed number back to the user for confirmation before submitting cuts the retry share. Dropping it from 20 percent to 5 percent saves 300 calls a month, which pays for the extra screen very quickly.

If you offer applicants a choice among documents, remember that a fallback is a second call at its own rate. Model the expected number of calls per applicant, not per document.

## Sandbox and production

The sandbox key, `sk_test_`, arrives with sign-up and never touches your wallet. It serves sample data: Voter ID has no published magic inputs, so a given EPIC always gets the same reply, roughly two in three of them valid, with made-up names throughout. That is plenty for authentication, scope handling, normalisation, error paths and the approve, review and reject screens, and a few saved responses keep unit tests off the network. It will not help you choose name thresholds or estimate genuine failure rates, and sandbox limits are not production limits.

For production you need an `sk_live_` key, created after your organisation's KYC and a Voter ID production application are approved. The server picks the environment from the key. Apply from the dashboard with a specific description of your use, fund the wallet, swap the secret, and watch the first live traffic closely.

### Restrict the key

Because the response includes date of birth and address, grant the key only `verification.voter.read` (see the [authentication docs](/docs/auth)), give each service its own, hold it in a secrets manager, bind it to your servers' addresses wherever your plan includes an IP allowlist, and call only from the backend. A `403` on a valid key means the scope is missing.

## Privacy and consent, in general terms

Dates of birth, gender and addresses are personal data, and an identity number attached to them raises the stakes. India's Digital Personal Data Protection Act, 2023 and its rules govern how such data is processed; your counsel should tell you what applies. What follows is customary practice and not legal advice.

- Explain, in plain words and before the user types the number, why you verify the ID.
- Ask only for what the decision needs. An age check does not need an address.
- Keep the outcome, reason codes, `referenceId` and timestamp. Keep `dob`, `gender` or `address` only when a rule or a real need demands it, and say so in your notice.
- Do not let identity data gathered for onboarding drift into marketing.
- Limit reviewer access to the people who need it.
- Set a retention period and enforce it.
- Give people a way to ask what you hold and to correct it.
- Agree processor terms with StampMitra as your counsel advises.

## A worked scenario: onboarding collection agents in small towns

Consider a fictional lender, Paramount Microcredit, that hires collection agents in towns where many candidates hold a voter ID but not necessarily a passport or a driving licence. The agent signs up in a mobile app. Here is what the backend does, and why each step is there.

1. **The app asks for the EPIC number and shows it back.** After the agent types it, the screen repeats the number in large type and asks "Is this exactly what is printed on your card?". The confirmation step exists because a misread character costs a billed call and an annoyed candidate.
2. **The backend normalises and calls once.** It uppercases, strips spaces and posts to `/v1/verify/voter-id` with the typed name. If the call returns `429`, the app tells the agent to wait a few seconds; if `502`, it saves the draft and offers to resume.
3. **The record resolves.** The backend compares the returned `name` with the name from the application using token overlap, and compares the returned `dob` with the typed date of birth.
4. **A clean match moves on.** If the overlap is high and the date of birth agrees, the agent proceeds to the bank account step with the verified name as the expected account holder name.
5. **A middle result opens a task.** If the overlap falls in the gray zone, a reviewer sees both names and the date of birth, with the address text hidden unless the reviewer opens it. Most of these turn out to be initials or a transliteration difference, and the reviewer approves with a reason code.
6. **A dob difference gets a second document.** If the record's date of birth differs and the record's date is a first of January, the app asks for a second document rather than rejecting.
7. **The agent confirms the address.** The app shows the address from the record and asks the agent to confirm it or type their current one. Only the confirmed value is stored as the agent's address.
8. **Records kept.** Paramount stores the `referenceId`, the outcome, the reason codes, the reviewer ID and timestamps. It does not store the `voterId`, the record's address or the date of birth from the response, because the loan product does not need them after onboarding.

What makes this workable is that no step relies on something the endpoint does not provide: the photo comes only as a link, so the lender relies on its own selfie step for liveness, and there is no match score, so the lender computes overlap itself. The check supplies a reliable record; the lender's process supplies the judgement.

## Production checklist

1. The key has only `verification.voter.read`, sits in a secrets manager and is IP-restricted where possible.
2. The `voterId` is normalised, not strictly validated, on your side.
3. Age is computed from `dob` in IST at decision time.
4. Names are compared with token matching and thresholds taken from real data.
5. The address is shown for confirmation, never silently stored as current.
6. Retries happen only on `429` and `502`, with backoff.
7. Logs hold reference IDs and outcomes, not personal fields.
8. Wallet balance and `402` alerts exist.
9. A review queue exists with a written policy.
10. The notice states why the ID is verified and what is kept.
11. You have tested a misread number, a transliterated name, a placeholder date of birth, a `429` and a `502`.

## Common mistakes

- **Assuming the response contains a name-match score.** It does not. Compare names yourself.
- **Treating a valid number as proof of the person.** There is no photo in the response.
- **Using `age` from the response as a stored fact.** Derive it from `dob` when you need it.
- **Storing the address as the customer's current address.** Confirm it with them.
- **Writing a strict EPIC regex.** Older series differ, and genuine voters get rejected.
- **Logging the response.** It puts dates of birth and addresses in log storage.
- **Rejecting on a name difference.** Transliteration is the usual cause.
- **Calling from the client.** It exposes the key and sidesteps your allowlist.

## What to read next

Voter ID sits alongside [PAN verification](/products/pan), [Driving Licence verification](/products/driving-license), [Passport verification](/products/passport) and [bank account verification](/products/bank-account). [Sandbox vs production API keys](/guides/sandbox-vs-production-api-keys) covers key handling and [API errors and handling](/guides/api-errors-and-handling) covers retries. For a full onboarding flow, see the [KYC API for fintech and NBFC use case](/use-cases/kyc-api-for-fintech-nbfc), and for the complete field reference, the [Voter ID API docs](/docs/verification/voter-id).

## Sources

- [Voter ID API reference](/docs/verification/voter-id), StampMitra product data: request fields, response example, scope and validation message, checked October 2026.
- [Pricing](/pricing), StampMitra: per-call rates, plan limits and log retention, checked October 2026. Rates exclude 18% GST.
- Election Commission of India, for how the Elector's Photo Identity Card and the electoral roll work. Check the current guidance on the official site.
- Digital Personal Data Protection Act, 2023, Government of India. Read the current Act and the rules made under it on the official government sites.

## Frequently asked questions

### What does the voter ID verification API return?

It returns the full voter record: valid and status, the EPIC number, name (also in the regional language), the relative named on the roll, dob, gender, age, address and splitAddress, a photoUrl link, state, constituencies, roll part, serial number and polling station, plus a referenceId and a verificationId. Only referenceId, verificationId and valid are always present. There is no name-match score, so you compare the returned name with your applicant's name yourself.

### What is an EPIC number and what format does the API expect?

EPIC is the number on the Elector's Photo Identity Card. The documented sample is ABC1234567, three letters and seven digits. Normalise to upper case without spaces and let the API validate, because older series differ and a strict client pattern would reject genuine voters.

### Does a valid result prove the applicant is the person on the card?

No. The record lookup shows that the number exists and what the roll holds for it. Someone can type another person's real number. If you need to tie the document to the applicant, add a selfie and liveness step or another check that carries a biometric.

### Can I use the returned address as proof of current residence?

Treat it as corroboration only. The address is whatever the electoral roll held at its last update, and people move. Show it to the user to confirm or correct, and store only the value they confirm as their current address.

### How should I use the date of birth for an age check?

Compute age from dob in Indian Standard Time at decision time rather than trusting the returned age as a stored fact. Some older records hold placeholder dates such as a first of January, so send narrow-margin cases to review and ask for a second document.

### Is there a name match score in the response?

No. You may send a name, documented as the name to match against records, but the documented response shows no match result. Compare names yourself using token matching that tolerates initials and transliteration, and set thresholds from real applicant data.

### When am I billed for a voter ID check?

Usage is recorded and the production wallet debited only after the verification completes. A negative result is still a completed, billed check. A malformed voterId, bad key or missing scope returns 400, 401 or 403 and is not billed, and sandbox calls never debit your wallet.

### Which errors should my integration handle?

Handle 400 for a malformed voterId, 401, 402 for low wallet balance, 403 for a missing scope, 429 for the rate limit and 502 when the upstream service is unreachable. Retry only 429 and 502 with backoff, and log the requestId from the shared error envelope.

### Can I test voter ID verification for free?

Yes. A sandbox key starting with sk_test_ never debits your wallet and returns sample data with synthetic names, so the same input always gives the same answer. It proves plumbing and error handling, not your name-matching thresholds or real failure rates.

### What personal data should I store after the check?

Store the outcome, reason codes, referenceId and timestamp. Avoid storing dob, gender, address or the voterId unless a rule or genuine need requires it, keep them out of logs, set a retention period and explain in your notice what you keep and why.

### How does voter ID fit with PAN, driving licence and bank checks?

Think of a ladder. Verify the document the applicant volunteers, then the PAN for tax identity, then a bank account for payouts. If the voter ID, PAN and bank account names agree you have three consistent records. Stop at the first hard failure and run cheaper decisive checks first.

### Why does my valid key return 403 on this endpoint?

The key is valid but lacks the verification.voter.read scope. Issue a key with that scope, keep it narrow and call from your backend only. Where your plan includes an IP allowlist, restrict the key to your servers, because this endpoint returns date of birth and address.
