GET查询订单(按客户订单号)
请求
GET /openapi/v1/order/query
Query Parameters
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| customer_order_no | String | 是 | 客户端幂等键 |
响应示例
{
"code": 0,
"message": "success",
"data": {
"id": 12345,
"order_no": "NO_20240115143000001",
"customer_order_no": "ORD_20240115_0001",
"customer_mobile": "13800138000",
"product_id": 1001,
"biz_type": "RECHARGE",
"quantity": 1,
"official_amount": 100.00,
"final_amount": 98.50,
"order_status": "SUCCESS",
"status_desc": "交易成功",
"ret_para": "MB-20260115-001",
"pick_code": null,
"pick_up_code": null,
"callback_status": "SUCCESS",
"created_at": "2024-01-15T14:30:00+08:00"
}
}
字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| id | Long | 订单主键 |
| order_no | String | 平台订单号 |
| customer_order_no | String | 客户端幂等键 |
| customer_mobile | String | 受理手机号 |
| product_id | Long | 商品 ID |
| biz_type | String | 业务类型 |
| quantity | Integer | 数量 |
| official_amount | BigDecimal | 官方面值总额 |
| final_amount | BigDecimal | 实付总额 |
| order_status | String | 订单公开状态:PROCESSING / SUCCESS / FAILED,见 order_status |
| status_desc | String | 订单状态中文描述(与 order_status 对应) |
| express_name | String | 快递公司名(实物商品发货后返回;未发货为 null) |
| express_number | String | 运单号(实物商品发货后返回;未发货为 null) |
| shipped_at | String | 发货时间(ISO 8601 字符串;未发货为 null) |
| ret_para | String | 下单时传入的透传参数;部分业务会被处理结果凭证覆盖(到账流水号 / 客票号 / 取票码 / 取餐码 / 物流单号等,点餐多商品订单为最后到达的一行) |
| pick_code | String | 取餐码(仅点餐 FOOD 订单且已取得时返回):单商品=纯码(如 "619"),多商品=JSON 行号映射字符串(如 "{\"1\":\"619\"}");其他业务为 null |
| pick_up_code | String | 取餐二维码内容(仅点餐 FOOD 订单且上游回调携带时透传):上游 pickUpCode 原文(如 "arDglJyXAAk="),可据此渲染取餐二维码供用户扫码取餐;单商品=原文字符串,多商品=JSON 行号映射字符串;未取得为 null |
| callback_status | String | 平台回推客户回调的投递状态:NONE(无需回调) PENDING SUCCESS FAILED(失败重试中) CLOSED(重试终止) |
| created_at | OffsetDateTime | 创建时间(ISO 8601,含时区) |
GET订单分页列表
请求
GET /openapi/v1/order/list
Query Parameters
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| page_no | Integer | 是 | 页码,从 1 开始 |
| page_size | Integer | 是 | 每页大小,最大 100 |
| order_status | String | 否 | 订单状态筛选:推荐传公开值 PROCESSING / SUCCESS / FAILED;旧值别名 PAID / COMPLETED / CLOSED / REFUNDED / CANCELLED 仍兼容,其他值返回 30001 |
| start_date | String | 否 | 开始时间 yyyy-MM-dd |
| end_date | String | 否 | 结束时间 yyyy-MM-dd |
响应示例
{
"code": 0,
"message": "success",
"data": {
"records": [...], // 数组元素字段同「查询订单」接口的 data
"total": 50,
"page_no": 1,
"page_size": 20,
"total_pages": 3
}
}
GET订单详情(含状态流转日志)
请求
GET /openapi/v1/order/detail
Query Parameters
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| order_no | String | 是 | 平台订单号 |
响应示例
{
"code": 0,
"message": "success",
"data": {
"id": 12345,
"order_no": "NO_20240115143000001",
"customer_order_no": "ORD_20240115_0001",
"customer_mobile": "13800138000",
"product_id": 1001,
"biz_type": "RECHARGE",
"quantity": 1,
"official_amount": 100.00,
"base_sale_amount": 98.00,
"service_fee_amount": 0.50,
"final_amount": 98.50,
"order_status": "SUCCESS",
"callback_status": "SUCCESS",
"after_sale_status": "NONE",
"ret_para": "callback_data_123",
"pick_code": null,
"pick_up_code": null,
"ext_data": "{\"channel\":\"app\"}",
"fail_message": null,
"card_no": null,
"card_secret": null,
"created_at": "2024-01-15T14:30:00+08:00",
"completed_at": "2024-01-15T14:30:05+08:00",
"status_logs": [
{
"from_status": "PROCESSING",
"to_status": "SUCCESS",
"change_reason": "供应商回调成功",
"created_at": "2024-01-15T14:30:05+08:00"
}
]
}
}
字段说明(额外)
| 字段 | 类型 | 说明 |
|---|---|---|
| pick_code | String | 取餐码(仅点餐 FOOD 订单且已取得时返回):单商品=纯码,多商品=JSON 行号映射字符串;其他业务为 null |
| pick_up_code | String | 取餐二维码内容(仅点餐 FOOD 订单且上游回调携带时透传):上游 pickUpCode 原文,可据此渲染取餐二维码供用户扫码取餐;单商品=原文字符串,多商品=JSON 行号映射字符串;未取得为 null |
| card_no | String | 仅 CARD 业务 + 订单状态 SUCCESS 时返回:已提取卡密对应的卡号;其它业务/未成功为 null |
| card_secret | String | 仅 CARD 业务 + 订单成功类终态时返回:按订单解密的卡密明文(客户凭此取卡);其它业务/未成功为 null |
CARD 示例:卡密类订单成功后,详情返回
card_no/card_secret两个字段,例如"card_no": "JD_ECARD_1000001"、"card_secret": "6B2F9E3D8K"。 卡密为敏感信息,请通过订单详情接口按需拉取,不要在客户端本地留存。