Skip to content
Sign up

Get started

Errors

Every error is JSON with a stable code to switch on, and the status tells you whose move it is.

Format#

The error field holds the code, in snake case. Validation errors add issues: one for each field that failed, with its path and what was wrong.

JSON
{
  "error": "invalid_request",
  "issues": [
    {
      "path": "symbol",
      "message": "Invalid input: expected string, received undefined"
    }
  ]
}

Codes#

StatusErrorMeaning
400invalid_requestA parameter is missing or out of range; issues says which.
400insufficient_balanceThe balance can't cover it, fees included.
400market_closedThe market is closed. Shares and commodities trade in their exchange's hours, currency pairs on weekdays.
400too_smallAn order or conversion under its minimum, €10 for most.
400below_minimumAn Earn amount or a recurring buy under its product's minimum.
400order_closedThe order has already filled or been cancelled.
401invalid_signatureThe request isn't signed correctly; see Authentication.
403permission_deniedThe key can't do this, or the account is frozen or closed.
403verification_requiredThe account's identity isn't verified yet.
403restrictedOur team has paused this on the account.
403trading_pausedTrading is paused for everyone for a moment.
403main_account_onlyA sub-account's key asked for something only the main account has.
403risk_ack_requiredConfirm the leveraged-forex risk once on the site first.
404not_foundThe symbol, order, plan or position doesn't exist, or isn't yours.
429rate_limitedToo many requests; see Rate limits.
500internal_errorSomething failed on our side, and we're alerted the moment it happens.
503maintenanceA short maintenance window: reads still answer, writes wait. Retry with backoff.
503unpricedNo live price for the instrument at this moment. Retry shortly.

Retrying#

  • Retry 429 after the seconds in Retry-After.
  • Retry 500 and 503 with exponential backoff, starting at one second.
  • Don't resend a 4xx unchanged: the same request gets the same answer.
  • Give every order a clientOrderId. If you retry after a timeout, an order with an id we've already seen is never placed twice.