StampMitraDevelopers
LiveVerification API

Driving Licence Verification API for India: DL Number, Date of Birth and Validity

Verify a Driving Licence in real time.

POST/v1/verify/driving-licenseScope verification.dl.read₹5 per call
curl -X POST "https://api-b2b.stampmitra.in/v1/verify/driving-license" \
  -H "Authorization: Bearer $STAMPMITRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "dlNumber": "MH1420110012345",
    "dob": "1990-01-01"
  }'
Example responseJSON
{
  "referenceId": "SMV-20260927-2Q56T8",
  "verificationId": "VRF-4H8Z2M6TQ9KW",
  "valid": true,
  "dlNumber": "KA51201900089895",
  "dob": "1994-08-05",
  "status": "VALID",
  "dlStatus": "VALID",
  "name": "JOHN DOE",
  "fatherOrHusbandName": "JOHN DOE",
  "address": "FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103",
  "validUpto": "09/05/2039",
  "badgeDetails": [
    {
      "badgeIssueDate": null,
      "badgeNo": null,
      "classOfVehicle": [
        "LMV"
      ]
    }
  ],
  "dlValidity": {
    "nonTransport": {
      "to": "09/05/2039",
      "from": "10/05/2019"
    },
    "hazardousValidTill": null,
    "transport": {
      "to": null,
      "from": null
    },
    "hillValidTill": null
  },
  "detailsOfDrivingLicence": {
    "dateOfIssue": "10/05/2019",
    "dateOfLastTransaction": null,
    "status": null,
    "lastTransactedAt": null,
    "name": "JOHN DOE",
    "fatherOrHusbandName": "JOHN DOE",
    "addressList": [
      {
        "completeAddress": "FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103",
        "type": "permanent",
        "splitAddress": {
          "district": [
            "BANGALORE"
          ],
          "state": [
            "KARNATAKA",
            "KA"
          ],
          "city": [
            "BELLANDUR"
          ],
          "pincode": "560103",
          "country": [
            "IN",
            "IND",
            "INDIA"
          ],
          "addressLine": "FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103"
        }
      },
      {
        "completeAddress": "FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103",
        "type": "temporary",
        "splitAddress": {
          "district": [
            "BANGALORE"
          ],
          "state": [
            "KARNATAKA",
            "KA"
          ],
          "city": [
            "BELLANDUR"
          ],
          "pincode": "560103",
          "country": [
            "IN",
            "IND",
            "INDIA"
          ],
          "addressLine": "FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103"
        }
      }
    ],
    "address": "FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103",
    "photoUrl": "https://example.com/dl-photos/KA51201900089895.jpeg",
    "splitAddress": {
      "district": [
        "BANGALORE"
      ],
      "state": [
        ""
      ],
      "city": [
        "BELLANDUR"
      ],
      "pincode": "560103",
      "country": [
        "IN",
        "IND",
        "INDIA"
      ],
      "addressLine": "FLAT NO D-901 SUNCITY,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103"
    },
    "covDetails": []
  }
}

A driving licence verification API checks a licence number and a date of birth against the licensing record and returns the licence record: the holder's name, the father's or husband's name, addresses, the validity by class, the transport badge details with the classes of vehicle covered, the issue date and a link to the holder's photograph. With StampMitra the call is POST /v1/verify/driving-license with dlNumber and dob, both required, from a key that carries the verification.dl.read scope. The response includes a valid flag, the profile fields, dlValidity with the dates by class, badgeDetails, detailsOfDrivingLicence, validUpto, dlStatus and the two identifiers referenceId and verificationId.

Teams usually reach for this when they put people behind a wheel: ride-hailing and delivery fleets, self-drive rental companies, logistics operators, corporate vehicle programmes and insurers pricing driver risk. This page is written for those teams. It explains what the check can and cannot establish, why the date of birth is part of the request, how to read the validity dates and status without inventing rules, how far to trust the classes of vehicle the response lists, how often to re-check a driver, and how to run the call safely given that this endpoint is one of the most tightly controlled in the verification family.

The facts about the call are taken from StampMitra's Driving Licence API reference, and where that reference is silent the page says as much. This is general information, not legal advice.

Key takeaways

  • Endpoint: POST https://api-b2b.stampmitra.in/v1/verify/driving-license. Body: dlNumber and dob (both required, date as YYYY-MM-DD). Scope: verification.dl.read.
  • The response has valid, status, dlNumber, dob, badgeDetails, dlValidity, detailsOfDrivingLicence and the two ids referenceId and verificationId. For existing integrations it still has name, fatherOrHusbandName, address, validUpto and dlStatus at the top level, with the same values as before.
  • Every field except referenceId, verificationId and valid is optional. A value the licence record holds as null (no badge, no transport class, no last transaction) comes back as null; a field the record does not carry is left out.
  • Validity and issue dates are strings exactly as supplied, dd/mm/yyyy in the documented example, so parse them defensively. dob is ISO yyyy-mm-dd.
  • The response lists the classes of vehicle in badgeDetails[].classOfVehicle but not endorsements or offences, and a class on the record is not proof that the driver may drive the particular vehicle you are handing over.
  • Driving Licence calls need an IP-allowlisted key. The server's message is passed through to the caller when a key does not qualify. Check that your plan includes an IP allowlist before you plan a launch date.
  • The 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.
  • Because dob is a required input, a wrong date of birth can look exactly like a wrong licence number. Design the form and the error messages for that.
  • Name, address and date of birth are personal data. Store the decision and the referenceId, not the profile.
  • A malformed number returns 400 and is not billed. A negative result is a completed, billed check.

What the check returns

A driving licence is a card issued by a state transport authority that says a person may drive particular classes of vehicle. The verification lookup resolves the number, uses the date of birth as a second key, and returns what the record holds. The StampMitra reference does not name the upstream source or how often it refreshes, so read the response as a snapshot at the moment of the call. Each call also returns verificationId, StampMitra's own id for that one verification (VRF- followed by twelve characters), which is new for every call; quote it, with the referenceId, in a support request.

The documented request and response:

Request parameters

