Skip to content

GSTIN and PAN validation

Villva validates GSTIN and PAN as you type them, so a malformed tax identifier is caught before it can break an invoice, e-invoice (IRN), e-way bill or GST return.

A GSTIN is 15 characters: a 2-digit state code, a 10-character PAN, an entity digit, the letter Z, and a final check digit. Villva checks all of the following:

  • The full 15-character structure
  • A valid 2-digit state code
  • The PAN embedded inside the GSTIN
  • The final check digit (worked out with the official calculation, not just the length)

Examples:

InputResult
33ABCDE1234F1Z5Accepted
33ABCDE1234F1Z9Rejected, bad check digit
99ABCDE1234F1Z5Rejected, invalid state code
33ABCDE1234F1ZRejected, wrong length
33abcde1234f1z5Rejected, wrong case/format

A PAN follows the pattern of 5 letters, then 4 digits, then 1 letter. ABCDE1234F is accepted; ABCD1234FG is rejected because it does not match that pattern.

The state code embedded in a GSTIN identifies the supplier or buyer state. Villva reads that state code and uses it to decide the place of supply, which in turn decides how tax is applied:

  • Same state (intra-state): tax is split as CGST + SGST.
  • Different states (inter-state): tax is charged as IGST.

So a correct GSTIN is not just a formatting nicety: it directly drives whether an invoice carries CGST + SGST or IGST.

  • Validation runs as you type and is then checked again authoritatively when you save. The check when you save is the one that counts, so skipping past the on-screen warning does not let a bad identifier through.
  • An invalid GSTIN or PAN is rejected with a specific message and blocks the record from being used to generate an IRN, generate an e-way bill, or file a GST return until you correct it.
  • Customer and vendor masters store the GSTIN that this validation checks, so the place-of-supply decision on every document raised for that party stays correct.