Validate a GSTIN's structure and check digit
validate_gstinValidates a 15-character Indian GSTIN against structural rules and mod-36 checksum, returning state code, embedded PAN, and clear failure reasons. Confirms well-formedness, not registration status.
Instructions
Check one GSTIN (the 15-character Indian GST registration number) against its structural rules and its mod-36 check character, without touching any document.
Returns is_valid, structural_ok, checksum_ok, the state code and its name, the embedded PAN, and a human-readable reason when it fails. checksum_ok is null, not false, when the structure itself failed: the checksum was never evaluated, and reporting two failures where one check ran would be misleading.
State code 25 resolves to a distinct 'discontinued' status rather than 'unknown', because a 25 means either a misread or a genuine pre-2020 record, and the caller needs to tell those apart. State code 28 is legacy-but-valid: pre-2014 Andhra Pradesh registrations remain legitimate.
IMPORTANT: a passing checksum proves the number is well-formed, NOT that the registration exists or is currently active. Only the GST portal can tell you that.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gstin | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||