StampMitraDevelopers
LiveVerification API

Udyam verification API: MSME registration, size class and the payment clock

Verify a Udyam Registration in real time.

POST/v1/verify/udyamScope verification.udyam.read₹5 per call
curl -X POST "https://api-b2b.stampmitra.in/v1/verify/udyam" \
  -H "Authorization: Bearer $STAMPMITRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "udyamNumber": "UDYAM-UP-43-1234567"
  }'
Example responseJSON
{
  "referenceId": "SMV-20260927-5U29V7",
  "verificationId": "VRF-7K3M9Q2XH4TB",
  "found": true,
  "status": "SUCCESS",
  "udyamStatus": "SUCCESS",
  "udyamNumber": "UDYAM-UP-43-1234567",
  "enterpriseName": "helloscholar",
  "organizationType": "Proprietary",
  "majorActivity": "Services",
  "socialCategory": "General",
  "dateOfIncorporation": "2020-05-29",
  "dateOfCommencement": "2020-05-29",
  "dateOfUdyamRegistration": "2022-01-02",
  "enterpriseType": "Micro",
  "classificationYear": "2024-25",
  "classificationDate": "2025-06-02",
  "certificateUrl": "https://udyamregistration.gov.in/Udyam_Download/UDYAM-UP-43-1234567.pdf",
  "classificationHistory": [
    {
      "serialNumber": "1",
      "classificationYear": "2024-25",
      "enterpriseType": "Micro",
      "classificationDate": "2025-06-02"
    },
    {
      "serialNumber": "2",
      "classificationYear": "2023-24",
      "enterpriseType": "Micro",
      "classificationDate": "2023-05-09"
    },
    {
      "serialNumber": "3",
      "classificationYear": "2022-23",
      "enterpriseType": "Micro",
      "classificationDate": "2022-06-26"
    }
  ],
  "splitAddress": {
    "flat": "Ground Floor",
    "building": "05 Raman Vihar",
    "village": "Naubasta",
    "block": "Naubasta",
    "street": "Naubasta",
    "city": "Kanpur",
    "district": "KANPUR NAGAR",
    "state": "UTTAR PRADESH",
    "pincode": "208021",
    "mobile": "70*****210",
    "email": "[email protected]"
  },
  "unitLocations": [
    {
      "serialNumber": "1",
      "unitName": "hellobanker",
      "flat": "Ground Floor",
      "building": "05 Raman Vihar Naubasta",
      "village": "KANPUR NAGAR",
      "block": "KANPUR NAGAR",
      "street": "05 Raman Vihar Naubasta Bamba",
      "city": "Kanpur",
      "district": "KANPUR NAGAR",
      "state": "UTTAR PRADESH",
      "pincode": "208021"
    },
    {
      "serialNumber": "2",
      "unitName": "helloscholar",
      "flat": "Ground Floor",
      "building": "05 Raman Vihar Naubasta",
      "village": "Kanpur",
      "block": "Kanpur",
      "street": "Kanpur",
      "city": "Kanpur",
      "district": "KANPUR NAGAR",
      "state": "UTTAR PRADESH",
      "pincode": "208021"
    }
  ],
  "nicCodes": [
    {
      "serialNumber": "1",
      "nic2Digit": "85",
      "nic2Description": "Education",
      "nic4Digit": "8550",
      "nic4Description": "Educational support services",
      "nic5Digit": "85500",
      "nic5Description": "Educational support services",
      "activity": "Services",
      "date": "2022-01-02"
    }
  ],
  "dic": "KANPUR NAGAR",
  "msmeDi": "KANPUR"
}

Most teams that verify a Udyam registration are not curious about MSME policy. They have a payables problem. A buyer that owes money to a micro or a small enterprise works against a payment clock that a large supplier does not have, and the clock only applies if the buyer knows which of its vendors are registered and what size class they sit in. POST /v1/verify/udyam answers that question for one vendor: you send a Udyam Registration Number, and you get back whether an active registration exists, the enterprise name and type, its size class and a link to the certificate.

This page starts from the payables problem and works outwards: how to read the registration number, what the response looks like and how its status values behave, why two of its fields are easy to confuse, why the certificate link should not be stored, how to turn the result into a payment-due date, and how to run the integration in production. It also covers the sandbox, the cases that trip up real integrations and a cost model. It is written for developers and for the finance and compliance people who will own the policy.

Why buyers check Udyam: the payment clock

Under the law on micro, small and medium enterprises, a buyer is expected to pay a micro or small supplier within the period agreed in writing, which cannot exceed 45 days from the day the goods or services were accepted, or within 15 days where nothing was agreed in writing. For companies that owe such suppliers beyond the period, a half-yearly return to the Ministry of Corporate Affairs is expected. And since the 2023-24 financial year the Income Tax Act has tied the deduction of an expense payable to a micro or small enterprise to payment within that period. Rules like these change, and how they apply to a particular buyer is a question for your tax adviser and your company secretary, so treat this paragraph as the reason the check exists and not as advice.

