API functions to create or update trading accounts. There are 2 separate apis:
- Create (To create a new trading account)
- Update (To modify an existing trading account)
This API is primarily designed for application developers who are going to create customized trading applications using our broker independent trading APIs.
Example – Create Account
curl https://apix.stocksdeveloper.in/account/createTradingAccount \
-H "api-key: <your_api_key>" \
-d "broker=broker_name" \
-d "loginId=login_id" \
-d "password=password" \
-d "totpKey=totp_key" \
-d "pseudoAccName=pseudo_or_nickname"
Example – Update Account
curl https://apix.stocksdeveloper.in/account/updateTradingAccount \
-H "api-key: <your_api_key>" \
-d "id=trading_acc_id" \
-d "broker=Zerodha" \
-d "loginId=SN2911" \
-d "password=mysecretpwd" \
-d "totpKey=JBSWY3DPEHPK3ASP"
Response [Success]
{
"result": 15937688,
"message": "Account saved successfully.",
"status": true,
"commandId": null
}
Response [Failure]
{
"result": null,
"message": "Account already exists! Either you or some other user has already added this account in our system. Please contact support.",
"status": false,
"commandId": null
}
Parameters
- id – Unique trading account id generated by AutoTrader Web [Number – Long]
- This can be obtained from Fetch All Trading Accounts API (systemId field in the response)
- This field is only mandatory for Update request
- This field is not needed for Create request
- pseudoAccName – Pseudo or nickname to be used for the account
- This field is only needed for Create request & it is optional. If you do not pass anything, then login id of trading account will be used as pseudo account name.
- This field is not needed for Update request
- Other parameters – Other parameters are broker specific as every broker’s login mechanism is different. They are explained below:
Response
- result – Unique trading account id generated by AutoTrader Web [Number – Long]
- message – An error message (if there is an error)
- status – true indicates success, false indicates failure
5 Paisa
- broker – 5Paisa
- platform – FP_API_TOTP
- loginId – 5Paisa login id
- mpin – 5Paisa MPIN (6-digit)
- totpKey – 5Paisa TOTP key
- apiUserKey – 5Paisa API user key
- apiAppSource – 5Paisa API app source
AliceBlue
- broker – AliceBlue
- platform – ALICE_API
- loginId – AliceBlue login id
- password – AliceBlue password
- totpKey – AliceBlue TOTP key
Angel
- broker – Angel
- platform – SMART_API
- mpin – Angel MPIN
- totpKey – Angel TOTP key
- apiKey – Angel API key
Choice
- broker – Choice
- platform – CHOICE_API
- loginId – Choice login id
- password – Choice password
Dhan
- broker – Dhan
- platform – DHAN
- token – Access token
Finvasia
- broker – Finvasia
- platform – SHOONYA_BETA
- loginId – Shoonya login id
- password – Shoonya password
- totpKey – Shoonya TOTP key
Fyers
- broker – Fyers
- platform – FYERS_PARTNER_API
- loginId – Fyers login id
- totpKey – Fyers TOTP key
- twofaPin – Fyers 4-digit 2FA pin
IIFL
- broker – IIFL
- platform – IIFL_API
- loginId – IIFL login id
- password – IIFL password
- dob – DOB in (YYYYMMDD) format
- apiUserKey – IIFL API user key
- apiAppName – IIFL API app name
- apiAppSource – IIFL API app source
- apiUserId – IIFL API user id
- apiPassword – IIFL API password
- apiEncryptionKey – IIFL API encryption key
Kotak
- broker – Kotak
- platform – KOTAK_NEO
- loginId – Kotak login id
- password – Kotak password
- mpin – Kotak MPIN (6-digit)
- phone – 10-digit phone number registered with Kotak
- consumerKey – Kotak API consumer key
- consumerSecret – Kotak API consumer secret
- apiUserId – Kotak API user id
- apiPassword – Kotak API password
Mastertrust
- broker – Mastertrust
- platform – MASTERTRUST
- loginId – Mastertrust login id
- password – Mastertrust password
- totpKey – Mastertrust TOTP key
- appSecret – Mastertrust API app secret
- appId – Mastertrust API app id
Motilal
- broker – Motilal
- platform – MOTILAL_API
- loginId – Motilal login id
- password – Motilal password
- totpKey – Motilal TOTP key
- dob – DOB in (dd/mm/yyyy) format
Profitmart
- broker – Profitmart
- platform – PROFITMAX
- loginId – Profitmart login id
- password – Profitmart password
- panOrDob – PAN (in capital) or DOB in (DD-MM-YYYY) format
- appKey – Profitmart API app key
- vendorCode – Profitmart API vendor code
SAS
- broker – SAS
- platform – SAS
- loginId – SAS login id
- password – SAS password
- totpKey – SAS TOTP key
Upstox
- broker – Upstox
- platform – UPSTOX_API
- loginId – Upstox login id
- twofaPin – Upstox 6-digit 2FA pin
- totpKey – Upstox TOTP key
- phone – 10-digit phone number registered with Upstox
- apiKey – Upstox API key
- apiSecret – Upstox API secret
XTS
- broker – AnandRathi, 5Paisa, AC Agarwal, ATS, Eureka, IIFL, Jainam, Motilal, SW Capital, Tradeswift, WisdomCapital, Zebull
- platform – XTS_ANAND_RATHI, XTS_FIVE_PAISA, XTS_AGARWAL, XTS_ATS, XTS_EUREKA, XTS_IIFL, XTS_JAINAM, XTS_MOTILAL, XTS_SW_CAPITAL, XTS_TSWIFT, XTS_WISDOM, XTS_ZEBU
- apiKey – App Key
- apiPassword – Secret Key
Zerodha
- broker – Zerodha
- platform – KITE
- loginId – Zerodha kite login id
- password – Zerodha kite password
- totpKey – Zerodha kite TOTP key
Response Fields
- result – Unique trading account id generated by AutoTrader Web [Number – Long]
- In case of a failure, you will see this value as null
- message – Success or error message
API Limits
This api is not expected to be used repeatedly, hence it has stricter API Limits compared to the other apis.
- Max 100 requests are allowed in 1 min
- Max 1000 requests are allowed in 1 hour