Request parameters
FieldTypeDescription
AuthorizationrequiredheaderBearer <api-key> (e.g. sk_test_... in sandbox, sk_live_... in production). The x-api-key header is also accepted.
dlNumberrequiredstringDriving licence number.
dobrequiredstringDate of birth (YYYY-MM-DD).

Response fields

Response fields
FieldTypeDescription
referenceIdstringStampMitra's own transaction id for this call (SMV-YYYYMMDD-XXXXXXX). Always present, including on a negative result.
verificationIdstringStampMitra'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.
validbooleanWhether the driving licence is valid. Always present.
dlNumberstringThe driving licence number that was looked up.
dobstringThe licence holder's date of birth, ISO yyyy-mm-dd.
statusstringOutcome of the lookup: VALID or INVALID.
dlStatusstringSame value as status. Kept so existing integrations keep working.
namestringThe licence holder's registered name. Same as detailsOfDrivingLicence.name. Kept for existing integrations.
fatherOrHusbandNamestringName of the holder's father or husband. Same as detailsOfDrivingLicence.fatherOrHusbandName. Kept for existing integrations.
addressstringThe registered address as one string. Same as detailsOfDrivingLicence.address. Kept for existing integrations.
validUptostringEnd of validity of the non-transport classes, a date string exactly as supplied (dd/mm/yyyy in the example). Same as dlValidity.nonTransport.to. Kept for existing integrations.
badgeDetailsarray or nullTransport badge details and the classes of vehicle covered. null when the record carries no badge block.
badgeDetails[].badgeIssueDatestring or nullDate the transport badge was issued, as supplied. null when the licence has no badge.
badgeDetails[].badgeNostring or nullTransport badge number. null when the licence has no badge.
badgeDetails[].classOfVehiclearray of string or nullClasses of vehicle the licence covers, for example LMV.
dlValidityobject or nullValidity periods of the licence by class: non-transport, transport, hazardous goods and hill area.
dlValidity.nonTransportobject or nullValidity of the non-transport (private vehicle) classes.
dlValidity.nonTransport.tostring or nullEnd of the validity period, a date string exactly as supplied (dd/mm/yyyy in the example). null when the class does not apply.
dlValidity.nonTransport.fromstring or nullStart of the validity period, a date string exactly as supplied (dd/mm/yyyy in the example). null when the class does not apply.
dlValidity.hazardousValidTillstring or nullValidity end for hazardous-goods vehicles, as supplied. null when not applicable.
dlValidity.transportobject or nullValidity of the transport (commercial vehicle) classes. Both dates are null when the licence has no transport class.
dlValidity.transport.tostring or nullEnd of the validity period, as supplied. null when the licence has no transport class.
dlValidity.transport.fromstring or nullStart of the validity period, as supplied. null when the licence has no transport class.
dlValidity.hillValidTillstring or nullValidity end for hill-area driving, as supplied. null when not applicable.
detailsOfDrivingLicenceobject or nullDetails held on the licence record: issue date, holder names, addresses, photograph link and class-of-vehicle details.
detailsOfDrivingLicence.dateOfIssuestring or nullDate the licence was issued, a date string exactly as supplied (dd/mm/yyyy in the example).
detailsOfDrivingLicence.dateOfLastTransactionstring or nullDate of the last transaction on the licence record, as supplied. null when there is none.
detailsOfDrivingLicence.statusstring or nullStatus text on the licence record. null when the record carries none.
detailsOfDrivingLicence.lastTransactedAtstring or nullOffice where the last transaction was made. null when there is none.
detailsOfDrivingLicence.namestring or nullName of the licence holder.
detailsOfDrivingLicence.fatherOrHusbandNamestring or nullName of the holder's father or husband.
detailsOfDrivingLicence.addressListarray or nullAddresses on record, each with its type (permanent or temporary).
detailsOfDrivingLicence.addressList[].completeAddressstring or nullThe complete address as one string.
detailsOfDrivingLicence.addressList[].typestring or nullAddress type: permanent or temporary.
detailsOfDrivingLicence.addressList[].splitAddressobject or nullThe same address split into parts.
detailsOfDrivingLicence.addressList[].splitAddress.districtarray of string or nullDistrict name(s).
detailsOfDrivingLicence.addressList[].splitAddress.statearray of string or nullState name and code as one flat list. Can be [""] when the record carries no state.
detailsOfDrivingLicence.addressList[].splitAddress.cityarray of string or nullCity or locality name(s).
detailsOfDrivingLicence.addressList[].splitAddress.pincodestring or nullSix-digit PIN code.
detailsOfDrivingLicence.addressList[].splitAddress.countryarray of string or nullCountry code(s) and name.
detailsOfDrivingLicence.addressList[].splitAddress.addressLinestring or nullThe address as one line.
detailsOfDrivingLicence.addressstring or nullThe holder address as one string.
detailsOfDrivingLicence.photoUrlstring or nullA link to the licence holder photograph (a URL, never image data). The link is temporary: download the image promptly if you need it.
detailsOfDrivingLicence.splitAddressobject or nullThe holder address split into parts.
detailsOfDrivingLicence.splitAddress.districtarray of string or nullDistrict name(s).
detailsOfDrivingLicence.splitAddress.statearray of string or nullState name and code as one flat list. Can be [""] when the record carries no state.
detailsOfDrivingLicence.splitAddress.cityarray of string or nullCity or locality name(s).
detailsOfDrivingLicence.splitAddress.pincodestring or nullSix-digit PIN code.
detailsOfDrivingLicence.splitAddress.countryarray of string or nullCountry code(s) and name.
detailsOfDrivingLicence.splitAddress.addressLinestring or nullThe address as one line.
detailsOfDrivingLicence.covDetailsarray or nullClass-of-vehicle detail entries when the record carries any; an empty list otherwise.

Taking the fields in turn:

valid is the headline. When it is false, the number and date of birth together did not resolve to a licence. That can mean a wrong number, a wrong date of birth or no such licence, and the response will not tell you which, which is deliberate behaviour for a lookup that uses date of birth as part of the key.