The engineering consequence is simple. To run a payment clock, your payables system needs two facts per vendor: whether the vendor has an active Udyam registration, and whether its class is micro, small or medium. Medium enterprises are outside the shorter clock. Vendors that are not registered cannot be treated as MSME suppliers on the strength of a statement alone. The Udyam API gives you both facts from the registry, together with a certificate you can show an auditor.

The registration number: UDYAM-XX-00-0000000

An Udyam Registration Number has a fixed layout that you can validate for free.

SegmentExampleMeaning
PrefixUDYAMFixed text
StateMHTwo letters for the state or union territory of the registration
District12Two digits for the district
Serial1234567Seven digits

The whole value is written with hyphens: UDYAM-MH-12-1234567. The API's format check is ^UDYAM-[A-Z]{2}-[0-9]{2}-[0-9]{7}$, which means uppercase, hyphens in the right places, and no spaces. It does not verify that the state letters or the district digits exist. Vendors paste the number in many forms (lowercase, without hyphens, with spaces), so normalise before you validate: strip spaces, uppercase, and if the string has the right number of characters but no hyphens, re-insert them at positions 5, 8 and 11 of the unhyphenated string.

Older registrations under the Udyog Aadhaar scheme had a different number format. If a vendor gives you one of those, the format check will return a 400. The right response is to ask the vendor for their current Udyam number, not to look for a way around the check.

JavaScript
const URN_RE = /^UDYAM-[A-Z]{2}-[0-9]{2}-[0-9]{7}$/;

export function normaliseUrn(raw) {
  const compact = String(raw ?? "").replace(/[\s-]+/g, "").toUpperCase();
  const m = /^UDYAM([A-Z]{2})([0-9]{2})([0-9]{7})$/.exec(compact);
  return m ? `UDYAM-${m[1]}-${m[2]}-${m[3]}` : null;
}

export function inspectUrn(raw) {
  const urn = normaliseUrn(raw);
  if (!urn || !URN_RE.test(urn)) return { ok: false };
  const [, state, district] = urn.split("-");
  return { ok: true, urn, state, district };
}

The request and the response

The request has one field, udyamNumber. The response guarantees referenceId, verificationId and found; everything else is optional and appears when the registry provides it. The tables are rendered from the same API data as the reference page.

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.
udyamNumberrequiredstringUdyam Registration Number (URN), format UDYAM-MH-12-1234567.

Response fields

Response fields
FieldTypeDescription
referenceIdstringStampMitra's own transaction id for this call (SMV-YYYYMMDD-XXXXXXX). Always present.
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.
foundbooleanWhether an active Udyam registration was found. Always present.
statusstringOutcome of the lookup: SUCCESS, UDYAM_NOT_FOUND or UDYAM_IS_CANCELLED.
udyamStatusstringSame value as status. Kept so existing integrations keep working.
udyamNumberstringThe Udyam registration number that was looked up.
enterpriseNamestringRegistered enterprise name.
organizationTypestringLegal form of the organisation, for example Proprietary.
majorActivitystringMajor activity: Manufacturing, Services or Trading.
socialCategorystringSocial category of the owner, for example General.
dateOfIncorporationstringDate of incorporation, ISO yyyy-mm-dd.
dateOfCommencementstringDate business commenced, ISO yyyy-mm-dd.
dateOfUdyamRegistrationstringDate the Udyam registration was issued, ISO yyyy-mm-dd.
enterpriseTypestringCurrent MSME classification: Micro, Small or Medium.
classificationYearstringFinancial year of the current classification, for example 2024-25.
classificationDatestringDate of the current classification, ISO yyyy-mm-dd.
certificateUrlstringURL of the Udyam registration certificate (PDF).
classificationHistoryarrayYear-by-year classification history, most recent first.
classificationHistory[].serialNumberstringPosition of the entry in the history.
classificationHistory[].classificationYearstringFinancial year of that classification.
classificationHistory[].enterpriseTypestringMicro, Small or Medium for that year.
classificationHistory[].classificationDatestringDate of that classification, ISO yyyy-mm-dd.
splitAddressobjectRegistered address of the enterprise, split into parts, with the registered contact details.
splitAddress.flatstringFlat / door / floor.
splitAddress.buildingstringBuilding or premises name / number.
splitAddress.villagestringVillage or town.
splitAddress.blockstringBlock.
splitAddress.streetstringStreet / road.
splitAddress.citystringCity.
splitAddress.districtstringDistrict.
splitAddress.statestringState.
splitAddress.pincodestringSix-digit PIN code.
splitAddress.mobilestringRegistered mobile number, already masked at source (for example 70*****210). Passed through as received, never unmasked.
splitAddress.emailstringRegistered email address.
unitLocationsarrayLocations of the enterprise units.
unitLocations[].serialNumberstringPosition of the unit in the list.
unitLocations[].unitNamestringName of the unit.
unitLocations[].flatstringFlat / door / floor.
unitLocations[].buildingstringBuilding or premises name / number.
unitLocations[].villagestringVillage or town.
unitLocations[].blockstringBlock.
unitLocations[].streetstringStreet / road.
unitLocations[].citystringCity.
unitLocations[].districtstringDistrict.
unitLocations[].statestringState.
unitLocations[].pincodestringSix-digit PIN code.
nicCodesarrayNIC activity codes the enterprise is registered under.
nicCodes[].serialNumberstringPosition of the activity in the list.
nicCodes[].nic2DigitstringNIC 2-digit division code.
nicCodes[].nic2DescriptionstringNIC 2-digit division description.
nicCodes[].nic4DigitstringNIC 4-digit class code.
nicCodes[].nic4DescriptionstringNIC 4-digit class description.
nicCodes[].nic5DigitstringNIC 5-digit sub-class code.
nicCodes[].nic5DescriptionstringNIC 5-digit sub-class description.
nicCodes[].activitystringActivity type: Manufacturing, Services or Trading.
nicCodes[].datestringDate the activity was added, ISO yyyy-mm-dd.
dicstringDistrict Industries Centre.
msmeDistringMSME Development Institute.

