E-Invoice Authentication

21522152

Overview

The API authenticates the user for using E-Invoice APIs.

Endpoint

HTTP MethodResource
POST

API EndpointAPI Endpoint

Request

Body

ParamTypeDescriptionExample
UserNamestringUsername of Tax payer as created on E-Invoice portal for API Integrationtestuser
PasswordstringPassword of Tax payer as in E-Invoice portal for API IntegrationPassword in plain text
AppKeystringAny random 32 bytes array, generated by user. On converting to String using base 64 encoding will be 44 chars long.Randomly generated key
ForceRefreshAccessTokenBooleanThe value of this attribute to be set true, if client needs to refresh the token 10 minutes before expirytrue

Once the values are added, Your curl will look something like this

curl --request POST \
     --url https://api.sandbox.co.in/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'x-api-version: 1.0' \
     --data '
{
     "UserName": "testuser",
     "Password": "<Password in plain text >",
     "AppKey": "<Randomly generated key>",
     "ForceRefreshAccessToken": true
}
'

🚧

Test Data Not Available

Instead, input valid credentials along with key_live to use the API.

Response

ParamTypeDescriptionExample
StatusnumStatus of the authentication request
(values 1-Success
and 0- Failure)
1
ClientIdstringClient Idtestclientid
UserNamestringUser Nametestuser
AuthTokenstringAuthorization token5GGo3hKqPSvbHwRImTjIxeMKQ
SekstringSession Encryption Key generated using AES 256(AES/ECB/PKCS7Padding) algorithm. Encrypted () with AppKeyEmLpFzYohZLstcXCSX9C9XIHVLb+QcsjMO1mk+qAjW8hyXmEBQnCAYsmbluFFu+Z
TokenExpirystringToken Expiry time.
Date format is β€˜yyyy-MM-dd HH:mm:ss ’
2019-11-30 14:18:00