成功响应遵循统一结构;失败时 data 可为空,msg 为具体错误描述。
{
"code": 0,
"msg": "",
"traceId": "tr-77ab0e42",
"data": {
"id": 1001,
"order_no": "ORD20261119001",
"status": "paid",
"total_cents": 29900,
"discount_cents": 2990,
"payable_cents": 26910,
"created_at": "2026-11-19 10:08:12",
"paid_at": "2026-11-19 10:09:03"
}
}{
"code": 40100,
"msg": "签名校验失败",
"traceId": "tr-8f3c21a0"
}顶层字段说明
| 字段 / 项 | 类型 / 取值 | 说明 |
|---|---|---|
| code | int | 0 成功;非 0 见「状态码与错误码」章节。 |
| data | object / array | 业务数据;列表接口同时返回 page / size / total。 |
| msg | string | 成功为空串;失败为可直接展示的中文提示。 |
| traceId | string | 全链路追踪 ID,排障必备。 |
查看全部错误码 →HTTP 状态码与业务 code 需同时判断。
九天