found tells you whether an active registration exists for the number. udyamStatus carries the registry's status string, enterpriseName is the name on the registration, enterpriseType and organizationType are two similar-sounding fields discussed below, and certificateUrl points at the certificate. status repeats the same value as udyamStatus, which stays for existing integrations. referenceId has the form SMV-YYYYMMDD-XXXXXXX and verificationId the form VRF-XXXXXXXXXXXX; both are our own ids, present even when found is false, and verificationId is generated fresh for every call. Store them and quote them to support. Neither is an idempotency key.

The response carries the whole registration record: the major activity and social category, the dates of incorporation, commencement and registration, the classification year and date with the full classificationHistory, the registered splitAddress (with the registered email and a mobile number that the registry has already masked, for example 70*****210, returned exactly as received), the unitLocations, the nicCodes the enterprise is registered under, and the dic and msmeDi offices. All dates are ISO yyyy-mm-dd strings. Treat every one of these as optional: a field the registry does not provide is omitted, not sent as null. The address and contact fields are personal data, so keep them out of logs and apply the same access limits as other vendor records.

found, not found and cancelled

Three situations produce a response, and your branching should cover each.

SituationWhat you receiveWhat it means
Active registrationfound: true, details, certificate linkThe vendor can be treated as registered
No registration under this numberfound: falseThe number does not exist on the register
Registration cancelledfound: falseThe number existed and is no longer in force

The status string distinguishes the second and third cases. In the registry's own vocabulary a successful lookup is SUCCESS, a missing one is UDYAM_NOT_FOUND and a cancelled one is UDYAM_IS_CANCELLED. The same value is in status and in udyamStatus. The honest summary is that the wording of the status is not something to compare against in code beyond these three values. Branch on found, and treat the status string as a label for people: show it in your review screen, log it, and never match on free-form wording such as Active.

The difference between not found and cancelled matters to a person, even though both give found: false. A vendor whose number is not found probably made a typing error or has no registration. A vendor whose registration was cancelled is a vendor that once had one, which opens a more specific conversation about why and whether a new registration exists. When you send either to review, include the status string so the reviewer can see which one it was.

Micro, small, medium: reading the size class, and a field mix-up to guard against

The size class of an enterprise comes from two measures, its investment in plant and machinery or equipment and its turnover, and the thresholds for micro, small and medium have been revised more than once. The numbers are published by the government, so we do not print them here; check the current notification when you need them. Two things follow. First, the class on a registration can change from year to year as the registry refreshes it from tax-department data linked through the enterprise's PAN and GSTIN, so a class you stored a year ago may be stale. Second, a class describes the enterprise, not a transaction: a micro enterprise can issue a large invoice.

The response has two fields that sound as if they could hold the class. The size class (Micro, Small or Medium) is in enterpriseType, and the legal form of the organisation, such as Proprietary, is in organizationType; the classificationYear, classificationDate and classificationHistory fields describe how that class has changed year by year. Earlier versions of this documentation listed the two the other way round, so if you built against that, check your code. A small normaliser that looks for the class in either field and records which field it came from still protects your payment clock from a mix-up, and costs nothing.

Python
CLASSES = {"micro": "micro", "small": "small", "medium": "medium"}

