跳到主要内容

错误码

两种错误格式 — Web v1 plain text,FAPI 标准 JSON。按调用接口选择对应表格。

Web v1

HTTP/1.1 400 Bad Request
content-type: text/plain

side must be BUY or SELL
HTTP典型原因
400参数校验失败:side 非法、UUID 错、低于 min_qty、价格不是 tick 倍数、未知 candles interval
401缺鉴权 / 鉴权失败(后续 auth 完成后启用)。
403资源属于其他用户。
404未知 order_id / withdrawal_id / symbol
409idempotency_key 撞车。
422余额不足。
500DB 错误或后端异常。
502下游服务(撮合 / bridge / funding-scheduler)不可达。
503Trading service 挂掉。
504下游 gRPC 超时。

FAPI

HTTP/1.1 422 Unprocessable Entity
content-type: application/json

{ "code": -2010, "msg": "Account has insufficient balance for requested action." }
HTTPcodemsg
500-1000An unknown error occurred while processing the request.
401-1021Timestamp for this request is outside of the recvWindow.
401-1022Signature for this request is not valid.
400-1100Illegal characters in parameter(也用于未知 symbol、非法 side、不支持的 type)。
400-1102Mandatory parameter missing/empty(缺 signature 也是这个)。
422-2010Insufficient balance.
422-2011Order does not exist.
400-2014API-key format invalid.
401-2015Invalid API-key / IP / permissions.

常见误区

  • -1021 — 时钟漂了。先用 date -u 校验,修 NTP 而不是调大 recvWindow
  • -1022 — secret 错、参数顺序对不上、缺 signature= 前缀。可对 标准签名向量 比对。
  • -2010 — 可用 USDC < 所需 notional / LEVERAGE_V1。查余额。
  • 刚下单就 -2011 — 竞态(下单→瞬间成交→查询)。当成「已经完成」处理。