name and fatherOrHusbandName are the holder's name and the name of a relative as recorded. The second field is often a useful tie-breaker when two people share a common name, and it is personal data. The same two values sit inside detailsOfDrivingLicence; the top-level copies are kept so existing integrations keep working.

dob echoes the date of birth held in the record. Compare it with the value you sent; they should agree if the lookup resolved.

address is a single free-text string of the address on record. It is not proof of where the person lives today. detailsOfDrivingLicence.addressList carries each address on record with its type (permanent or temporary), as a complete string and split into district, state, city, PIN code, country and an address line. Read the list parts as lists: state is one flat list of the state name and code, for example ["KARNATAKA", "KA"], and it can be [""] when the record holds no state, so do not index into it without checking.

dlValidity holds the validity by class: nonTransport and transport each with a from and a to, plus hazardousValidTill and hillValidTill. These are date strings exactly as the licensing record supplies them, dd/mm/yyyy in the documented example, so parse them defensively rather than with a date constructor that assumes ISO. A null means the class does not apply to this licence: in the example the transport period and both extra dates are null. validUpto is the same string as dlValidity.nonTransport.to, the date to which the non-transport classes are valid as the record shows it. How you treat the days after that date is a policy question, covered below.

status is the outcome of the lookup, VALID or INVALID, and dlStatus carries the same value for existing integrations. Write handling as an allow-list. detailsOfDrivingLicence.status is a separate status text held on the licence record; it is null in the example and not something to branch on.

badgeDetails lists transport badges. Each entry has badgeIssueDate and badgeNo, both null when the licence has no badge, and classOfVehicle, the classes of vehicle covered, ["LMV"] in the example. The whole list can itself be null or empty.

detailsOfDrivingLicence carries the licence record: dateOfIssue (a string as supplied, dd/mm/yyyy in the example), dateOfLastTransaction and lastTransactedAt (both null when there has been no transaction), the holder names, addressList, address, splitAddress, covDetails and photoUrl. covDetails is an empty list in the example. photoUrl is a link to the holder's photograph: it is a URL, never image data, and it is temporary, so download the image when you receive it if you need it and treat it as personal data.

A field the record does not carry is left out of the response, and a field the record holds as null is returned as null, so test for both: dl.badgeDetails?.[0]?.badgeNo ?? null is the safe read.

referenceId is StampMitra's transaction identifier in the format SMV-YYYYMMDD-XXXXXXX, present on every completed call and not an idempotency key. verificationId is StampMitra's own id for this one verification, VRF- followed by twelve characters, also present on every call and different every time.

What a valid licence does not tell you

It lists classes, but not endorsements, and not always. badgeDetails[].classOfVehicle names the classes of vehicle the record covers, and dlValidity says for which periods. When the licence has no badge the badge fields are null, and the list can be missing or empty, so an absent class is not the same as "no class". The response has no field for endorsements or restrictions beyond that. If you are onboarding a bus driver or handing over a heavy vehicle, compare the class with the physical licence, and your process must say what happens when the two differ or the class is missing.

It does not prove who is holding the card. The response links to a photograph in detailsOfDrivingLicence.photoUrl, which a reviewer can compare with the person, but the check itself does not compare faces. Someone can submit a real number and date of birth that belong to another person. In person, a person checking the physical card against the face is the control that matters. Remotely, a selfie and liveness step is the common companion.

It does not show offences or points. The record carries no endorsement history or suspension reason, and detailsOfDrivingLicence.status is null in the documented example.

It does not predict future behaviour. A licence that is active today can be suspended tomorrow. See the re-check section.

Putting these limits into your onboarding policy and your customer-facing wording prevents the most common error with this product: describing a licence check as a driver safety check.

Why `dob` is a required input

Many lookups need only an identifier. This one needs the identifier and the date of birth, which has three practical consequences.

First, the date of birth works as a second factor. That reduces the chance that someone enumerates numbers to learn about strangers, which is one reason the product is tightly controlled.

Second, a failure is ambiguous. A valid: false result can be a typo in either input. A good product therefore asks the driver to re-check both fields, and shows the number back in a clear typeface before the call.

Third, you are collecting a date of birth you may not otherwise need. Be careful where that value goes. Treat it as personal data from the first keystroke: do not log it, and do not keep it after the decision unless you have a stated purpose.

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

export function isIsoDate(s) {
  return /^\d{4}-\d{2}-\d{2}$/.test(s) && !Number.isNaN(Date.parse(s));
}

Collect the date of birth with a date picker that produces YYYY-MM-DD, not a free-text field, because a day-month swap such as 03-04 versus 04-03 is the most common reason a genuine licence fails.

The licence number format

The documented sample is MH1420110012345, and the validation message reads "dlNumber must match the format MH1420110012345". The shape is commonly described as a two-letter state code, a two-digit registering authority number, a four-digit year and a seven-digit serial, fifteen characters in all. The sample fits that shape: MH for Maharashtra, 14, 2011 and 0012345.

Real cards are messier. Licences are printed with spaces or hyphens (MH-14 2011 0012345), older licences may not follow the pattern at all, and some states have used their own layouts over the years. Do not write a strict pattern on your side. Normalise by uppercasing and stripping separators, and let the API validate. A malformed value returns 400 BAD_REQUEST before verification, is not billed, and the message names the field.

Reading the validity dates and `status` without inventing rules

You will be tempted to hard-code rules such as "reject if expired" or "allow thirty days after expiry". Resist the second kind. Whether a lapsed licence can be renewed within a grace period, and what a driver may do during that time, is set by the Motor Vehicles Act, 1988, the rules made under it and state practice, and it changes. Your process should not encode a grace period that you have not checked against the current rules and your own legal advice.

A defensible default is simple. Compare the validity date for the class you need (validUpto, which is dlValidity.nonTransport.to, for a private vehicle; dlValidity.transport.to for a commercial one) with today's date in Indian Standard Time. If it is earlier than the end of the period you need the driver to be licensed for, or the date is null or cannot be read, route the case to review and ask for the renewed licence. For a rental, that period runs to the end of the rental; for a fleet driver, to at least the next scheduled re-check.

The dates are strings exactly as supplied, dd/mm/yyyy in the documented example, so do not hand them to a date constructor that expects ISO. Parse the form you see, accept ISO as well, and treat anything else as unreadable.

