GSTIN token refers to the secure authentication token that the GST Network issues via API when the taxpayer logs into the GST system to fetch GST data. The GST system includes the GST portal, e-invoicing system, and e-way bill portal. The token authenticates the taxpayer/user after logging in and is used to make authorised API requests to retrieve and validate GSTIN details or perform GST-related functions.
Credentials like client-ID and client-secret (password) are both used for secure access. The GSTIN token allows only authorised access to sensitive GST data by confirming the legitimacy of the requester.
This article explains about GSTIN token, GSTIN token refresh, why it expires every 6 hours, and how token refresh alerts work, role of GSP/ASP, how to avoid frequent OTP prompts, and manage GSTIN token expiry with best practices.
Every GSTIN token has a validity of six hours. GSTIN token refresh means renewing or extending the validity of an existing GSTIN token authentication for GST-related API systems (GST portal, e-invoicing or e-way bill).
The process enables uninterrupted access to GST APIs by not re-authenticating from scratch. However, the GSTIN token refresh must happen before it expires to obtain the new GSTIN token. The GSTIN token refresh also helps avoid transaction failures. It does not require re-entry of credentials or OTP.
Some systems provide a feature called ‘Force refresh access token’ that enables generation of a new token 10 minutes before expiry of current token for ensuring continuous access.
You receive the GSTIN token refresh alerts via emails or SMS from donotreply@gst.gov.in saying "Authentication token refreshed for your GSTIN". It is because the authentication token is only valid for six hours. The alert helps the user to renew the GSTIN token before it expires, allowing you not to go through transaction failure, which is critical during compliance. Where the user is already using ASP-GSP, it just means the GSTIN token was auto-renewed to keep your IRP access running smoothly.
Suppose the user wants to reduce inbox clutter & SMS alerts, they can simply create an email filter with:
Subject: "Authentication token" From: donotreply@gst.gov.in
This will send all token refresh emails into a separate folder, keeping their main inbox clean, while still receiving other essential messages from the GSTN.
When the user first authenticates with the GST system, a GSTIN access token is issued. This token allows users to make API requests for GST compliance functions. As the token nears expiry (often 10 minutes before), the user receives an alert to refresh the token.
The alert is to avoid service disruption. After the expiry, it cannot be used for further API requests. The user can use a "Force Refresh Access Token" function to generate a new token proactively before the old one expires. There is no need to generate a new token for every transaction. One can use the existing token until it expires, then refresh as needed.
GST Suvidha Providers (GSP) enable smooth indirect access to services on the GST portals. On the other hand, GST Application Service Providers (ASP) are software/cloud solution providers that act as intermediaries between the GSP and taxpayer users to interact with the GST portals. They often enable users with SAAS-based or tech functionalities to easily prepare and file their GST returns, or generate e-invoices or e-way bills in bulk. There is a clear division of roles between GSP and ASP. While GSP handles the token refresh mechanics, ASPs render value-added services to the taxpayers.
When it comes to the GSTIN token refresh task, there are certain aspects in GSTIN token refresh that both GSP and ASP manage, such as the token access, security, delegation and monitoring. These are summarised in the table below-
Role | GSP Responsibilities | ASP Responsibilities |
Token Access | Securely connect to GST Network and manage GSTIN token lifecycle | Request GSTIN token refresh via GSP |
Security | Store and manage GSTIN credentials while enforcing compliance | Handle user data, interface, and workflows |
Delegation | Provide sub-licenses to ASPs | Use GSP-provided credentials for API calls |
Monitoring | Track expiry and automate GSTIN token refresh | Monitor session status and alert users |
The GSTIN token or the GSTIN authentication token has a validity of six hours from the time it is generated. This means:
One can use the "ForceRefreshAccessToken" parameter to generate a new token about ten minutes before expiry for seamless operations.
An ASP/GSP must refresh the GSTIN token for its users within six hours. If not refreshed, users will need to enter the OTP manually repeatedly. GSTIN token refreshing helps users do this manual OTP entry only once every 30 days. Users can use session-based authentication, where they can authenticate via an ASP/GSP.
A session is established between the ASP application and the GST system through the GSP. As long as this session is active, the ASP/GSP can refresh the GSTIN token programmatically without prompting the user for OTP each time.
The user gets impacted by the GSTIN token refresh every 6 hours. They could be logged out of the GST portal, affecting filings and API usage experience, as follows-
If the GSTIN token is not refreshed, API calls fail with "Invalid Token" errors, disrupting GST compliance.
Frequent token expiry can lead to repeated OTP prompts and login interruptions.
There are some best practices for managing GSTIN tokens efficiently without GST compliance disruption. These are listed below-
Issue | Reason | Resolution |
Token Expiry | Token used after a six-hour validity | Call the Auth API again to generate a new token before using GST APIs. |
Incorrect GSTIN/User ID/Token | Wrong GSTIN, User ID, or token passed in API request headers | Pass the correct GSTIN, User ID, and Auth Token in all API requests except the Auth API. |
Inactive or Cancelled GSTIN | GSTIN is inactive, cancelled, or not enabled for e-invoicing | Verify GSTIN status on the GST portal, and allow it for e-invoicing if required. |
Invalid Client ID/Client Secret | The Client ID or Client Secret in the request header is wrong | Use the correct Client ID and Client Secret. |
Payload/Encryption Error | Wrong formation of the request payload or encryption error | Prepare payload as per API documentation; use the correct public key for encryption. |
Inactive User or User Not Enabled | User status is inactive or not enabled for e-invoicing | Verify user status and enable necessary services on the GST portal. |
Invalid GSTIN for User | GSTIN in the header differs from the GSTIN used for token generation | Send the correct GSTIN in the header for APIs other than the Auth API. |
Server/Network Issues | GSTN/NIC server downtime or connectivity issues | Wait and retry after some time; check for scheduled maintenance. |
GSTIN Data Not Synced | GSTIN details not updated between GSTN and the e-invoice system | Use the "Sync GSTIN details from Common Portal" API to update GSTIN data. |
PIN Code-State Code Mismatch | The PIN code does not belong to the state provided | Provide the correct PIN code and state code combination. |
Invalid Login Credentials | Wrong User ID or Password | Pass the correct User ID and Password; use "Forgot Password" if needed. |
Decryption of App Key/Password Failed | The wrong encryption key was used | Use the correct public key for encryption as provided by the portal. |