Create or Update Trading Account
Add a broker trading account to AutoTrader Web, or update an account that already exists.
https://apix.stocksdeveloper.in/account/createTradingAccount Use these calls to add a broker trading account to AutoTrader Web, or to update one that already exists. There are two endpoints, `createTradingAccount` and `updateTradingAccount`. The login parameters change from broker to broker, so this page explains the common fields and the broker specific fields each account needs. On success the call returns a trading account id.
This call adds a new broker trading account, or updates an existing one. It is available over the HTTP REST API and is mainly for developers building their own apps on top of our broker independent trading APIs.
There are two separate endpoints:
| Endpoint | Use it to |
|---|---|
createTradingAccount | Add a new trading account |
updateTradingAccount | Modify an existing trading account |
HTTP
Example
Create a new account:
curl https://apix.stocksdeveloper.in/account/createTradingAccount \
-H "api-key: <your-api-key>" \
-d "broker=YOUR_BROKER" \
-d "platform=PLATFORM" \
-d "loginId=<your-login-id>" \
-d "password=<your-password>" \
-d "totpKey=<your-totp-key>" \
-d "pseudoAccName=<pseudo-or-nickname>"
Update an existing account (pass the trading account id):
curl https://apix.stocksdeveloper.in/account/updateTradingAccount \
-H "api-key: <your-api-key>" \
-d "id=<trading-account-id>" \
-d "broker=YOUR_BROKER" \
-d "platform=PLATFORM" \
-d "loginId=<your-login-id>" \
-d "password=<your-password>" \
-d "totpKey=<your-totp-key>"
Response
On success:
{
"result": 15937688,
"message": "Account saved successfully.",
"status": true,
"commandId": null
}
On 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
}
The response fields work as follows:
| Field | Meaning |
|---|---|
result | Unique trading account id generated by AutoTrader Web (Number, Long). On failure this is null. |
message | Success or error message. |
status | true on success, false on failure. |
Parameters
Common parameters
A few parameters are the same across all brokers.
| Parameter | Description |
|---|---|
id | Unique trading account id generated by AutoTrader Web (Number, Long). Get it from the Fetch All Trading Accounts API (the systemId field). Mandatory for Update, not needed for Create. |
pseudoAccName | Pseudo or nickname for the account. Used only for Create, and it is optional. If you do not pass it, the login id of the trading account is used as the nickname. Not needed for Update. |
Broker specific parameters
All other parameters are broker specific, because every broker has a different login mechanism. Each account needs:
broker— the broker name, as listed on the supported brokers page.platform— the broker platform code that goes with that broker.- A set of credential fields that depend on the broker. Depending on the broker these may include
loginId,password,mpin,totpKey,dob,phone,token, and various API key, secret and id fields issued by the broker.
For the exact broker value, platform code and the full credential field list for your broker, see your broker’s setup guide under client setup or contact support.
Return value
The call returns the order id given by your trading platform.
The call returns the library order id. The Desktop Client passes the request on to your broker.
Notes
This call is not meant to be made repeatedly, so it has stricter limits than the other APIs. See API rate limits for the full list.
After adding an account, you can confirm it with Fetch All Trading Accounts and check the credentials with Validate Trading Account Credentials.
Thanks for the feedback. Still stuck? Contact support.
Last updated 20 June 2026