Technical guide 8 min read

GST Verification API Error Codes: A Troubleshooting Guide

Common GST API error codes explained — invalid GSTIN, unauthorised, rate limited, timeout — with a fix for each.

Written and reviewed by the GSTIN API team Last reviewed

Every error a GST verification API can return falls into one of three buckets: something wrong with your request (4xx), something wrong on the server or upstream (5xx), or a perfectly valid request whose answer happens to be "this GSTIN doesn't exist." Mixing up the third case with an actual error is the single most common bug in GST API integrations, and this guide is built around getting that distinction right.

HTTP status codes, cause and fix

Start with the HTTP layer. This is the transport-level signal your HTTP client sees before your code ever looks at the response body:

StatusTypical causeFix
400 Bad RequestGSTIN missing or malformed — wrong length, invalid characters, bad checksumValidate the GSTIN format client-side before calling; see the checksum rules in our GSTIN format guide
401 UnauthorizedX-API-Key header missing, mistyped, or revokedCheck the key value and header name exactly; regenerate the key from your dashboard if needed
402 Payment RequiredAccount has exhausted its verification creditsTop up or upgrade on your pricing plan; this is not a retryable error
403 ForbiddenKey is valid but not permitted for this route, or IP/domain restrictions are set and not matchedCheck key scopes and any configured allow-list in account settings
404 Not FoundWrong URL path — not the same as a GSTIN that doesn't exist (see below)Confirm the endpoint path exactly matches /api/get-taxpayer-info/{gstin}
422 Unprocessable EntityRequest is syntactically fine but semantically invalid — e.g. an unsupported query parameterCheck the request against current API documentation
429 Too Many RequestsRate limit exceeded for your planRespect Retry-After; back off with jitter — see our rate limits and webhooks guide
500 Internal Server ErrorUnexpected failure on the API sideRetry with backoff after a short delay; contact support if it persists
502 Bad GatewayA problem between the API and its upstream (often GSTN-side)Retry with backoff; treat as transient
504 Gateway TimeoutUpstream lookup took too long to respondRetry once with backoff; if consistent, the upstream government system may be under load
Status codes returned by GET /api/get-taxpayer-info/{gstin}.

A "does not exist" GSTIN is not a transport error

This is the distinction that trips up the most integrations, so it is worth stating plainly: a well-formed GSTIN that has never been issued, or that no longer exists, is a successful API call with a not-found result — it is not the same thing as a 404, a 500, or any other transport-level failure. The HTTP request succeeded. The API did exactly what it was asked to do: it queried the live record and reported back that none exists for that number. Code that treats this outcome as an exception to catch, log, and alert on will generate constant false-positive noise, because "this GSTIN doesn't exist" is an entirely normal, expected answer — it happens every time someone mistypes a digit or tries to verify a number that was never real in the first place.

Upstream GSTN errors: SWEB_9035 and friends

Underneath the API's own response shape sits the government's own GSTN system, which has its own family of internal error codes. The one you will see most often is SWEB_9035 — "Invalid GSTIN / UID", which is GSTN's own way of reporting exactly the not-found case described above: the number is structurally valid but does not correspond to any taxpayer on record. When this code surfaces, it confirms the lookup reached the government system and got a definitive "no match" answer, rather than failing somewhere in between.

Other upstream error families exist for GSTN-side maintenance windows, temporary unavailability, and malformed queries, but SWEB_9035 is the one worth knowing by name because it is the one you will encounter routinely in normal usage — every time a customer, vendor, or user submits a GSTIN that turns out to be fake or mistyped.

Why a failed validation does not cost you a credit

It matters, practically, where in the pipeline a request fails. A request rejected for basic validation reasons — a malformed GSTIN that fails the checksum before it is even sent upstream, a missing or invalid API key, a request to the wrong path — never reaches a real lookup against GSTN records, and this API does not charge a verification credit for it. You are only billed for a completed lookup: one where the API actually queried the record and returned a result, whether that result is an active taxpayer, a cancelled registration, or a genuine not-found. This is a meaningful distinction if you are validating user-entered GSTINs at scale — client-side format checks (using the checksum described in our GSTIN format guide) filter out typos for free, before they ever touch your credit balance.

A sane error-handling pattern

Putting it together, a reasonable client-side handler treats HTTP status, the response body's own status field, and retryability as three separate questions:

async function verifyGstin(gstin) {
  const res = await fetch(`https://gstinapi.com/api/get-taxpayer-info/${gstin}`, {
    headers: { 'X-API-Key': process.env.GSTINAPI_KEY },
  });

  if (res.status === 401 || res.status === 403) {
    throw new Error('Check your API key and account permissions.');
  }

  if (res.status === 402) {
    throw new Error('Out of verification credits — upgrade your plan.');
  }

  if (res.status === 429) {
    const retryAfter = Number(res.headers.get('Retry-After')) || 5;
    await sleep(retryAfter * 1000);
    return verifyGstin(gstin); // retry once, respecting the server's timing
  }

  if (res.status >= 500) {
    throw new RetryableError('Upstream/API error — safe to retry with backoff.');
  }

  if (res.status === 400 || res.status === 422) {
    throw new Error('GSTIN is malformed — check format before calling.');
  }

  const data = await res.json();

  if (data.status === 'not_found') {
    // Not an error: a successful call, no matching taxpayer.
    return { exists: false };
  }

  return { exists: true, ...data };
}

Notice that the "not found" branch sits after a successful HTTP response, not inside the error handling at all — that placement is the whole point. For the retry logic itself, including how long to wait and how to add jitter, see our detailed rate limits, retries and webhooks guide.

Frequently asked questions

It means the request reached the API correctly but the specific resource path was wrong — typically a malformed URL rather than the endpoint itself. A GSTIN that is well-formed but not registered is returned as a not-found result inside a successful response shape, not as a bare 404, so check the response body's status field, not just the HTTP code.
SWEB_9035 ("Invalid GSTIN / UID") is an error code from the upstream GSTN system itself, returned when a GSTIN is correctly formatted but does not correspond to any registered taxpayer. It is the GSTN's own way of saying "this number does not exist" — it is not a bug in your integration or in the verification API.
No. A lookup that fails basic validation — malformed GSTIN, bad API key, missing header — is rejected before it reaches a billable lookup and does not consume a credit. A completed lookup that returns a genuine not-found result from GSTN is still a successful, billable API call, because the API did its job: it queried the record and told you it does not exist.
A 429 means slow down — respect Retry-After and back off; retrying immediately makes it worse. A 500 or 502 means something failed on the server side and a short retry with backoff is usually safe, since GET requests to this endpoint are idempotent. A 400 or 422 means the request itself is wrong and retrying without changing anything will just fail again.
It is a successful API call with a not-found result. The HTTP layer succeeded, the API did the work of checking, and the answer is "no record exists for this GSTIN." Treating it as a transport-level error in your code is a common integration mistake — handle it as a normal, expected business outcome instead.

A note on accuracy. GST rules change often. This article reflects our understanding as of 30 August 2026 and is general information, not tax or legal advice. For the authoritative position, check gst.gov.in and cbic-gst.gov.in, or speak to a qualified tax professional about your specific situation.

Check a GSTIN right now, free

Five lookups a day, no account required. Status, filing history, e-invoicing and jurisdiction.

Free GST search tool

Build it into your product

One REST call, JSON back. Get an API key and 20 free verification credits in under a minute.

Start free