Error Codes and Descriptions
This section defines the error codes you may encounter when working with the WebServices API.
The table below defines the error codes that you may encounter when making any of the API calls described in Operations with accounts and Operations with cTID.
| Code | Definition |
|---|---|
UNKNOWN_ERROR | An unknown server error has occured. |
INVALID_REQUEST | A request validation failure has occured. The possible error descriptions are as following. |
NOT_ENOUGH_RIGHTS | The manager who has made the request does not have sufficient rights to perform the requested operation. |
CH_BROKER_NOT_FOUND | The cTrader backend cannot find the broker that the request concerns. |
The following table defines the error codes that can only be encountered when making certain calls described in Operations with accounts and Operations with cTID.
| Code | API Call(s) | Definition |
|---|---|---|
REQUEST_FREQUENCY_EXCEEDED | Any call with a non-GET method. | The client has exceeded the request rate limiter (only applies to non-GET requests). |
TRADER_NOT_FOUND | Any API call with the login parameter and/or the traderLogin/login keys in the request body. | The requested trader is not found. |
CH_PLANT_INVALID | Any API calls with the brokerName key in the request body. | The cTrader backend cannot find a broker with brokerName at the plant to which the request is made. |
Error Codes for Operations with Accounts
The following errors can only be encountered when making certain API call(s) described in Operations with accounts.
| Code | API Call(s) | Definition |
|---|---|---|
NOT_ENOUGH_MONEY | API calls Change a Trader's Balance and Request a List of Closed Positions. | A trader does not have sufficient funds to perform the requested operation or has open positions generating unrealized PnL. |
CHANGE_BALANCE_BAD_AMOUNT | Change a Trader's Balance | The requested balance change amount is invalid (e.g., if it is less than zero). |
TRADER_GROUP_NOT_FOUND | Read Multiple Traders' Details | The requested trader group is not found. |
WRONG_PASSWORD | Check a Trader's Password | The password submitted in the request body is incorrect. |
Error Codes for Operations with cTID
You may encounter the following error codes when making certain API calls described in Operations with cTID.
| Code | API Call(s) | Definition |
|---|---|---|
CID_DEFAULT_REGION_NOT_FOUND | Create a cTID | The plant to which the request is made is lacking a default region in its configuration. |
CH_CTID_ALREADY_CONFIRMED | Create a cTID | The value of the email |
CANT_ROUTE_REQUEST | Link an Account to a cTID | The environment with the specified environmentName is not found. |
INSUFFICIENT_PERMISSIONS | Link an Account to a cTID | The broker with the specified brokerName does not have access to the trader with the specified traderLogin. |
CH_TRADER_ACCOUNT_CANNOT_BE_LINKED | Link an Account to a cTID | The trader with the specified traderLogin has already been linked. |
CH_TRADER_ACCOUNT_NOT_FOUND | API calls Link an Account to a cTID and Change Trading Account Details | The trader with the specified traderLogin is not found. |
CH_CTID_TRADER_ACCOUNT_NOT_FOUND | Change Trading Account Details | The trader with the specified ctidTraderAccountId is not found. |