def size_class(response: dict):
    """Return (class, source_field) or (None, None). Looks in both candidate fields."""
    for field in ("enterpriseType", "organizationType"):
        value = str(response.get(field) or "").strip().lower()
        if value in CLASSES:
            return CLASSES[value], field
    return None, None

If neither field holds one of the three words, treat the class as unknown and send the vendor to review. An unknown class is better than a wrong one: a vendor wrongly treated as medium would escape the payment clock, and one wrongly treated as micro would trigger early payments that cost you working capital.

From the registry result to a payment-due date

Once you have a size class, the payment clock is arithmetic. The function below takes the acceptance date of a supply, the number of days agreed in writing (or nothing), and the vendor's class, and returns the date by which payment should be made to stay inside the period. It encodes the general rule described at the top of the page: where nothing was agreed the period is 15 days, an agreed period cannot be treated as longer than 45, and only micro and small suppliers are on the clock. Have your finance team check it against current rules before you rely on it.

JavaScript
const DAY = 24 * 60 * 60 * 1000;

export function msmePaymentDueDate({ acceptedOn, agreedDays, sizeClass }) {
  if (sizeClass !== "micro" && sizeClass !== "small") return null; // medium and unknown: not on this clock
  const period = agreedDays == null ? 15 : Math.min(Math.max(agreedDays, 0), 45);
  return new Date(new Date(acceptedOn).getTime() + period * DAY);
}

Store the class together with the date you obtained it and the referenceId. An auditor who asks why an invoice was paid on day 40 can then see that the vendor was a small enterprise on the date you checked and that your system worked from a documented rule.

Calling the API from Node.js, Python and cURL

The clients normalise the number, send an idempotency key, retry only the failures that can succeed on retry, and return the size class using the guard above.

JavaScript
// verify-udyam.mjs  (Node.js 18+); uses inspectUrn from above
import { randomUUID } from "node:crypto";
import { inspectUrn } from "./urn.mjs";

const BASE = "https://api-b2b.stampmitra.in";
const RETRYABLE = new Set([429, 502, 503, 504]);
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));

function sizeClass(json) {
  for (const field of ["enterpriseType", "organizationType"]) {
    const v = String(json[field] ?? "").trim().toLowerCase();
    if (["micro", "small", "medium"].includes(v)) return { sizeClass: v, sizeField: field };
  }
  return { sizeClass: null, sizeField: null };
}

