Broker API HubMenu

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.

Independent and unofficialNewest check

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.

rfc-editor.orgchecked

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

CodeMeaning, first sentenceSource
error.account.limit.reachedThe demo account's balance cap has been reached, so it cannot be topped up further.open-api.capital.comchecked
error.invalid.accountThe account selected for a demo balance top up is not valid.open-api.capital.comchecked
error.invalid.accountIdThe account id sent when switching the active account is not valid.open-api.capital.comchecked
error.invalid.amountThe amount in a demo balance top up request is not valid.open-api.capital.comchecked
error.invalid.fromThe from parameter of an activity history request is not valid.open-api.capital.comchecked
error.invalid.leverage.valueA leverage value sent when updating account preferences is not valid.open-api.capital.comchecked
error.invalid.limitThe limit parameter of a market navigation request is not valid.open-api.capital.comchecked
error.invalid.resolutionThe resolution of a price history request is not valid.open-api.capital.comchecked
error.invalid.stoploss.maxvalueThe stop loss value is too high.open-api.capital.comchecked
error.invalid.stoploss.minvalueStop loss too close to the price (the minimum is appended to the code).github.comchecked
error.invalid.takeprofit.maxvalueThe take profit value is too high.open-api.capital.comchecked
error.invalid.takeprofit.minvalueThe take profit value is too low.open-api.capital.comchecked
error.not-in-future.goodTillDateThe goodTillDate of a working order is not in the future.open-api.capital.comchecked
error.null.api.keyX-CAP-API-KEY header missing.github.comchecked
error.null.epicThe epics parameter was sent empty.open-api.capital.comchecked
error.null.searchTermThe searchTerm parameter was sent empty.open-api.capital.comchecked
error.size.createwatchlistrequest.nameThe name in a create watchlist request is not an accepted size.open-api.capital.comchecked

Deriv

CodeMeaning, first sentenceSource
ValidationErrorA field failed validation.developers.deriv.comchecked

DXtrade APIs

