Excessive errors
Each failed attempt to add a trading account to MetaApi cloud in case the attempt has resulted in an authorization error or broker settings detection error on the trading terminal may be charged according to applicable rates.
Authorization error
The authorization error can originate from a bug in your software or from behaviour of your users. You can avoid the excessive charges associated with your user activity by following the algorithm below:
- In case an attempt to add a trading account of your user has resulted in E_AUTH error, it means that there was an "Invalid account" or "Account disabled" or similar permanent error on the trading terminal. If your application received E_AUTH error response when adding (updating) a trading account to MetaApi or deploying (redeploying) a trading account to MetaApi, you can consider calculating the SHA256 hash of the concatenation of trading platform, trading server name, trading account login and trading account password and storing the hash value in your local cache. Depending on your application design you may use solutions like persistent databases (such as mariadb or mongodb) or in-memory key-value databases (such as redis).
- In case your user attempts to add a trading account using the same credentials, you can warn the user that they must make sure that the account credentials has indeed been updated.
- Rate limit attempts to add trading accounts of the user in case of consistent attempts to add a trading account using invalid credentials.
Automatic broker settings detection error
The automatic settings detection error might occur as a result of attempting to add a trading account if specified server for MT platform is no longer available. You can avoid the excessive charges associated with your user activity by following the algorithm below:
- In case of E_SERVER_TIMEZONE error while trying to add a trading account using automatic broker settings detection, you can consider to require user to use provisioning profile for corresponding server name and MT platform. You can consider calculating the SHA256 hash of the concatenation of trading platform and trading server name in your local cache for requests that resulted in E_SERVER_TIMEZONE to validate subsequent requests.
- Note that MT server name is case-insensitive and might require convertion to low/upper case before storing.
- Note that broker might enable/disable access to a specific server, you can consider adding ttl to stored values.
Resource slots error
Resource slots error might occur as a result of trying to add or update trading account with specified resource slots lower than estimated.
- In case an attempt to add or update a trading account of your user has resulted in E_RESOURCE_SLOTS error, it means that specified account resource slots are lower than estimated during account connection validation. You can consider calculating the SHA256 hash of the concatenation of trading platform, trading server name, trading account login, trading account password, account type and resource slots and storing the hash value in your local cache. Depending on your application design you may use solutions like persistent databases (such as mariadb or mongodb) or in-memory key-value databases (such as redis).
- In case your user attempts to add or update trading account using the same credentials and resource slots amount, you can warn the user that they must increase amount of resource slots.
No symbols error
No symbols error might occur as a result of trying to add or update trading account with no configured symbols. In order to configure account symbols user must contact the account broker.
- In case an attempt to add or update a trading account of your user has resulted in E_NO_SYMBOLS error, it means that specified account has no configured symbols. You can consider calculating the SHA256 hash of the concatenation of trading platform, trading server name, trading account login and trading account password and storing the hash value in your local cache. Depending on your application design you may use solutions like persistent databases (such as mariadb or mongodb) or in-memory key-value databases (such as redis).
- In case your user attempts to add or update trading account using the same credentials, you can warn the user that they must make sure that the account symbols has indeed been configured.
One-time password required error
One-time password reqired error might occur as a result of trying to add or update trading account with configured one-time password (OTP) requirement. In order to add account the one-time password requirement must be disabled.
- In case an attempt to add or update a trading account of your user has resulted in ERR_OTP_REQUIRED error, it means that specified account has configured OTP requirements. You can consider calculating the SHA256 hash of the concatenation of trading platform, trading server name, trading account login and trading account password and storing the hash value in your local cache. Depending on your application design you may use solutions like persistent databases (such as mariadb or mongodb) or in-memory key-value databases (such as redis).
- In case your user attempts to add or update trading account using the same credentials, you can warn the user that they must make sure that OTP is not required for account.
Password change required error
Password change required error might occur as a result of trying to add or update trading account if broker requires the account password to be changed. User can change the account password using corresponding trading platform.
- In case an attempt to add or update a trading account of your user has resulted in E_PASSWORD_CHANGE_REQUIRED error, it means that account password must be changed. You can consider calculating the SHA256 hash of the concatenation of trading platform, trading server name, trading account login and trading account password and storing the hash value in your local cache. Depending on your application design you may use solutions like persistent databases (such as mariadb or mongodb) or in-memory key-value databases (such as redis).
- In case your user attempts to add or update trading account using the same credentials, you can warn the user that they must change the account password.
Account disabled error
Account disabled error might occur as a result of trying to add or update trading account that was disabled by broker.
- In case an attempt to add or update a trading account of your user has resulted in E_TRADING_ACCOUNT_DISABLED error, it means that account is disabled. You can consider calculating the SHA256 hash of the concatenation of trading platform, trading server name, trading account login and trading account password and storing the hash value in your local cache. Depending on your application design you may use solutions like persistent databases (such as mariadb or mongodb) or in-memory key-value databases (such as redis).
- In case your user attempts to add a trading account using the same credentials, you can warn the user that account with specified credentials was disabled.
- Rate limit attempts to add trading accounts of the user in case of consistent attempts to add disabled trading account.
Affected endpoints
Endpoints affected by this change and further technical information are: - https://metaapi.cloud/docs/provisioning/api/account/createAccount/#authentication-error - https://metaapi.cloud/docs/provisioning/api/account/updateAccount/ - https://metaapi.cloud/docs/provisioning/api/account/deployAccount/ - https://metaapi.cloud/docs/provisioning/api/account/redeployAccount/