JavaScript
// Dates arrive as supplied: dd/mm/yyyy in the documented example. Accept ISO too; anything else is unreadable.
export function parseLicenceDate(value) {
  if (typeof value !== "string") return null;
  const dmy = /^(\d{2})\/(\d{2})\/(\d{4})$/.exec(value);
  const iso = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
  const [y, m, d] = dmy ? [dmy[3], dmy[2], dmy[1]] : iso ? [iso[1], iso[2], iso[3]] : [];
  return y ? new Date(`${y}-${m}-${d}T23:59:59+05:30`) : null;
}

export function licenceCoversPeriod(dl, endDateIso) {
  const validUpto = parseLicenceDate(dl.dlValidity?.nonTransport?.to ?? dl.validUpto);
  const end = new Date(`${endDateIso}T23:59:59+05:30`);
  return validUpto !== null && validUpto >= end; // null or unreadable: not covered, so it goes to review
}

const ACCEPTED_STATUS = new Set(["VALID"]); // extend only after your team decides

export function assessDl(dl, { rentalEnd, expectedName, dob }) {
  const reasons = [];
  if (dl.valid !== true) return { outcome: "reject", reason: "not_found", referenceId: dl.referenceId };
  if (!ACCEPTED_STATUS.has(dl.status ?? dl.dlStatus)) reasons.push("status_not_in_allow_list");
  if (rentalEnd && !licenceCoversPeriod(dl, rentalEnd)) reasons.push("expires_before_period_ends");
  if (dl.dob !== dob) reasons.push("dob_mismatch");
  if (expectedName && nameOverlap(expectedName, dl.name) < 0.8) reasons.push("name_unclear");
  return { outcome: reasons.length ? "review" : "approve", reasons, referenceId: dl.referenceId, verificationId: dl.verificationId };
}

nameOverlap is a token comparison that tolerates initials and transliteration, like the one on the Voter ID page. Set its threshold from real data, not sandbox.

The access control you need to plan for

This endpoint is one of two in the verification family, with Passport, that the StampMitra SDK documentation describes as needing an IP-allowlisted key. When a key does not meet the requirement, the server's message is passed through to your code as a permission error, so you will see it in the response rather than a silent failure.

There are three practical points.

Plan the allowlist early. An allowlist is a list of IP addresses or CIDR ranges from which the key may be used. You need stable egress addresses for the backend that calls the endpoint. If your servers sit behind dynamic addresses, put the verification calls behind a small proxy or NAT with a fixed address.

Check your plan. An IP allowlist is a plan feature on the pricing page, and not every plan includes it. If you are on a plan without it, you may be unable to use this endpoint in production until you move to one that does. Find out before you commit to a launch date.

Keep the key narrow. Give it only verification.dl.read, store it in a secrets manager, and use a separate key from the rest of your verification traffic. See the authentication docs.

Never call this endpoint from a browser or a mobile app. Besides exposing the key, the call would originate from an address outside your allowlist.

Billing and failure behaviour

Each completed call is metered as dl.verify. In production the standard verification rate applies, ₹5 per call on pay-as-you-go and lower on higher plans, excluding 18% GST; the pricing page has the numbers for your plan.

A negative answer counts. If the lookup completes and reports that the number and date of birth do not resolve, you have received a determination, it is recorded and billed, and you get a referenceId. Calls that never reach verification, whether because of a malformed number (400), a bad key (401) or a missing scope or a key that is not allowlisted (403), are not billed.

Other outcomes follow the same shared behaviour as every verification endpoint. A short wallet returns 402, and the answer is to top up. Exceeding the rate limit returns 429; the documented example reads "Rate limit exceeded: 60 requests per 60 seconds for this endpoint." If the upstream service cannot be reached you get 502, no verification completes and nothing is charged for it. A timeout leaves you uncertain, since the route documents no idempotency header and the referenceId is not an idempotency key.

StatusCodeMeaningYour action
400BAD_REQUESTdlNumber or dob malformedShow the message, ask for correction
401UNAUTHORIZEDMissing or invalid keyFix deployment
402PAYMENT_REQUIREDWallet balance insufficientTop up, alert operations
403FORBIDDENMissing scope, or key not IP-allowlistedFix the key, scope or allowlist
429TOO_MANY_REQUESTSRate limit or sandbox limit (SANDBOX_RATE_LIMIT, SANDBOX_DAILY_LIMIT or SANDBOX_IP_LIMIT)Back off with jitter
502INTERNAL_ERRORUpstream unreachableRetry with backoff

Every error uses the same envelope, { "error": { "code", "message", "requestId" } }.

  • 400Validation errorBAD_REQUEST

    dlNumber must match the format MH1420110012345

  • 401Missing or invalid API keyUNAUTHORIZED

    Missing or invalid API key.

  • 402Insufficient wallet balancePAYMENT_REQUIRED

    Insufficient fulfilment wallet balance to cover this call.

  • 403Valid key, missing required scopeFORBIDDEN

    API key is valid but lacks the required scope for this endpoint.

  • 429Rate limitedTOO_MANY_REQUESTS

    Rate limit exceeded: 60 requests per 60 seconds for this endpoint.

  • 502Upstream verification service unreachableINTERNAL_ERROR

    Unable to reach the order/customer service right now

Why a check fails and what to tell the driver

  • valid: false. Ask the driver to check the number against the card and re-pick the date of birth. Do not say which field is wrong, because you do not know.
  • Valid but expired. Ask for the renewed licence. A driver who renewed last week may be ahead of the record, so offer to retry in a day.
  • Valid but name unclear. Show the name on record and let the driver confirm which is theirs. Differences are usually initials or spelling.
  • 403 on your side. This is a configuration problem. Tell the driver the check is temporarily unavailable and alert your own team.
  • 429 or 502. Tell the driver to wait a moment. These are transient.

Where driving licence checks fit in a workflow

Ride-hailing and delivery onboarding. The driver provides a licence number and date of birth, the backend verifies, compares the name with the identity document the driver already supplied, and checks the validity date. The classes of vehicle come from badgeDetails[].classOfVehicle, which a reviewer compares with the licence image, because a class missing from the record is a reason to look rather than to guess.

