Return Codes (with numeric values)¶
Common Errors¶
| Code Name | Value | Description |
|---|---|---|
| RET_OK | 0 | All OK |
| RET_OK_NONE | 1 | All OK – no operation |
| RET_ERROR | 2 | General error |
| RET_INVALID_DATA | 3 | Invalid data |
| RET_TECH_PROBLEM | 4 | Server technical problem |
| RET_OLD_VERSION | 5 | Old client terminal |
| RET_NO_CONNECT | 6 | No connection |
| RET_NOT_ENOUGH_RIGHTS | 7 | Not enough rights |
| RET_TOO_FREQUENT | 8 | Too frequent access to server |
| RET_MALFUNCTION | 9 | Malfunctional operation |
| RET_GENERATE_KEY | 10 | Need to send public key |
| RET_SECURITY_SESSION | 11 | Security session start |
| RET_INVALID_PASSWORD | 12 | Invalid password |
| RET_ERR_PARAMS | 13 | Invalid parameters |
| RET_ERR_DATA | 14 | Invalid data |
| RET_ERR_DISK | 15 | Disk error |
| RET_ERR_MEM | 16 | Memory error |
| RET_ERR_NETWORK | 17 | Network error |
| RET_ERR_PERMISSIONS | 18 | Not enough permissions |
| RET_ERR_TIMEOUT | 19 | Operation timeout |
| RET_ERR_CONNECTION | 20 | No connection |
| RET_ERR_NOSERVICE | 21 | Service is not available |
| RET_ERR_FREQUENT | 22 | Too frequent requests |
| RET_ERR_NOTFOUND | 23 | Not found |
| RET_ERR_SHUTDOWN | 24 | Server shutdown in progress |
| RET_ERR_CANCEL | 25 | Operation was canceled |
| RET_ERR_DUPLICATE | 26 | Duplicate attempt |
| RET_OK_CHANGE | 27 | Operation successful – some fields changed |
Group Errors¶
| Code Name | Value | Description |
|---|---|---|
| RET_GROUP_NOT_FOUND | 28 | Group not found |
| RET_GROUP_USE_BY_USER | 29 | Group is used by user |
Symbols Errors¶
| Code Name | Value | Description |
|---|---|---|
| RET_SEC_USE_BY_SYMBOL | 32 | Symbol group used by symbol |
| RET_SYMBOL_USE_BY_TRADE | 33 | Symbol used by trade |
| RET_SYMBOL_NOT_FOUND | 34 | Symbol not found |
User Errors¶
| Code Name | Value | Description |
|---|---|---|
| RET_USER_NOT_FOUND | 48 | User not found |
| RET_USR_LAST_ADMIN | 49 | Last admin account cannot be deleted |
| RET_USR_LOGIN_EXHAUSTED | 50 | Login range exhausted |
| RET_USR_LOGIN_PROHIBITED | 51 | Login reserved at another server |
| RET_USR_LOGIN_EXIST | 52 | Account already exists |
| RET_USR_SUICIDE | 53 | Attempt of self-deletion |
| RET_USR_INVALID_PASSWORD | 54 | Invalid account password |
| RET_USR_LIMIT_REACHED | 55 | User limit reached |
| RET_USR_HAS_TRADES | 56 | Account has open trades |
| RET_USR_DIFFERENT_SERVERS | 57 | Attempt to move account to different server |
| RET_USR_DIFFERENT_CURRENCY | 58 | Attempt to move account to group with different currency |
| RET_USR_IMPORT_BALANCE | 59 | Account balance import error |
| RET_USR_IMPORT_GROUP | 60 | Imported account has invalid group |
| RET_USR_ACCOUNT_EXIST | 61 | Account already exists |
Account Status¶
| Code Name | Value | Description |
|---|---|---|
| RET_ACCOUNT_DISABLED | 64 | Account blocked |
| RET_BAD_ACCOUNT_INFO | 65 | Bad account info |
| RET_PUBLIC_KEY_MISSING | 66 | No public key |
Trade Errors¶
| Code Name | Value | Description |
|---|---|---|
| RET_TRADE_TIMEOUT | 128 | Trade transaction timeout expired |
| RET_TRADE_BAD_PRICES | 129 | Order has wrong prices |
| RET_TRADE_BAD_STOPS | 130 | Wrong stop level |
| RET_TRADE_BAD_VOLUME | 131 | Wrong lot size |
| RET_TRADE_MARKET_CLOSED | 132 | Market closed |
| RET_TRADE_DISABLE | 133 | Trade disabled |
| RET_TRADE_NO_MONEY | 134 | Not enough money for order execution |
| RET_TRADE_PRICE_CHANGED | 135 | Price changed |
| RET_TRADE_OFFQUOTES | 136 | No quotes |
| RET_TRADE_BROKER_BUSY | 137 | Broker is busy |
| RET_TRADE_REQUOTE | 138 | Requote |
| RET_TRADE_ORDER_LOCKED | 139 | Order is processed by dealer and cannot be changed |
| RET_TRADE_LONG_ONLY | 140 | Only BUY orders allowed |
| RET_TRADE_TOO_MANY_REQ | 141 | Too many requests from one client |
Order Status Notifications¶
| Code Name | Value | Description |
|---|---|---|
| RET_TRADE_ACCEPTED | 145 | Trade request accepted by server and placed in queue |
| RET_TRADE_PROCESS | 146 | Trade request accepted by dealer |
| RET_TRADE_USER_CANCEL | 147 | Trade request canceled by client |
Additional Return Codes¶
| Code Name | Value | Description |
|---|---|---|
| RET_TRADE_MODIFY_DENIED | 150 | Trade modification denied |
| RET_TRADE_CONTEXT_BUSY | 151 | Trade context is busy |
| RET_TRADE_EXPIRATION_DENIED | 152 | Using expiration date denied |
| RET_TRADE_TOO_MANY_ORDERS | 153 | Too many orders |
| RET_TRADE_HEDGE_PROHIBITED | 154 | Hedging is prohibited |
| RET_TRADE_PROHIBITED_BY_FIFO | 155 | Prohibited by FIFO rule |
| RET_DUPLICATE_RECORD | 156 | Duplicate trade creation attempt |
| RET_TRADE_SEC_NOT_FOUND | 157 | No active symbol group found for user group |
| RET_TRADE_INVALID_SL_TP | 158 | Invalid Stop Loss or Take Profit values |
| RET_TRADE_BAD_CLOSE_TIME | 159 | Invalid close time parameter |
| RET_TRADE_READ_ONLY | 160 | Account has read-only permissions |
| RET_TRADE_INCORRECT_STATE | 161 | Invalid trade state |
| RET_TRADE_INCORRECT_CMD | 162 | Invalid trade command |
Config Errors¶
| Code Name | Value | Description |
|---|---|---|
| RET_CFG_LAST_ADMIN | 256 | Last admin config cannot be deleted |
| RET_CFG_LAST_ADMIN_GROUP | 257 | Last admin group cannot be deleted |
| RET_CFG_NOT_EMPTY | 258 | Accounts or trades in group/symbol |
| RET_CFG_INVALID_RANGE | 259 | Invalid account or trade ranges |
| RET_CFG_NOT_MANAGER_LOGIN | 260 | Account doesn't belong to manager group |
| RET_CFG_BUILTIN | 261 | Built-in protected config |
| RET_CFG_DUPLICATE | 262 | Configuration duplicate |
| RET_CFG_LIMIT_REACHED | 263 | Configuration limit reached |
| RET_CFG_NO_ACCESS_TO_MAIN | 264 | Invalid network configuration |
| RET_CFG_DEALER_ID_EXIST | 265 | Dealer with same ID already exists |
| RET_CFG_BIND_ADDR_EXIST | 266 | Binding address already exists |
| RET_CFG_WORKING_TRADE | 267 | Attempt to delete working trade server |
| RET_CFG_GATEWAY_NAME_EXIST | 268 | Gateway with same name already exists |
| RET_CFG_SWITCH_TO_BACKUP | 269 | Server must be switched to backup mode |
| RET_CFG_NO_BACKUP_MODULE | 270 | Backup server module is absent |
| RET_CFG_NO_TRADE_MODULE | 271 | Trade server module is absent |
| RET_CFG_NO_HISTORY_MODULE | 272 | History server module is absent |
| RET_CFG_ANOTHER_SWITCH | 273 | Another switching process in progress |
| RET_CFG_NO_LICENSE_FILE | 274 | License file is absent |
| RET_CFG_GATEWAY_LOGIN_EXIST | 275 | Gateway with same login already exists |
| RET_LICENSE_NOT_ACTIVE | 276 | License not active |
HTTP Codes¶
| Code Name | Value | Description |
|---|---|---|
| RET_BAD_REQUEST | 400 | Bad request |
| RET_UNAUTHORIZED | 401 | Unauthorized |
| RET_FIELD_REQUIRED | 402 | Required field missing |
| RET_FORBIDDEN | 403 | Forbidden |
| RET_NOT_FOUND | 404 | Not found |
| RET_METHOD_NOT_ALLOWED | 405 | Method not allowed |
| RET_INVALID_METHOD | 406 | Invalid method |
| RET_TIMEOUT | 407 | Timeout |