CodeMeaning, first sentenceSource
11 Malformed HMAC signatureDXtrade errorCode 11, description "Malformed HMAC signature" (the vendor's wording).demo.dx.tradechecked
31 Malformed query URIDXtrade errorCode 31, description "Malformed query URI" (the vendor's wording).demo.dx.tradechecked
32 Incorrect request parametersDXtrade errorCode 32, description "Incorrect request parameters" (the vendor's wording).demo.dx.tradechecked
33 Incorrect requestDXtrade errorCode 33, description "Incorrect request" (the vendor's wording).demo.dx.tradechecked
101 Client-originated identifier is not validDXtrade errorCode 101, description "Client-originated identifier is not valid" (the vendor's wording).demo.dx.tradechecked
400 Bad RequestDXtrade REST API: The client sent a malformed request, such as one missing the Host header, or a semantically incorrect request.demo.dx.tradechecked

eToro

CodeMeaning, first sentenceSource
HTTP 400Validation 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

CodeMeaning, first sentenceSource
error.invalid.daterangeThe date range in a price history request is not valid.labs.ig.comchecked
error.malformed.dateA date in a price history request is not in a valid format.labs.ig.comchecked
error.public-api.failure.encryption.requiredA 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-epicsThe request named more epics than the endpoint accepts in one call.labs.ig.comchecked
error.request.invalid.date-rangeThe date range in the request is not valid.labs.ig.comchecked
error.request.invalid.page-sizeThe page size in the request is not valid.labs.ig.comchecked
error.security.api-key-missingNo API key was sent with the request.labs.ig.comchecked
error.service.watchlists.add-instrument.invalid-epicThe epic given when adding a market to a watchlist is not valid.labs.ig.comchecked
error.switch.accountId-must-be-differentA switch to the account that is already active was attempted.labs.ig.comchecked
error.switch.invalid-accountIdA switch to an account id that is not valid was attempted.labs.ig.comchecked
error.trading.otc.market-orders.not-supportedMarket orders are not supported for this request.labs.ig.comchecked
error.unsupported.epicThe epic is not supported by the price history endpoint.labs.ig.comchecked
error.watchlists.management.cannot-delete-watchlistAn attempt was made to delete a system generated watchlist, and IG rejected it.labs.ig.comchecked
error.watchlists.management.duplicate-nameA 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-foundAn attempt was made to delete a watchlist that does not exist, and IG rejected it.labs.ig.comchecked
invalid.inputA generic error in the input data.labs.ig.comchecked
invalid.input.too.many.marketsThe request asked for too many markets in one call.labs.ig.comchecked
public-api.costs-and-charges.client-errorA client side error on the indicative costs and charges endpoints.labs.ig.comchecked

Interactive Brokers

CodeMeaning, first sentenceSource
Bad Request ErrorOn 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 requiredWeb API status 400 BadRequest, with the error message "conid or conidex is required" (the vendor's wording).interactivebrokers.comchecked
Failed to parse body as JSONWeb API status 400 BadRequest, with an error message that begins "Failed to parse body as JSON" (the vendor's wording).interactivebrokers.comchecked
Invalid SideWeb 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 typeWeb API status 400 BadRequest, with the error message "orders request includes parameter with incorrect type" (the vendor's wording).interactivebrokers.comchecked
Unknown order typeWeb API status 400 BadRequest, with the error message "Unknown order type" (the vendor's wording).interactivebrokers.comchecked

Match-Trader Platform API

CodeMeaning, first sentenceSource
400In 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

CodeMeaning, first sentenceSource
Invalid value specified for 'instrument'Instrument name malformed.developer.oanda.comchecked
STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDEDPrice has more decimal places than the instrument allows.developer.oanda.comchecked
The request was missing required dataOne or more parameters that the request requires are missing or not valid.developer.oanda.comchecked

Saxo OpenAPI

CodeMeaning, first sentenceSource
ActiveFollowerCannotDoManualTradeOpening or closing a position is not allowed on an active strategy account.developer.saxochecked
AlgoOrderTimeBeforeExchangeOpenAn algo order parameter carries a time before the exchange opens.developer.saxochecked
AmountBelowMinimumLotSizeThe order size is below the exchange's minimum lot size.developer.saxochecked
AmountCannotBeLessThanFilledAmountThe amount cannot be less than the amount already filled.developer.saxochecked
AmountNotInLotSizeThe order size is not a valid lot size for the exchange.developer.saxochecked
BlocksExistForOwnedContractsA block exists for the owned contract.developer.saxochecked
BreakoutUpPriceCannotBeLessThanDownPriceThe breakout up price cannot be less than the down price.developer.saxochecked
BrokerOptionSaxo's page describes this code only with the words Broker Option.developer.saxochecked
CashAmountLessThanMinInitialInvestmentAmountThe cash amount must be at least the minimum investment amount.developer.saxochecked
ClientCountrySanctionedThe user is disabled from trading because their country is sanctioned.developer.saxochecked
ClientExposureLimitationThe trade would take the client past an exposure limitation.developer.saxochecked
ClientNotEnabledForExtendedTradingHoursThe client is not enabled for trading in extended trading hours.developer.saxochecked
ClientOnReduceForcedExposureReductionViolationThe client is in the Reduce group type, so exposure cannot be increased.developer.saxochecked
ClosingPositionNotAllowedForMultiDayExecutionOrderA position that came from a multi-day order execution does not support an explicit closing order.developer.saxochecked
ClosingPositionNotAllowedOnJointExecutionModelClosing a position is not allowed for Trade Leaders.developer.saxochecked
ConditionDurationNotSupportedThe condition's duration is not supported for this asset type.developer.saxochecked
ConditionOnWrongSideOfMarketThe condition price is on the wrong side of the market.developer.saxochecked
ConditionPriceExceedsAggressiveToleranceThe condition price is beyond the aggressive tolerance.developer.saxochecked
ConditionTooFarFromMarketThe condition's limit price is too far from the market.developer.saxochecked
ContactExposureLimitationThe trade would take exposure past the cap set at contact level.developer.saxochecked
CouldNotCompleteRequestThe operation could not be completed and Saxo will not disclose why.developer.saxochecked
CrossCurrencyOrderOnMarginLendingAccountNotAllowedA cross currency order is not supported on a MarginLending account.developer.saxochecked
DealCaptureAllocationKeyNotCorrectThe deal capture allocation key is not correct.developer.saxochecked
DealCaptureInformationNotCorrectThe deal capture information is not correct.developer.saxochecked
DomainValidationErrorDomain validation of the request failed.developer.saxochecked
DurationNotSupportedThe duration supplied is not supported for this order.developer.saxochecked
ExpirationDateInPastThe expiration date is in the past.developer.saxochecked
ExpirationDateRequiredAn expiration date is mandatory for this type of order request.developer.saxochecked
ExplicitCloseNotAllowedForIntradayNettingClosing a position explicitly is not allowed when real-time netting is enabled.developer.saxochecked
ExtendedHoursTradingCannotBeChangedThe value for extended trading hours cannot be changed.developer.saxochecked
FeatureNotEnabledAn OpenAPI feature has been disabled through Saxo's Front Office.developer.saxochecked
ForcedExposureReductionViolationA forced exposure reduction rule would be broken.developer.saxochecked
ForceOpenNotAllowedForce open is not allowed.developer.saxochecked
ForwardDateInPastThe forward date is in the past.developer.saxochecked
ForwardDateRequiredA forward date is mandatory.developer.saxochecked
GtdOrderCannotBeLaterThanExpiryA good till date order cannot run later than the instrument's expiry.developer.saxochecked
HTTP 400Saxo rejected the request as sent: it was malformed or it broke a business rule.developer.saxochecked
IllegalAccountThe account is illegal for this request.developer.saxochecked
IllegalAmountThe amount is illegal for this request.developer.saxochecked
IllegalAssetTypeThe 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

CodeMeaning, first sentenceSource
400 Bad RequestTradeLocker 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

CodeMeaning, first sentenceSource
Bad filtering argumentsThe filtering arguments of a history request are not valid.docs.trading212.comchecked
Failed validationThe 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.

Where to go next