Self-drive rental. Before handing over keys, the customer's licence is verified, the licence's validity is compared with the rental end date, and a person at the counter compares the card and the face. The verification is evidence for your records and a quick screen, not the final control.

Logistics and fleet operators. Pair Vehicle RC verification with this check so each vehicle is matched to a licensed driver. Commercial vehicles need the right class and badge: badgeDetails and dlValidity.transport show what the record holds, and the physical card remains the check you confirm it against.

Corporate vehicle programmes. Employers who allow staff to drive company vehicles check licences at issue and at renewal dates, without collecting more personal data than the programme needs.

Insurance. Insurers and brokers can use the check to confirm that a named driver holds a licence, as one input into underwriting, with their own rules for the rest.

Combining with other checks

A licence check answers "does this licence exist and is it active". Wider onboarding asks more.

QuestionCheck
Is this who they say they are (tax identity, registered name)?PAN verification
Is there a government identity document that agrees on name and date of birth?Voter ID or Passport
Can we pay them?Bank account verification
Is the vehicle valid and who owns it?Vehicle RC verification
Is the person a business?GSTIN verification

The agreement of name and date of birth across independent records is the useful signal. A licence whose holder name and date of birth agree with the PAN and the bank account holder name is a strong picture. A disagreement on any one is a reason to look. Run the cheapest decisive check first and stop on a hard failure.

How often to re-check a driver

A licence can be suspended, cancelled, renewed or lapse. A one-time check at onboarding goes stale. A sensible cadence ties re-checks to dates and events.

  • Store validUpto after each successful check and schedule a refresh a few days before it.
  • Re-check after an incident or a complaint.
  • Re-check at a fixed outer interval, such as annually, for drivers you work with continuously, with the interval set by your risk appetite and any regulatory or contractual duty you have.
  • Do not poll every driver weekly. It adds cost and personal-data handling without adding decisions.

Integration walkthrough

cURL

cURL
curl -X POST "https://api-b2b.stampmitra.in/v1/verify/driving-license" \
  -H "Authorization: Bearer $STAMPMITRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dlNumber":"MH1420110012345","dob":"1990-01-01"}'

Node.js

The Node.js SDK and Python SDK wrap this endpoint. The raw calls below show what they do. Remember that the key must be IP-allowlisted, so run this from the backend whose address is on the list.

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

export async function verifyDrivingLicence({ dlNumber, dob }, { timeoutMs = 20000 } = {}) {
  if (!isIsoDate(dob)) return { kind: "invalid_input", message: "Date of birth must be YYYY-MM-DD." };
  const res = await fetch(`${BASE}/v1/verify/driving-license`, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.STAMPMITRA_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ dlNumber: normaliseDl(dlNumber), dob }),
    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_driving_licence(dl_number: str, dob: str, timeout: int = 20) -> dict:
    if not re.fullmatch(r"\d{4}-\d{2}-\d{2}", dob):
        return {"kind": "invalid_input", "message": "Date of birth must be YYYY-MM-DD."}
    resp = requests.post(
        f"{BASE}/v1/verify/driving-license",
        headers={"Authorization": f"Bearer {os.environ['STAMPMITRA_API_KEY']}"},
        json={"dlNumber": re.sub(r"[\s\-.]", "", dl_number.upper()), "dob": dob},
        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"),
    }

A 403 from a key that is valid but not allowlisted is not retryable. The function marks it failed, and your monitoring should treat any 403 on this endpoint as a configuration alarm, not a driver problem.

Edge cases and odd inputs

  • Day and month swapped. The classic reason for a false negative. Use a date picker.
  • Older licence formats. A licence issued decades ago may not look like the sample. Test the ones your drivers actually hold.
  • Licences issued by another state. The state code in the number is the issuing state, which may differ from where the driver lives or where you operate.
  • Recently renewed licences. The record may lag, so a renewed card can look expired for a short time.
  • Name differences. Initials, a married name, transliteration. Keep a review path.
  • Missing relative's name. Treat fatherOrHusbandName as possibly blank.
  • Separators in the number. Spaces, hyphens, dots. Normalise.
  • Duplicate submissions. The same driver submitting twice by mistake. De-duplicate on the normalised number and date of birth hash within a short window, to avoid billing twice.
  • Class and badge needs. badgeDetails can be null, empty or have null badge fields, so route to a manual check where the job needs a specific class or badge.
  • Dates in two forms. The validity and issue dates are strings as supplied, dd/mm/yyyy in the documented example. A parser that accepts only ISO will fail on them; one that accepts only dd/mm/yyyy will fail if a record arrives in ISO.
  • Empty state. splitAddress.state can be [""], a list holding one empty string, not an empty list.
  • Nulls. null means the record holds nothing for that field; a missing key means the record did not carry it. Do not treat either as an error.

Audit logging and monitoring

Plan the log around the question a transport or insurance auditor would ask: on what basis did you let this person drive? You need your own driver or application ID, the referenceId and verificationId, the outcome and reason codes, the HTTP status, the requestId on errors, the key that made the call, and the time. You do not need, and should not log, the licence number, date of birth, name, relative's name, addresses, photograph link or raw payload. A keyed hash covers the occasional debugging link to a licence number.

StampMitra's request logs can be fetched with GET /v1/logs or browsed in the dashboard; how far back they go depends on the plan, up to 365 days on Scale. Decision records of your own are kept for whatever period your audits require.

This endpoint is unusual in that a 403 almost always means configuration, so it deserves a pager rule of its own. Beyond that, watch the share of valid: false results (a jump suggests the date picker broke), the review share, and 429 and 402 counts.

Modelling the cost

The cost driver is how often you re-check, not the first check.

JavaScript
export function monthlyDlCost({ newDrivers, retryShare = 0.15, activeDrivers = 0, recheckPerDriverPerMonth = 1 / 12, pricePerCall }) {
  const calls = newDrivers * (1 + retryShare) + activeDrivers * recheckPerDriverPerMonth;
  return { calls: Math.ceil(calls), cost: Math.ceil(calls) * pricePerCall };
}

