Create or Update Trading Account

Add a broker trading account to AutoTrader Web, or update an account that already exists.

POST https://apix.stocksdeveloper.in/account/createTradingAccount
WriteReturns a trading account id1 languagesBroker independent
In short

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:

EndpointUse it to
createTradingAccountAdd a new trading account
updateTradingAccountModify 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:

FieldMeaning
resultUnique trading account id generated by AutoTrader Web (Number, Long). On failure this is null.
messageSuccess or error message.
statustrue on success, false on failure.

Parameters

Common parameters

A few parameters are the same across all brokers.

ParameterDescription
idUnique 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.
pseudoAccNamePseudo 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

DirectJava · C# · Python · HTTP

The call returns the order id given by your trading platform.

BridgeExcel · AmiBroker · MetaTrader

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.

Was this page helpful?

Last updated 20 June 2026