2.6 常见对接错误对照表
业务错误 HTTP 状态码均为
200,请以code判断,不要依赖 HTTP 状态码。
| HTTP | code | message | 原因 |
|---|---|---|---|
| 200 | 0 | success(但响应字段全为空字符串) | 客户端使用了 camelCase 解析;响应固定 snake_case,需调整 JSON tag |
| 200 | 10000 | authentication failed | 签名 / X-Body-Hash 不一致。GET 须用 sha256("{}");POST 须用 body 的 JCS hash |
| 200 | 10000 | missing body-hash in metadata | 未传 X-Body-Hash header |
| 200 | 10020 | ticket_id is required / invalid ticket_id format | 缺少 ticket_id 或非 UUID 格式 |
| 200 | 10020 | — | 时间须为 RFC3339 UTC(例 2026-05-19T00:00:00Z),非毫秒时间戳 |
| 200 | 10030 | ... not found | 查询对象不存在,或不属于该 agent |
| 200 | 10060 | rate limit exceeded | 超过该接口每分钟速率限制 |
| 200 | 10080 | internal server error | 服务器内部错误 |
| 200 | 20160 | insufficient balance | 玩家余额不足,无法完成转出 |
| 4xx | — | — | HTML 错误页,请求未通过 gateway(IP 未加白名单、Content-Type 不正确、GET 带了 body 等) |
大多数签名问题都源自 HMAC 验证流程 中 body 规范化或
X-Body-Hash的处理,遇到10000优先排查这两项。