A delivery fleet onboards 600 drivers a month, 15 percent need a second attempt because of a swapped date or a misread number, and it re-checks each of 4,000 active drivers once a year. That is 690 calls for new drivers plus about 333 calls a month spread over the year, around 1,023 calls. Multiply by your plan's standard rate and add 18% GST on the top-up. A date picker and a number confirmation screen can cut the retry share from 15 to 5 percent, saving about sixty calls a month. Re-checking every driver quarterly instead of annually adds roughly 1,000 calls a month for a risk reduction you should first justify.

Sandbox and production

Sign up and you get an sk_test_ key that never debits the wallet and answers with sample data. The answer comes from a stored sample, not from the licensing records: the test values table on this page lists the licence numbers that select each outcome (valid, not found, expired and the error responses), and any other well-formed number returns the success example with invented values, the same every time, with the licence number and date of birth you sent echoed back. A valid answer carries the same fields as the documented example, nulls and dd/mm/yyyy dates included, and the sandbox marker fields. Use it for the date picker, normalisation, error handling and every screen, and keep a few responses as fixtures. You can build the parser against it. It says nothing about how real licences or your name thresholds will behave, and its limits are not production limits. The quickstart shows a first call.

Production needs an sk_live_ key, issued after your organisation's KYC and a Driving Licence production application are approved; the server reads the environment from the key. Since production also demands an IP-allowlisted key, rehearse that path before launch: configure the key, call from a listed address, and confirm that a call from elsewhere is refused with a 403. A passing sandbox does not prove production access.

A worked scenario: a self-drive rental counter

A fictional rental company, Roadrunner Rentals, wants customers to upload their licence before arrival so handover takes five minutes.

  1. The customer enters the licence number and picks their date of birth. The app shows the number back in large type for confirmation.
  2. The backend calls the endpoint from its fixed egress address with a ten-second timeout. On 429 it asks the customer to wait; on 502 it saves the booking and retries in the background.
  3. A valid: false result produces a message asking the customer to re-check the number and the date of birth, without saying which is wrong.
  4. A valid result is compared with the booking: the name overlaps with the booked driver's name, the date of birth equals what was typed, status is in the accepted set.
  5. Validity against the rental. The backend parses the dd/mm/yyyy date and checks that it is on or after the planned return date. If not, the booking moves to review with the message "your licence expires during the rental".
  6. The class check has a person in it. The response lists badgeDetails[].classOfVehicle, but the counter staff still look at the physical card to confirm it covers the vehicle category, and compare the face with the photograph on the card.
  7. Records kept. Roadrunner stores the referenceId, outcome, reasons and timestamp on the booking. It does not keep the licence number, date of birth or address after handover, beyond what its insurer requires, and its notice says so.

The check shortens the counter process and gives an audit trail. It does not replace the person looking at the card.

Production checklist

Before launch you should be able to answer yes to each of these.

  1. A dedicated key exists with only verification.dl.read, stored in a secrets manager and bound to your listed addresses.
  2. Your plan includes the allowlist feature and you have rehearsed success and refusal.
  3. Only your backend calls the endpoint.
  4. The date picker emits YYYY-MM-DD.
  5. Unknown status values route to review rather than guessing.
  6. Expiry is compared in IST against the period you need cover for.
  7. Only 429 and 502 are retried.
  8. A 403 pages someone.
  9. Logs carry reference IDs and outcomes, never personal fields.
  10. Someone owns the class and badge check, with a written step for a missing or null class.
  11. Re-checks are scheduled from validUpto.
  12. The notice and retention schedule cover the data.

Common mistakes

The costliest error is a description error: calling this a driver safety check, when it confirms a licence record and nothing about driving history. A close second is assuming the vehicle class or badge is always in the response. badgeDetails can be null, empty or have null fields, so a manual step has to own the case where it is missing.

Parsing mistakes come next: handing dd/mm/yyyy dates to a date constructor that expects ISO, indexing into splitAddress.state without allowing for [""], and treating a null as an error.

Form mistakes follow. A free-text date of birth invites swapped day and month and a stream of false negatives. Telling the driver which field is wrong is a small lie, since you cannot know. Hard-coding a grace period after expiry bakes in a rule that may no longer hold.

Operational mistakes finish the list: calling the endpoint from a browser, which exposes the key and bypasses the allowlist; logging the response; polling every driver on a timer instead of re-checking around validUpto; and discovering the allowlist requirement on launch day.

Sources

  • Driving Licence API reference, StampMitra product data: request fields, response example, scope and validation message, checked October 2026.
  • Pricing, StampMitra: per-call rates, plan features including the IP allowlist, and log retention, checked October 2026. Rates exclude 18% GST.
  • Motor Vehicles Act, 1988 and the Central Motor Vehicles Rules, 1989, Government of India, and the Parivahan portal, for licence classes, validity and renewal. Check the current text, since both have been amended.
  • Digital Personal Data Protection Act, 2023, Government of India. Read the current Act and the rules made under it on the official government sites.

Sandbox test values

Send one of these values as dlNumber 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: dob: 1990-01-01. Add the header X-Sandbox-Delay-Ms (up to 3000) to hold the reply and test your client timeout.

Sandbox test values
ScenarioInput to sendWhat you get back
Valid, active licence
SB0000000000001
200
200 with valid true, status VALID, the full licence record (validity by class, badge details, holder details) and a future validUpto.
Licence not found
SB0000000000002
200
200 with valid false, status INVALID and no licence details.
Licence expired
SB0000000000004
200
200 with valid true and status VALID, but validUpto and dlValidity.nonTransport.to in the past (compare the dates, not the status).
Verification source times out
SB0000000000005
502INTERNAL_ERROR
Our documented upstream-failure error, answered at once (no waiting). Retry with the same Idempotency-Key. Add the header X-Sandbox-Delay-Ms (up to 3000) to hold the reply and test your client timeout.
Verification source unavailable
SB0000000000006
502INTERNAL_ERROR
Our documented 5xx error for an unreachable source (the same body a live call gives when the source is down). Safe to retry after a short delay.
Rate limited
SB0000000000007
429TOO_MANY_REQUESTS
Too many requests. Back off and retry with exponential delay and jitter.
Wallet balance too low
SB0000000000008
402PAYMENT_REQUIRED
The wallet cannot cover the call (catalogue entry INSUFFICIENT_WALLET_BALANCE, envelope code PAYMENT_REQUIRED). Nothing is debited in the sandbox. Top up and retry with the same Idempotency-Key.
Invalid format
SB0000000000
400BAD_REQUEST
Validation error that names the field. Nothing is looked up and nothing is charged.

