错误码
两种错误格式 — 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。 |
409 | idempotency_key 撞车。 |
422 | 余额不足。 |
500 | DB 错误或后端异常。 |
502 | 下游服务(撮合 / bridge / funding-scheduler)不可达。 |
503 | Trading service 挂掉。 |
504 | 下游 gRPC 超时。 |
FAPI
HTTP/1.1 422 Unprocessable Entity
content-type: application/json
{ "code": -2010, "msg": "Account has insufficient balance for requested action." }
| HTTP | code | msg |
|---|---|---|
500 | -1000 | An unknown error occurred while processing the request. |
401 | -1021 | Timestamp for this request is outside of the recvWindow. |
401 | -1022 | Signature for this request is not valid. |
400 | -1100 | Illegal characters in parameter(也用于未知 symbol、非法 side、不支持的 type)。 |
400 | -1102 | Mandatory parameter missing/empty(缺 signature 也是这个)。 |
422 | -2010 | Insufficient balance. |
422 | -2011 | Order does not exist. |
400 | -2014 | API-key format invalid. |
401 | -2015 | Invalid API-key / IP / permissions. |
常见误区
-1021— 时钟漂了。先用date -u校验,修 NTP 而不是调大recvWindow。-1022— secret 错、参数顺序对不上、缺signature=前缀。可对 标准签名向量 比对。-2010— 可用 USDC < 所需notional / LEVERAGE_V1。查余额。- 刚下单就
-2011— 竞态(下单→瞬间成交→查询)。当成「已经完成」处理。