Authentication

To access the API, application should first authenticate using the credentials. The credentials have to be generated by the taxpayers and get the auth token issued. Same auth token is to be used to access subsequent APIs. Validity of the auth token will be 360 minutes (60 minutes on Sandbox for ease of testing). Any hits to this API within these 360 minutes will return the same token, hence there is no need to hit the API unless the token has expired. However, there is a provision to forcefully generate a new token within the last 10 minutes of expiry by calling this API with "ForceRefreshAccessToken" set to "True". On expiry, same authentication API needs to be invoked to issue new auth Token.

Validations

  • Only taxpayer GSTINs enabled for e-invoicing are allowed for authentication.

Important Links

Run in Postman

Body Params

JSON corresponding to the "Data" element below

AttributesDescription
UserNameUsername of Tax payer as created on E-Invoice portal for API Integration
PasswordPassword of Tax payer as in E-Invoice portal for API Integration
AppKeyAny random 32 bytes array, generated by user. On converting to String using base 64 encoding will be 44 chars long.
ForceRefreshAccessTokenThe value of this attribute to be set true, if client needs to refresh the token 10 minutes before expiry

string
required

Json containing the Credentials is encoded using Base64 and then encrypted using e-Invoice public Key

Headers
string
required

GSTIN of the authenticated user

Responses

405

Method not allowed

500

Internal Server Error

Language
Credentials
Bearer
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json