HTTP 400 in broker APIs: what it means, broker by broker
186 decoded error codes from 11 brokers and platforms return this status, and one general record gives the standard's meaning: 187 records on this page. The count is of records whose recorded HTTP status is 400. A search for the number 400 also finds records that only mention it in their code or meaning, so the error lookup can show more.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
What the status means in general
HTTP 400 is Bad Request. The server cannot or will not process the request because it sees a fault on the client's side, such as malformed syntax or invalid message framing.
A trading API usually sends 400 when a field is missing, misspelt or out of range: a size below the minimum, a price with too many decimal places, an instrument name it does not know. The body of the reply normally carries the API's own error code, and that code is what names the fault.
Read the body of the reply and look up the API's own code. Compare what you sent with the documented request. Do not send the same request again unchanged, because it will be refused in the same way.
The first paragraph is the standard's meaning in this site's words, with its source. The rest is this site's own explanation and describes no particular broker. HTTP 400 Bad Request on its own page.
The status alone is only the category. The code or message in the body of the reply is what tells you the cause, and that differs from one API to the next.
The decoded errors that return it
In order of broker name, then code. Each row links to the full meaning and the fix. Where one API has more than 40 such codes, the first 40 are shown and the rest are on its own error index.
Capital.com
| Code | Meaning, first sentence | Source |
|---|---|---|
| error.account.limit.reached | The demo account's balance cap has been reached, so it cannot be topped up further. | open-api.capital.comchecked |
| error.invalid.account | The account selected for a demo balance top up is not valid. | open-api.capital.comchecked |
| error.invalid.accountId | The account id sent when switching the active account is not valid. | open-api.capital.comchecked |
| error.invalid.amount | The amount in a demo balance top up request is not valid. | open-api.capital.comchecked |
| error.invalid.from | The from parameter of an activity history request is not valid. | open-api.capital.comchecked |
| error.invalid.leverage.value | A leverage value sent when updating account preferences is not valid. | open-api.capital.comchecked |
| error.invalid.limit | The limit parameter of a market navigation request is not valid. | open-api.capital.comchecked |
| error.invalid.resolution | The resolution of a price history request is not valid. | open-api.capital.comchecked |
| error.invalid.stoploss.maxvalue | The stop loss value is too high. | open-api.capital.comchecked |
| error.invalid.stoploss.minvalue | Stop loss too close to the price (the minimum is appended to the code). | github.comchecked |
| error.invalid.takeprofit.maxvalue | The take profit value is too high. | open-api.capital.comchecked |
| error.invalid.takeprofit.minvalue | The take profit value is too low. | open-api.capital.comchecked |
| error.not-in-future.goodTillDate | The goodTillDate of a working order is not in the future. | open-api.capital.comchecked |
| error.null.api.key | X-CAP-API-KEY header missing. | github.comchecked |
| error.null.epic | The epics parameter was sent empty. | open-api.capital.comchecked |
| error.null.searchTerm | The searchTerm parameter was sent empty. | open-api.capital.comchecked |
| error.size.createwatchlistrequest.name | The name in a create watchlist request is not an accepted size. | open-api.capital.comchecked |
Deriv
| Code | Meaning, first sentence | Source |
|---|---|---|
| ValidationError | A field failed validation. | developers.deriv.comchecked |
DXtrade APIs
| Code | Meaning, first sentence | Source |
|---|---|---|
| 11 Malformed HMAC signature | DXtrade errorCode 11, description "Malformed HMAC signature" (the vendor's wording). | demo.dx.tradechecked |
| 31 Malformed query URI | DXtrade errorCode 31, description "Malformed query URI" (the vendor's wording). | demo.dx.tradechecked |
| 32 Incorrect request parameters | DXtrade errorCode 32, description "Incorrect request parameters" (the vendor's wording). | demo.dx.tradechecked |
| 33 Incorrect request | DXtrade errorCode 33, description "Incorrect request" (the vendor's wording). | demo.dx.tradechecked |
| 101 Client-originated identifier is not valid | DXtrade errorCode 101, description "Client-originated identifier is not valid" (the vendor's wording). | demo.dx.tradechecked |
| 400 Bad Request | DXtrade REST API: The client sent a malformed request, such as one missing the Host header, or a semantically incorrect request. | demo.dx.tradechecked |
eToro
| Code | Meaning, first sentence | Source |
|---|---|---|
| HTTP 400 | Validation failed on the request as sent, for example a missing or malformed minDate or too many instrument IDs in one call. | api-portal.etoro.comchecked |
IG
| Code | Meaning, first sentence | Source |
|---|---|---|
| error.invalid.daterange | The date range in a price history request is not valid. | labs.ig.comchecked |
| error.malformed.date | A date in a price history request is not in a valid format. | labs.ig.comchecked |
| error.public-api.failure.encryption.required | A login was sent to version 1 of the session endpoint by a client of the IG Singapore company. | labs.ig.comchecked |
| error.public-api.too-many-epics | The request named more epics than the endpoint accepts in one call. | labs.ig.comchecked |
| error.request.invalid.date-range | The date range in the request is not valid. | labs.ig.comchecked |
| error.request.invalid.page-size | The page size in the request is not valid. | labs.ig.comchecked |
| error.security.api-key-missing | No API key was sent with the request. | labs.ig.comchecked |
| error.service.watchlists.add-instrument.invalid-epic | The epic given when adding a market to a watchlist is not valid. | labs.ig.comchecked |
| error.switch.accountId-must-be-different | A switch to the account that is already active was attempted. | labs.ig.comchecked |
| error.switch.invalid-accountId | A switch to an account id that is not valid was attempted. | labs.ig.comchecked |
| error.trading.otc.market-orders.not-supported | Market orders are not supported for this request. | labs.ig.comchecked |
| error.unsupported.epic | The epic is not supported by the price history endpoint. | labs.ig.comchecked |
| error.watchlists.management.cannot-delete-watchlist | An attempt was made to delete a system generated watchlist, and IG rejected it. | labs.ig.comchecked |
| error.watchlists.management.duplicate-name | A watchlist could not be created because another watchlist already has that name. | labs.ig.comchecked |
| error.watchlists.management.error Recorded as 400 or 500 | A watchlist request failed for a reason IG does not specify. | labs.ig.comchecked |
| error.watchlists.management.watchlist-not-found | An attempt was made to delete a watchlist that does not exist, and IG rejected it. | labs.ig.comchecked |
| invalid.input | A generic error in the input data. | labs.ig.comchecked |
| invalid.input.too.many.markets | The request asked for too many markets in one call. | labs.ig.comchecked |
| public-api.costs-and-charges.client-error | A client side error on the indicative costs and charges endpoints. | labs.ig.comchecked |
Interactive Brokers
| Code | Meaning, first sentence | Source |
|---|---|---|
| Bad Request Error | On the Client Portal Web API, Interactive Brokers says some endpoints may return a Bad Request when the JSON body is invalid, for instance when it contains carriage returns or newlines. | interactivebrokers.github.iochecked |
| conid or conidex is required | Web API status 400 BadRequest, with the error message "conid or conidex is required" (the vendor's wording). | interactivebrokers.comchecked |
| Failed to parse body as JSON | Web API status 400 BadRequest, with an error message that begins "Failed to parse body as JSON" (the vendor's wording). | interactivebrokers.comchecked |
| Invalid Side | Web API status 400 BadRequest, with the error message "Invalid Side (must be 'BUY' or 'SELL')." (the vendor's wording). | interactivebrokers.comchecked |
| orders request includes parameter with incorrect type | Web API status 400 BadRequest, with the error message "orders request includes parameter with incorrect type" (the vendor's wording). | interactivebrokers.comchecked |
| Unknown order type | Web API status 400 BadRequest, with the error message "Unknown order type" (the vendor's wording). | interactivebrokers.comchecked |
Match-Trader Platform API
| Code | Meaning, first sentence | Source |
|---|---|---|
| 400 | In the Match-Trader Platform API documentation, the Errors section, which it describes as examples of error responses for each status code, lists status 400 but shows no example body and no description for it. | app.theneo.iochecked |
OANDA
| Code | Meaning, first sentence | Source |
|---|---|---|
| Invalid value specified for 'instrument' | Instrument name malformed. | developer.oanda.comchecked |
| STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED | Price has more decimal places than the instrument allows. | developer.oanda.comchecked |
| The request was missing required data | One or more parameters that the request requires are missing or not valid. | developer.oanda.comchecked |
Saxo OpenAPI
| Code | Meaning, first sentence | Source |
|---|---|---|
| ActiveFollowerCannotDoManualTrade | Opening or closing a position is not allowed on an active strategy account. | developer.saxochecked |
| AlgoOrderTimeBeforeExchangeOpen | An algo order parameter carries a time before the exchange opens. | developer.saxochecked |
| AmountBelowMinimumLotSize | The order size is below the exchange's minimum lot size. | developer.saxochecked |
| AmountCannotBeLessThanFilledAmount | The amount cannot be less than the amount already filled. | developer.saxochecked |
| AmountNotInLotSize | The order size is not a valid lot size for the exchange. | developer.saxochecked |
| BlocksExistForOwnedContracts | A block exists for the owned contract. | developer.saxochecked |
| BreakoutUpPriceCannotBeLessThanDownPrice | The breakout up price cannot be less than the down price. | developer.saxochecked |
| BrokerOption | Saxo's page describes this code only with the words Broker Option. | developer.saxochecked |
| CashAmountLessThanMinInitialInvestmentAmount | The cash amount must be at least the minimum investment amount. | developer.saxochecked |
| ClientCountrySanctioned | The user is disabled from trading because their country is sanctioned. | developer.saxochecked |
| ClientExposureLimitation | The trade would take the client past an exposure limitation. | developer.saxochecked |
| ClientNotEnabledForExtendedTradingHours | The client is not enabled for trading in extended trading hours. | developer.saxochecked |
| ClientOnReduceForcedExposureReductionViolation | The client is in the Reduce group type, so exposure cannot be increased. | developer.saxochecked |
| ClosingPositionNotAllowedForMultiDayExecutionOrder | A position that came from a multi-day order execution does not support an explicit closing order. | developer.saxochecked |
| ClosingPositionNotAllowedOnJointExecutionModel | Closing a position is not allowed for Trade Leaders. | developer.saxochecked |
| ConditionDurationNotSupported | The condition's duration is not supported for this asset type. | developer.saxochecked |
| ConditionOnWrongSideOfMarket | The condition price is on the wrong side of the market. | developer.saxochecked |
| ConditionPriceExceedsAggressiveTolerance | The condition price is beyond the aggressive tolerance. | developer.saxochecked |
| ConditionTooFarFromMarket | The condition's limit price is too far from the market. | developer.saxochecked |
| ContactExposureLimitation | The trade would take exposure past the cap set at contact level. | developer.saxochecked |
| CouldNotCompleteRequest | The operation could not be completed and Saxo will not disclose why. | developer.saxochecked |
| CrossCurrencyOrderOnMarginLendingAccountNotAllowed | A cross currency order is not supported on a MarginLending account. | developer.saxochecked |
| DealCaptureAllocationKeyNotCorrect | The deal capture allocation key is not correct. | developer.saxochecked |
| DealCaptureInformationNotCorrect | The deal capture information is not correct. | developer.saxochecked |
| DomainValidationError | Domain validation of the request failed. | developer.saxochecked |
| DurationNotSupported | The duration supplied is not supported for this order. | developer.saxochecked |
| ExpirationDateInPast | The expiration date is in the past. | developer.saxochecked |
| ExpirationDateRequired | An expiration date is mandatory for this type of order request. | developer.saxochecked |
| ExplicitCloseNotAllowedForIntradayNetting | Closing a position explicitly is not allowed when real-time netting is enabled. | developer.saxochecked |
| ExtendedHoursTradingCannotBeChanged | The value for extended trading hours cannot be changed. | developer.saxochecked |
| FeatureNotEnabled | An OpenAPI feature has been disabled through Saxo's Front Office. | developer.saxochecked |
| ForcedExposureReductionViolation | A forced exposure reduction rule would be broken. | developer.saxochecked |
| ForceOpenNotAllowed | Force open is not allowed. | developer.saxochecked |
| ForwardDateInPast | The forward date is in the past. | developer.saxochecked |
| ForwardDateRequired | A forward date is mandatory. | developer.saxochecked |
| GtdOrderCannotBeLaterThanExpiry | A good till date order cannot run later than the instrument's expiry. | developer.saxochecked |
| HTTP 400 | Saxo rejected the request as sent: it was malformed or it broke a business rule. | developer.saxochecked |
| IllegalAccount | The account is illegal for this request. | developer.saxochecked |
| IllegalAmount | The amount is illegal for this request. | developer.saxochecked |
| IllegalAssetType | The asset type is illegal for this request. | developer.saxochecked |
All 129 Saxo OpenAPI codes recorded with HTTP 400: 89 more than are shown here.
TradeLocker API
| Code | Meaning, first sentence | Source |
|---|---|---|
| 400 Bad Request | TradeLocker lists 400 with the description "Bad Request" as a response of its authentication routes: POST /auth/jwt/token, which fetches the JWT tokens, POST /auth/jwt/refresh and GET /auth/jwt/all-accounts. | public-api.tradelocker.comchecked |
Trading 212
| Code | Meaning, first sentence | Source |
|---|---|---|
| Bad filtering arguments | The filtering arguments of a history request are not valid. | docs.trading212.comchecked |
| Failed validation | The order request failed validation. | docs.trading212.comchecked |
Brokers and platforms not listed here have no decoded error recorded with this status. That describes this dataset, not their APIs.