# 查询订单信息
## 1、基本信息
请求API名称:orderQuery
接口描述:根据接入方订单编号,查询订单的状态 、配送员信息等
## 2、请求参数
| 字段名 | 类型 | 是否必填 | 示例 | 描述 |
| --- | --- | --- | --- | --- |
|ordersn_third| String | 是 | 2020103012000012345678 | 接入方订单编号 |
请求示例:
{
"ordersn_third": "2020103012000012345678"
}
## 3、响应结果
| 字段名 | 类型 | 示例 | 描述 |
| --- | --- | --- | --- | --- |
|id|String|1|啦啦外卖订单自增ID|
|ordersn|String| 20200728144905060634|啦啦外卖订单编号|
|goods_price|String|10.5|订单商品价格|
|goods_weight|String|2.3|商品重量|
|buy_username|String|张三|取货联系人|
|buy_sex|String|男|取货联系人性别|
|buy_mobile|String|15364816001|取货联系电话|
|buy_address|String|山西省太原市|取货详细地址|
|buy_location_x|String|37.957075|取货地址纬度|
|buy_location_y|String|112.539401|取货地址经度|
|accept_username|String|李四|收货人姓名|
|accept_sex|String|1|收货人性别|
|accept_mobile|String|15364816002|收货人电话|
|accept_address|String|山西省太原市|收货人详细地址|
|accept_location_x|String|37.791148|收货地址纬度|
|accept_location_y|String|112.57779|收货地址经度|
|distance|String|26.137|配送距离 单位km|
|delivery_time|String|2020-07-28 12:30|预计送达时间|
|delivery_status|String|4|配送状态码 见附录|
|delivery_status_cn|String|已完成|配送状态码说明|
|status_cn|String|已完成|订单状态中文说明|
|deliveryer_id|String|16|配送员ID|
|status|String|3|订单状态码 见附录|
|is_pay|String|1|是否已支付 1已付 0未付|
|addtime|String|1595918945|订单创建时间戳|
|paytime|String|1595918945|订单支付时间戳|
|delivery_assign_time|String|1595918956|配送员接单时间戳|
|delivery_success_time|String|1595918963|配送完成时的时间戳|
|delivery_success_location_x|String|37.791461|配送完成时配送员所在位置的纬度|
|delivery_success_location_y|String|112.575363|配送完成时配送员所在位置的经度|
|delivery_fee|String|73.42|配送费|
|delivery_tips|String|4|配送小费|
|total_fee|String|77.42|订单总金额|
|discount_fee|String|0|订单优惠金额|
|final_fee|String|77.42|订单实际支付金额|
|note|String|不要辣椒|订单备注|
|log|Array||当前订单状态日志|
|logs|Array||订单状态日志列表|
|deliveryer|Array||配送员信息|
log、logs字段说明
| 字段名 | 类型 | 示例 | 描述 |
| --- | --- | --- | --- | --- |
|id|String|1|订单日志自增ID|
|oid|String|1|日志对应的订单ID|
|status|String|4|订单状态码|
|title|String|已完成|订单状态说明|
|addtime|String|1595918963|记录日志的时间戳|
deliveryer字段说明
| 字段名 | 类型 | 示例 | 描述 |
| --- | --- | --- | --- | --- |
|id|String|16|配送员ID|
|title|String|王五|配送员姓名|
|sex|String|男|配送员性别|
|mobile|String|15364816003|配送员手机号|
|location_x|String|37.791461|配送员最近一次上传位置的纬度坐标|
|location_y|String|112.575363|配送员最近一次上传位置的经度坐标|
正确响应结果示例:
{
"errno": 0,
"message": {
"id": "166",
"order_sn": "20200728144905060634",
"goods_price": "10.5",
"goods_weight": "2.3",
"buy_username": "张三",
"buy_sex": "1",
"buy_mobile": "15364816001",
"buy_address": "山西省太原市",
"buy_location_x": "37.957075",
"buy_location_y": "112.539401",
"accept_username": "李四",
"accept_sex": "1",
"accept_mobile": "15364816002",
"accept_address": "山西省太原市",
"accept_location_x": "37.791148",
"accept_location_y": "112.57779",
"distance": "26.137",
"delivery_time": "2020-07-28 12:30",
"delivery_status": "4",
"deliveryer_id": "16",
"status": "4",
"is_pay": "1",
"addtime": "1595918945",
"paytime": "1595918945",
"delivery_assign_time": "1595918956",
"delivery_success_time: "1595918963",
"delivery_success_location_x": "37.791461",
"delivery_success_location_y": "112.575363",
"delivery_fee": "73.42",
"delivery_tips": "4",
"total_fee": "77.42",
"discount_fee": "0",
"final_fee": "77.42",
"note": "不要辣椒",
"status_cn": "已完成",
"delivery_status_cn": "已完成",
"log": {
"id": "1150",
"oid": "166",
"status": "4",
"title": "订单已完成",
"addtime": "1595918963"
},
"logs": [{
"id": "1145",
"oid": "166",
"status": "1",
"title": "订单提交成功",
"addtime": "14:49"
}, {
"id": "1146",
"oid": "166",
"status": "1",
"title": "待支付",
"addtime": "14:49"
}, {
"id": "1147",
"oid": "166",
"status": "2",
"title": "订单已支付",
"addtime": "14:49"
}, {
"id": "1148",
"oid": "166",
"status": "1",
"title": "待接单",
"addtime": "14:49"
}, {
"id": "1149",
"oid": "166",
"status": "3",
"title": "已接单",
"addtime": "14:49"
}, {
"id": "1150",
"oid": "166",
"status": "5",
"title": "订单已完成",
"addtime": "14:49"
}],
"deliveryer": {
"id": "16",
"title": "王五",
"sex": "男",
"mobile": "15364816003",
"location_x": "37.791461",
"location_y": "112.57536315918"
}
}
}
错误响应结果示例:
{
"errno": -1,
"message": "订单编号不能为空"
}
## 附录
#### 订单状态码 status
|状态码|状态名|说明|
| --- | --- | --- | --- | --- | --- |
|1|待接单|正在调度、分配或者等待配送员接单|
|2|已接单|配送员已接单|
|3|已完成|订单配送完成|
|4|已取消|订单取消|
#### 订单配送状态码 delivery_status
|状态码|状态名|说明|
| --- | --- | --- | --- | --- | --- |
|1|待接单|等待配送员接单|
|2|待取货|配送员已接单,正在取货途中|
|3|配送中|配送员已取货,正在配送|
|4|已完成|配送员配送完成|