get_logistics — 物流轨迹
查询已发货订单的快递全程轨迹。发货事件出现后再调用。
何时用
订单出现 shipped 事件后;用户问"到哪了"时。轨迹中间节点不必主动推送,签收与发货节点才播报(防打扰)。
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| order_no | string | 是 | 订单号 |
响应
waybill_no(运单号)/express_co(快递公司)/traces[](time+context 全程轨迹)。
示例
curl
curl "https://api.yuantoutao.com/v1/orders/YM20261003100003/logistics" \
-H "Authorization: Bearer ak_你的key"
node
const tr = await (await fetch(`https://api.yuantoutao.com/v1/orders/${orderNo}/logistics`, {
headers: { Authorization: `Bearer ${KEY}` }
})).json();
python
tr = requests.get(f'https://api.yuantoutao.com/v1/orders/{order_no}/logistics',
headers={'Authorization': f'Bearer {KEY}'}).json()
常见错误
INVALID_PARAM(订单未发货——先看状态机)。