Validate the format first
An Indian PIN should be handled as a six-digit string. Do not store it as a number if doing so could remove leading zeros in another postal system or cause formatting problems.
^[0-9]{6}$Then validate existence
A six-digit format check only confirms syntax. A lookup against the current postal dataset confirms whether the PIN is represented in the data your application uses.
Handle not found cleanly
If the lookup returns 404, show a clear message and allow the user to correct the PIN. Do not repeatedly retry the same invalid PIN.