Frequently asked questions

What does the driving licence verification API return?

It returns the licence record: valid and status, the validity by class in dlValidity, badgeDetails with the classes of vehicle, detailsOfDrivingLicence with the issue date, names, addresses and a photograph link, and the old top-level name, fatherOrHusbandName, address, validUpto and dlStatus, plus a referenceId and a verificationId. It does not list endorsements or offences, and a class on the record does not tell you the driver may drive the particular vehicle you are handing over.

Why does the request need a date of birth?

The date of birth works as a second key for the lookup, which reduces the risk of someone enumerating licence numbers. The consequence is that a false result can mean a wrong number or a wrong date, so ask the driver to re-check both and use a date picker that produces YYYY-MM-DD.

What format is the driving licence number?

The documented sample is MH1420110012345, commonly described as a state code, a registering authority number, a four-digit year and a seven-digit serial. Older licences and some states differ, so uppercase and strip separators, then let the API validate instead of writing a strict pattern.

Does this endpoint need an IP-allowlisted key?

Yes. StampMitra's SDK documentation describes Driving Licence and Passport as needing an IP-allowlisted key, and the server's message is passed through as a permission error otherwise. An IP allowlist is a plan feature on the pricing page, so confirm your plan includes it before you plan a launch date.

How should I treat a licence that has just expired?

Compare the validity date for the class you need, validUpto for non-transport, with today's date in Indian Standard Time against the period you need the driver licensed for, and send anything earlier, null or unreadable to review. The dates are strings as supplied, dd/mm/yyyy in the documented example, so parse that form. Do not hard-code a grace period, because renewal rules come from the Motor Vehicles Act, its rules and state practice, and they change.

When am I billed for a driving licence check?

Usage is recorded and the production wallet debited when the verification completes. A valid false result is still a completed, billed determination. A malformed number, a bad key or a missing scope or allowlist returns 400, 401 or 403 and is not billed, and sandbox calls never debit your wallet.

How often should I re-check a driver?

Tie re-checks to dates and events. Store the validity date and refresh a few days before it, re-check after an incident or complaint, and add a fixed outer interval for drivers you work with continuously. Weekly polling of every driver adds cost and personal-data handling without improving decisions.

Why does a genuine licence sometimes return valid false?

The most common cause is a swapped day and month in the date of birth, then a misread number or a record that lags a recent renewal. Ask the driver to re-enter both fields and offer a retry later, without saying which field is wrong, because the response does not tell you.

Can I test driving licence verification for free?

Yes. A sandbox key starting with sk_test_ never debits your wallet and returns sample data with synthetic values and the same fields as the documented example, so the same input always gives the same answer. Test the date picker, error handling and screens there, and test the IP allowlist path before go-live because sandbox does not prove production access.

What should I store after the check?

Usually the outcome, reason codes, the validity date if you schedule re-checks, the referenceId and verificationId and a timestamp. Avoid keeping the licence number, date of birth, names, addresses or the photograph link beyond what you need, keep them out of logs, set a retention period and explain what you keep in your notice.

Can I use this check for driver safety decisions?

Not on its own. It confirms that a licence record exists and is active, not how someone drives, and it shows no offences or points. Describe it accurately to customers as a licence check, and pair it with identity checks and a manual class and badge check where the job needs one, since a class can be missing or null on the record.

What does a 403 on this endpoint mean?

Usually a missing verification.dl.read scope or a key that is not IP-allowlisted, both configuration problems. It is not retryable, so raise an alert, check the key, scope and allowlist, and tell the driver the check is temporarily unavailable rather than suggesting they did something wrong.

Build with AI

Integrate Driving Licence with one prompt.

Pick your AI tool and copy a prompt written for this API. It already has the endpoints, fields and errors.

Claude prompt · Driving Licence · 8,693 charactersOpen Claude ↗
I'm using Claude to build this.

Integrate the StampMitra API (Indian identity verification and e-Stamp Paper) into my app.

