Skip to main content

Login

To successfully authenticate, a user must have a valid Firstock Trading Account and an active subscription to Firstock API Services. Login APIs facilitate the authentication process.

Upon a successful login, a status of success is returned along with a data object containing user-specific parameters.

Method: POST

https://connect.thefirstock.com/api/V3/login

Request details

ParameterDescriptionData TypesExamples
userIdUser Id of the login userString"AA199"
passwordUser passwordString"Trade@111"
TOTPOTP orUnique identification numberString"AA1999"
apiKeyUnique identification key from the firstockString"dc6b91b7d4059be1d8
75e83774c5bb3374cf6198a
93dbc29655ed4b2f8314a42"
vendorCodevendor code of the user obtained from firstockString"AA1999_API"
curl --location --request POST 'https://connect.thefirstock.com/api/V3/login'
--header 'Content-Type: application/json'
--data-raw '{
"userId": "AA123",
"password": "password",
"TOTP": "1234698",
"vendorCode": "AA123_API",
"apiKey": "NVDewefds2343q2334"
}'

Success response details

ParameterDescriptionData typesExamples
statusSuccessString"Success"
data.actidAccount idString"AA199"
data.userNameUser nameString"sssss"
data.susertokenThis data to be sent in subsequent requests in jKey field and web socket connection while connecting.String"dc6b91b7d4059be1d875e83
774c5bb3374cf6198a93dbc
29655ed4b2f8314a42"
data.emailEmail IdString"[email protected]"

Failure response details

ParameterDescriptionData TypeExample
statusFailedString"Failed"
codeHTTP CodeString"401"
nameType of errorString"INVALID_PASSWORD"
error.fieldError fieldString"password"
error.messageError messageString"password parameter is invalid"

Sample response

{
"status": "Success",
"data": {
"actid": "AA199",
"userName": "sssss",
"susertoken": "dc6b91b7d4059be1d875e83774c5bb3374cf6198a93dbc29655ed4b2f8314a42",
"email": "[email protected]"
}
}