export async function verifyUdyam(raw) {
  const local = inspectUrn(raw);
  if (!local.ok) return { outcome: "bad_input" };
  const key = randomUUID();

  for (let attempt = 1; attempt <= 4; attempt++) {
    let res;
    try {
      res = await fetch(`${BASE}/v1/verify/udyam`, {
        method: "POST",
        headers: { Authorization: `Bearer ${process.env.STAMPMITRA_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": key },
        body: JSON.stringify({ udyamNumber: local.urn }),
        signal: AbortSignal.timeout(20_000),
      });
    } catch {
      if (attempt === 4) return { outcome: "unavailable" };
      await sleep(2 ** attempt * 500 + Math.random() * 250);
      continue;
    }
    const json = await res.json().catch(() => ({}));
    if (res.ok) {
      return {
        outcome: json.found === true ? "registered" : "not_registered",
        referenceId: json.referenceId,
        registryStatus: json.udyamStatus, // a label for people, never compared in code
        enterpriseName: json.enterpriseName,
        certificateUrl: json.certificateUrl, // short-lived: download now, do not store the link
        ...sizeClass(json),
      };
    }
    if (RETRYABLE.has(res.status) && attempt < 4) {
      await sleep(2 ** attempt * 500 + Math.random() * 250);
      continue;
    }
    const err = json.error ?? {};
    return { outcome: res.status === 402 ? "wallet_empty" : "error", status: res.status, code: err.code, requestId: err.requestId };
  }
}
Python
# verify_udyam.py  (Python 3.9+, pip install requests)
import os, re, time, uuid, random, requests

BASE = "https://api-b2b.stampmitra.in"
RETRYABLE = {429, 502, 503, 504}

def normalise_urn(raw):
    compact = re.sub(r"[\s-]+", "", raw or "").upper()
    m = re.fullmatch(r"UDYAM([A-Z]{2})([0-9]{2})([0-9]{7})", compact)
    return f"UDYAM-{m[1]}-{m[2]}-{m[3]}" if m else None

def verify_udyam(raw):
    urn = normalise_urn(raw)
    if not urn:
        return {"outcome": "bad_input"}
    key = str(uuid.uuid4())

    for attempt in range(1, 5):
        try:
            r = requests.post(
                f"{BASE}/v1/verify/udyam",
                json={"udyamNumber": urn},
                headers={"Authorization": f"Bearer {os.environ['STAMPMITRA_API_KEY']}", "Idempotency-Key": key},
                timeout=20,
            )
        except requests.RequestException:
            if attempt == 4:
                return {"outcome": "unavailable"}
            time.sleep(2 ** attempt * 0.5 + random.random() * 0.25)
            continue
        body = r.json() if r.content else {}
        if r.ok:
            klass, field = size_class(body)  # from the helper above
            return {"outcome": "registered" if body.get("found") is True else "not_registered",
                    "referenceId": body.get("referenceId"), "registryStatus": body.get("udyamStatus"),
                    "enterpriseName": body.get("enterpriseName"), "sizeClass": klass, "sizeField": field}
        if r.status_code in RETRYABLE and attempt < 4:
            time.sleep(2 ** attempt * 0.5 + random.random() * 0.25)
            continue
        err = body.get("error", {})
        return {"outcome": "wallet_empty" if r.status_code == 402 else "error", "status": r.status_code,
                "code": err.get("code"), "requestId": err.get("requestId")}
cURL
curl -X POST "https://api-b2b.stampmitra.in/v1/verify/udyam" \
  -H "Authorization: Bearer $STAMPMITRA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"udyamNumber":"UDYAM-MH-12-1234567"}'

For typed wrappers, see the libraries on the SDKs page, and use the Postman collection to try a call by hand.

Running it in production: errors, retries, billing and limits

Errors come back in one shape, { "error": { "code", "message", "requestId" } }, and the examples below are rendered from the API data. Branch on the status and the code; keep requestId in your logs.

  • 400Validation errorBAD_REQUEST

    udyamNumber must match the format UDYAM-MH-12-1234567

  • 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

Think of the failures as three families. Input faults (400) mean the number failed the layout rule or the body carried a property the API does not know; a number that is well formed but absent from the register is not a fault, it is a 200 with found: false. Account faults (401, 402, 403) are about keys, scopes and wallet balance, and need a human, not a retry. Pressure and dependency faults (429, 502) are the ones to retry, with exponential backoff, jitter and a cap of a few attempts.

Idempotency deserves a sentence of its own because of the billing rule. A lookup that completes with an answer is charged, including found: false, and a lookup that fails is not. If a timeout swallows a successful response, a blind retry would be a second charged lookup. Send an Idempotency-Key, keep it across the retries of one request and use a new one for the next vendor: the retry is then answered from the stored response with no second lookup or debit. Reusing a key for a different Udyam number is refused with a 422 IDEMPOTENCY_KEY_REUSED.

The price on pay-as-you-go is ₹5 per answered call before GST, with lower rates on Growth and Scale (see pricing); sandbox is free. Throughput is set by your plan: one per-minute allowance shared by every key and route in the environment, at the time of writing 60, 300 or 1,000 requests on pay-as-you-go, Growth and Scale, and 10 in sandbox (plus 200 a day per organisation). If you are checking a whole vendor base, spread the job and let it run at a fraction of the allowance so that live traffic keeps working. Keys beyond the first add nothing to the allowance, and the acceptable use policy prohibits rotating them to dodge limits. Everything you call is visible in the request logs of your dashboard for the period your plan retains them.

Sandbox and what it cannot test

The sandbox uses the same request and the same URL as production; only the key prefix differs (sk_test_ against sk_live_). Its answers come from a deterministic stand-in, not from the register. UDYAM-SB-00-0000001 always returns found: true with a synthetic enterprise name, and UDYAM-SB-00-9999999 always returns found: false. Every other well-formed number gets a stable arbitrary answer, about two in three found, and the same number always gives the same answer.

What this lets you test is your two main branches and your parsing. What it cannot test is a cancelled registration, or a real name. The sandbox success body is the full documented example, including the classification history, address, unit locations, NIC codes and a certificate link, so you can build and test your parsing of every field against it. Cover a cancelled registration and other size classes with fixtures you write yourself, shaped like the documented example. Also remember the sandbox is deliberately small: 10 requests a minute and 200 a day per organisation (the day resets at midnight IST), after which the API returns a 429, so it is for proving an integration and not for load tests. The readiness runner in your dashboard exercises scripted scenarios without using up those limits. When you are ready, apply for production access in the dashboard (it is reviewed), fund the wallet, create a production key with the scopes you need and release behind a flag. The guide on sandbox versus production keys has more.

When the vendor gives you a PAN and not a number

Vendors who say "we are an MSME" often cannot find their registration number. If you hold the vendor's PAN, you do not have to wait: the PAN to Udyam API looks up the registration linked to a PAN and returns the number, which you can then verify here for the size class, the name and the certificate. That is two calls for one vendor, and the second is only needed when the first finds something. If the PAN lookup comes back with nothing, ask the vendor for the certificate and verify the number on it.

Start from a verified PAN when you can. The fourth letter tells you whether you are dealing with an individual (a proprietor, whose personal PAN is used for the registration), a firm or a company, and a mismatch between that and what the vendor told you is worth catching before any paid call. The broader multi-registry design is in the guide on business verification with GSTIN, CIN and Udyam.

A worked scenario: classifying a vendor base before the quarter closes

Take an invented manufacturer, Sahyadri Components, with about 1,800 active suppliers and a finance controller who has been told that late payments to small suppliers will affect how an expense is treated. Nobody knows which suppliers are registered. The vendor master has a free-text field called "MSME" that was filled in by whoever created the record.

The first pass is a data-quality exercise with no paid calls. A script reads the field, runs normaliseUrn on whatever looks like a number, and sorts vendors into three groups: those with a well-formed number, those with something that is not a number (the words "yes", a date, a GSTIN) and those with nothing. About a third of the base lands in the first group. For the second group the team writes to the vendors asking for their certificate; for the third it assumes nothing.

The second pass is the paid one. The job calls the API for every well-formed number, at roughly a third of the plan's per-minute allowance, overnight, with an idempotency key built from the vendor id and the month so that a crash and restart does not charge twice. Each result is written to a staging table: the vendor id, referenceId, found, the status label, the size class and the field it came from, and the date. A vendor with found: true and a class of micro or small goes on the payment clock. One with found: true and a class of medium goes to the normal terms. One with found: false goes to a review queue with the status label, because a cancelled registration and a mistyped number are very different conversations. One with a found registration and an unknown class goes to review as well.

For the vendors without a number but with a PAN, a third pass uses the PAN lookup to find a registration, and a verified registration then goes through the same staging flow. The team does not try to infer anything for vendors with neither.

The controller ends up with two lists: vendors on the clock, with a computed due date for each open invoice, and vendors in review, with a named owner. A report counts both. The key design decision is that nothing here changes a payment automatically. The system computes dates and raises exceptions; people decide what to do about a cancelled registration or a vendor who insists they are micro but whose registration says otherwise.

Monitoring and audit logging

Because this check feeds a financial rule, treat it as a controlled process. Write every outcome, not only the successes, to an audit table with the vendor id, the referenceId, the date, the outcome and the rule version in force. When the rule changes (a new threshold, a different treatment of unknown class), bump the version so that you can reconstruct why a payment was timed a certain way.

Watch four numbers. The share of lookups that return found: false, which tells you about the quality of the numbers vendors give you. The share of found registrations with an unknown class, which tells you whether the response shape has drifted from what your normaliser expects. The count of vendors whose class changed since the last check, which is a business event for finance. And your error rates by status: a rise in 402 means the wallet needs attention, a rise in 429 means a job is running too fast, a rise in 502 means the dependency is struggling and your retries are doing their work. The referenceId of any call you want to discuss with support is in your logs, and the dashboard's request log shows the same calls.

Moving from another MSME verification provider

If you already consume Udyam data from somewhere else, start the migration with a mapping. List the fields your payables logic reads (probably the number, the status, the name and the class) and map each to the fields above. Pay particular attention to the class: another provider may return it in a single clearly named field, whereas here you read it with the normaliser. Replace status comparisons with the found flag. Then run old and new side by side on the same sample of vendors for a few days and look at each disagreement. Most will be timing, because the registry refreshes classification, or wording. Write down your decisions about the rest, and if a disagreement looks like a data problem, send the referenceId to support.

Edge cases that trip up integrations

  • Legacy numbers. Udyog Aadhaar numbers have a different layout and fail the format check. Ask for the Udyam number.
  • Multiple activities. One enterprise has one registration, even if it carries on several activities. Do not expect one number per activity.
  • Class changes. The class is refreshed over time. Re-check before you rely on a class that is more than a year old.
  • Name mismatch. The enterprise name on the registration can differ from the invoice header, the GST legal name and the PAN name. Show them side by side to a reviewer.
  • Group companies. Two companies in the same group are separate enterprises with separate registrations; the size class of one says nothing about the other.
  • Found but you disagree. The registry is the registry. If the vendor insists the data is wrong, they correct it with the registry, not with you.
  • Cancelled and re-registered. A vendor can have a cancelled number and a new one. Ask for the current number.
  • Expired certificate link. Download the document when you receive it, not later.
  • Unknown class. If neither classification field holds micro, small or medium, send the vendor to review instead of defaulting.

Mistakes we see

The most frequent mistake is comparing udyamStatus to a string and treating everything else as not registered; use found. Second is hard-coding which field holds the class, which breaks silently if the arrangement differs from what you saw in one example. Third is storing the certificate URL instead of the file. Fourth is treating a class as permanent. Fifth is running the check once at onboarding and never again for vendors whose payments depend on it. Sixth is validating without normalising, which sends lowercase or unhyphenated numbers to the API and produces a stream of avoidable 400s. Seventh is surfacing raw errors to vendors; map 400 to "please check the number on your certificate" and the rest to a neutral message while your team investigates.

A simple cost model

Volume for this endpoint is easy to estimate: one lookup per vendor you need to classify, plus a re-check per vendor per cycle where the class affects payments. At the per-call rate on the pricing page, plus 18% GST, that gives the monthly figure. The two ways to lower it are to skip vendors that cannot be on the clock (for example large listed companies that you already know are not micro or small) and to re-check by trigger, for instance at the first payment after a year, instead of on a fixed calendar for the whole base. If you start from PAN, add the lookup call for vendors without a number, and count it only for the vendors who need it.

Data handling in general terms

A Udyam registration ties a business to a proprietor or partners and carries contact details. Collect the number for a stated purpose such as payment classification, tell vendors what you check, keep a record of that notice and use the result only for that purpose. Do not run lookups on enterprises you have no relationship with, and do not use the API to build lists of MSMEs; the acceptable use policy prohibits enumeration. Keep a compact audit row (your vendor id, referenceId, the registry status label, the class and which field it came from, the date) and keep names, addresses and the certificate file under the access controls you use for other vendor documents.

India's Digital Personal Data Protection Act, 2023 is being brought into force in phases and applies to personal data in this flow. This page is general information and not legal or tax advice; confirm your obligations with qualified counsel and your payment-period obligations with your tax adviser. The developer privacy policy and the data processing addendum describe how responsibilities are divided with StampMitra.

Sources and what to confirm

  • StampMitra Udyam verification reference, API docs: endpoint, scope, parameters, response and error examples, checked against the product data in 2026.
  • StampMitra pricing and authentication pages: per-call rates, plan limits, key model and environments, read in 2026.
  • Ministry of Micro, Small and Medium Enterprises and the Udyam registration portal: the registration number layout and the classification approach. Confirm the current investment and turnover thresholds from the latest notification before you quote them.
  • Micro, Small and Medium Enterprises Development Act, 2006, and Section 43B(h) of the Income Tax Act, 1961: the payment-period rules summarised above. They change; confirm the current text and how it applies to you with your tax adviser.

Sandbox test values

Send one of these values as udyamNumber 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. 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 Udyam registration
UDYAM-SB-00-0000001
200
200 with found true, status SUCCESS and the full registration.
Udyam number not found
UDYAM-SB-00-0000002
200
200 with found false and status UDYAM_NOT_FOUND.
Registration cancelled
UDYAM-SB-00-0000004
200
200 with status and udyamStatus UDYAM_IS_CANCELLED.
Verification source times out
UDYAM-SB-00-0000005
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
UDYAM-SB-00-0000006
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
UDYAM-SB-00-0000007
429TOO_MANY_REQUESTS
Too many requests. Back off and retry with exponential delay and jitter.
Wallet balance too low
UDYAM-SB-00-0000008
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
UDYAM-SB-00-000000
400BAD_REQUEST
Validation error that names the field. Nothing is looked up and nothing is charged.

Frequently asked questions

What does an Udyam Registration Number look like?

It is UDYAM, a two-letter state code, a two-digit district code and a seven-digit serial, joined by hyphens, for example UDYAM-MH-12-1234567. The API accepts only that layout in uppercase, so normalise spaces, case and missing hyphens before calling.

Why does found false cover both not found and cancelled?

The response reduces the registry outcome to a found flag, which is true only for an active registration. The status string, which is SUCCESS, UDYAM_NOT_FOUND or UDYAM_IS_CANCELLED in registry terms, tells a reviewer which case it was, but your code should branch on found.

Where do I find the micro, small or medium class in the response?

The class (micro, small or medium) is in enterpriseType, and the legal form such as Proprietary is in organizationType; classificationHistory lists the class for earlier years. If the class is missing, treat it as unknown and send the vendor to review instead of guessing.

Can I store the certificateUrl?

You can, but it will stop working. The link can be a pre-signed address that expires after about a day. Download the certificate when you receive the response and keep the file under your own retention rules, since it contains contact details.

Why do buyers check Udyam registration at all?

Because payments to micro and small suppliers run on a shorter clock than other payments, and buyers need to know which suppliers are registered and what class they are in. The rules change, so confirm how they apply to you with your tax adviser.

How accurate is the size class over time?

The class is refreshed from tax-department data linked through PAN and GSTIN, so it can change from year to year. Store the date you checked and the reference id, and re-check before relying on a class that is more than a year old.

What if a vendor only has an old Udyog Aadhaar number?

The format check rejects it with a 400, because the layout is different. Ask the vendor for their current Udyam number, or if they only have a PAN use the PAN to Udyam lookup to find the registration linked to it.

Am I charged when the registration is not found?

Yes. A call that completes with an answer is billed, and found false is an answer. Calls that fail with a 400, 429 or 502 are not billed, and sandbox calls are never billed. Normalise and validate the number locally first.

Which numbers work in the sandbox?

UDYAM-SB-00-0000001 always returns found true with a synthetic enterprise name, and UDYAM-SB-00-9999999 always returns found false. Other well-formed numbers get a stable arbitrary result, about two in three found. The sandbox success body is the full documented example; it cannot test cancelled registrations.

What are the rate limits for Udyam verification?

The limit is per plan, shared by all keys and routes in an environment, counted per minute. At the time of writing it is 60 on pay-as-you-go, 300 on Growth and 1,000 on Scale, with 10 for a sandbox key, plus 200 requests a day per organisation. The pricing page lists current figures.

How do I retry safely after a timeout?

Send an Idempotency-Key header and reuse the same key on the retry, so the API replays the stored response without a second lookup or debit. Reusing a key with a different Udyam number is refused with a 422 IDEMPOTENCY_KEY_REUSED.

Does one Udyam number exist per activity?

No. An enterprise has a single registration even when it carries on several activities, so do not expect a number per activity. Two companies in one group are separate enterprises with their own registrations and their own size classes.

Build with AI

Integrate Udyam Registration 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 · Udyam Registration · 8,831 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 "Udyam Registration" API
Verify a Udyam Registration in real time.
Production service code: udyam.verify

ENDPOINT: POST /v1/verify/udyam
- Verify Udyam Registration
- Required scope: verification.udyam.read
- Parameters:
  - udyamNumber (string, required): Udyam Registration Number (URN), format UDYAM-MH-12-1234567.
- Example request body: {"udyamNumber":"UDYAM-UP-43-1234567"}
- Response fields: referenceId, verificationId, found, status, udyamStatus, udyamNumber, enterpriseName, organizationType, majorActivity, socialCategory, dateOfIncorporation, dateOfCommencement, dateOfUdyamRegistration, enterpriseType, classificationYear, classificationDate, certificateUrl, classificationHistory, splitAddress, unitLocations, nicCodes, dic, msmeDi
- Example response: {"referenceId":"SMV-20260927-5U29V7","verificationId":"VRF-7K3M9Q2XH4TB","found":true,"status":"SUCCESS","udyamStatus":"SUCCESS","udyamNumber":"UDYAM-UP-43-1234567","enterpriseName":"helloscholar","organizationType":"Proprietary","majorActivity":"Services","socialCategory":"General","dateOfIncorporation":"2020-05-29","dateOfCommencement":"2020-05-29","dateOfUdyamRegistration":"2022-01-02","enterpriseType":"Micro","classificationYear":"2024-25","classificationDate":"2025-06-02","certificateUrl":"https://udyamregistration.gov.in/Udyam_Download/UDYAM-UP-43-1234567.pdf","classificationHistory":[{"serialNumber":"1","classificationYear":"2024-25","enterpriseType":"Micro","classificationDate":"2025-06-02"},{"serialNumber":"2","classificationYear":"2023-24","enterpriseType":"Micro","classificationDate":"2023-05-09"},{"serialNumber":"3","classificationYear":"2022-23","enterpriseType":"Micro","classificationDate":"2022-06-26"}],"splitAddress":{"flat":"Ground Floor","building":"05 Raman Vihar","village":"Naubasta","block":"Naubasta","street":"Naubasta","city":"Kanpur","district":"KANPUR NAGAR","state":"UTTAR PRADESH","pincode":"208021","mobile":"70*****210","email":"[email protected]"},"unitLocations":[{"serialNumber":"1","unitName":"hellobanker","flat":"Ground Floor","building":"05 Raman Vihar Naubasta","village":"KANPUR NAGAR","block":"KANPUR NAGAR","street":"05 Raman Vihar Naubasta Bamba","city":"Kanpur","district":"KANPUR NAGAR","state":"UTTAR PRADESH","pincode":"208021"},{"serialNumber":"2","unitName":"helloscholar","flat":"Ground Floor","building":"05 Raman Vihar Naubasta","village":"Kanpur","block":"Kanpur","street":"Kanpur","city":"Kanpur","district":"KANPUR NAGAR","state":"UTTAR PRADESH","pincode":"208021"}],"nicCodes":[{"serialNumber":"1","nic2Digit":"85","nic2Description":"Education","nic4Digit":"8550","nic4Description":"Educational support services","nic5Digit":"85500","nic5Description":"Educational support services","activity":"Services","date":"2022-01-02"}],"dic":"KANPUR NAGAR","msmeDi":"KANPUR"}
- 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 found is optional and is omitted when the registry does not provide it. Dates are ISO yyyy-mm-dd strings. The registered mobile number is masked at source (for example 70*****210) and is returned exactly as received. status and udyamStatus carry the same value; udyamStatus is kept for existing integrations.

Rules for this verification
- Validate udyamNumber 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.