API facts (source of truth: https://developer.stampmitra.in/llms.txt)
- Base URL: https://api-b2b.stampmitra.in
- Auth: send "Authorization: Bearer <key>" (or "x-api-key: <key>") on every request
- Requests and responses are JSON. Send Content-Type: application/json on POST.
- Use a SANDBOX key (sk_test_...) while building. Read it from the environment variable STAMPMITRA_API_KEY.
- Never hard-code the key, never expose it to the browser, never log it.
- Call StampMitra only from server-side code. The UI calls my own backend route.

How to build it
- First inspect my project: language, framework, package manager, HTTP client, test runner and folder conventions. Follow them. If the project is empty, ask which stack I want before writing code.
- The official StampMitra SDKs (Node.js, Python, PHP, Java, Go, .NET, Ruby) are pre-release 0.1.0 and not yet published to npm, PyPI, Packagist, Maven Central, the Go module proxy, NuGet or RubyGems, so do not run an install command for them. Call the REST API over HTTPS with the HTTP client my project already uses. Do not install or invent a StampMitra package.
- Put every StampMitra call in ONE small client module. It adds the auth header, applies a 15 second timeout and turns error responses into a typed error with status, code, message and requestId.
- Add STAMPMITRA_API_KEY to .env.example with a placeholder (sk_test_xxx). Fail fast at startup with a clear message if it is missing. Never commit real keys.

Error handling (every error body is { error: { code, message, requestId } })
- 400 BAD_REQUEST: invalid input. Show a field-level message. Do not retry.
- 401 UNAUTHORIZED: key missing or invalid. This is my configuration problem, not the end user's. Show a generic "service unavailable" message, log the requestId, do not retry.
- 402 PAYMENT_REQUIRED: not enough wallet balance (production). Surface it to me as an operational alert, not to the end user.
- 403 FORBIDDEN: the key lacks the required scope or the service is not enabled. Say which scope the endpoint needs.
- 404 NOT_FOUND: wrong id or path. Do not retry.
- 429 TOO_MANY_REQUESTS (or, on a sandbox key, SANDBOX_RATE_LIMIT, SANDBOX_DAILY_LIMIT, SANDBOX_IP_LIMIT): rate limit, or the sandbox limits of 10 requests a minute and 200 a day per organisation. Retry at most 3 times with exponential backoff and jitter (honour Retry-After if present), then show a friendly "try again shortly" message.
- 5xx / 502 / network timeout: retry reads (GET) up to 2 times. For POST calls retry at most once, then show a friendly message.
- Log requestId and referenceId with every failure. Never log the API key, a full PAN, bank account number or whole response bodies.

TASK: Integrate the StampMitra "Driving Licence" API
Verify a Driving Licence in real time.
Production service code: dl.verify

ENDPOINT: POST /v1/verify/driving-license
- Verify Driving Licence
- Required scope: verification.dl.read
- Parameters:
  - dlNumber (string, required): Driving licence number.
  - dob (string, required): Date of birth (YYYY-MM-DD).
- Example request body: {"dlNumber":"MH1420110012345","dob":"1990-01-01"}
- Response fields: referenceId, verificationId, valid, dlNumber, dob, status, dlStatus, name, fatherOrHusbandName, address, validUpto, badgeDetails, dlValidity, detailsOfDrivingLicence
- Example response: {"referenceId":"SMV-20260927-2Q56T8","verificationId":"VRF-4H8Z2M6TQ9KW","valid":true,"dlNumber":"KA51201900089895","dob":"1994-08-05","status":"VALID","dlStatus":"VALID","name":"JOHN DOE","fatherOrHusbandName":"JOHN DOE","address":"FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103","validUpto":"09/05/2039","badgeDetails":[{"badgeIssueDate":null,"badgeNo":null,"classOfVehicle":["LMV"]}],"dlValidity":{"nonTransport":{"to":"09/05/2039","from":"10/05/2019"},"hazardousValidTill":null,"transport":{"to":null,"from":null},"hillValidTill":null},"detailsOfDrivingLicence":{"dateOfIssue":"10/05/2019","dateOfLastTransaction":null,"status":null,"lastTransactedAt":null,"name":"JOHN DOE","fatherOrHusbandName":"JOHN DOE","addressList":[{"completeAddress":"FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103","type":"permanent","splitAddress":{"district":["BANGALORE"],"state":["KARNATAKA","KA"],"city":["BELLANDUR"],"pincode":"560103","country":["IN","IND","INDIA"],"addressLine":"FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103"}},{"completeAddress":"FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103","type":"temporary","splitAddress":{"district":["BANGALORE"],"state":["KARNATAKA","KA"],"city":["BELLANDUR"],"pincode":"560103","country":["IN","IND","INDIA"],"addressLine":"FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103"}}],"address":"FLAT NO D-901 SUN,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103","photoUrl":"https://example.com/dl-photos/KA51201900089895.jpeg","splitAddress":{"district":["BANGALORE"],"state":[""],"city":["BELLANDUR"],"pincode":"560103","country":["IN","IND","INDIA"],"addressLine":"FLAT NO D-901 SUNCITY,BELLANDUR, BANGALORE SOUTH,BANGALORE,KA 560103"},"covDetails":[]}}
- Errors this endpoint can return:
  - 401 UNAUTHORIZED: Missing or invalid API key
  - 403 FORBIDDEN: Valid key, missing required scope
  - 400 BAD_REQUEST: Validation error
  - 402 PAYMENT_REQUIRED: Insufficient wallet balance
  - 429 TOO_MANY_REQUESTS: Rate limited
  - 502 INTERNAL_ERROR: 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 licensing data does not provide it; a value the licensing data holds as null (no badge, no transport class, no last transaction) is returned as null. validUpto, dlValidity and dateOfIssue are date strings exactly as supplied (dd/mm/yyyy in the example), so parse them defensively; dob is ISO yyyy-mm-dd. status and dlStatus carry the same value, and name, fatherOrHusbandName, address and validUpto repeat values from detailsOfDrivingLicence and dlValidity and are kept for existing integrations. photoUrl is a link to the holder photograph and is temporary.

Rules for this verification
- Validate dlNumber, dob on client and server before calling. A malformed value returns 400.
- "valid": false (or found: false) is a completed, billable verification. Show a clear "not valid" result, not a crash.
- Mask sensitive identifiers in the UI after submit and never log them in full.
- Store referenceId, the outcome and a timestamp with the record for audit. Do not re-call on every page load: cache per record.
- Build: one backend route that calls StampMitra, one small form, and a result card with loading, success, not-valid and error states.

Test in Sandbox
- A successful call, a validation failure (expect 400), a missing or wrong key (expect 401) and the 429 / 5xx retry path.

How I want you to work:
1. Before writing code, list the files you will create or change and the plan in 5-8 bullets. Then implement without pausing for approval.
2. If the StampMitra MCP server (@stampmitra/mcp-server) is connected, use it to run real sandbox calls and check the response shape before coding against it.
3. Write tests for the API client module and the validation (mock the HTTP layer).
4. At the end, summarise what you changed, how to run it and what I must do manually (add the key, restart the server).

Acceptance checklist:
- Works end to end in Sandbox with the real response fields (no mocked data in the final path)
- No secrets in client code, logs, URLs or git
- Clear loading, empty and error states, including 400, 401, 402, 403, 429 and 5xx
- referenceId (and requestId on failures) is stored or logged for audit
- Inputs are validated on client and server, and sensitive values are masked in the UI
- Tests cover the API client, validation and at least one error path
- A short note on how to run it and how to switch from Sandbox to production later
- If anything is missing (like my key), ask me. Do not guess endpoints, fields or values.

Start with a sandbox key.

Free to try. Make your first test call today.