#### 
## <font style="background-color:#52C41A;"> </font> 功能说明
:::tips
<font style="color:black;">使用</font>**<font style="color:black;">快递单号直接查询</font>**<font style="color:black;">轨迹信息</font>

:::

[快递查询-快速入门](https://www.yuque.com/kdnjishuzhichi/tcyzry/diyqk8gpq0t9stex)👈

<font style="background-color:#52C41A;"></font>

<font style="background-color:#52C41A;"> </font> **与**[**即时查询**](https://www.yuque.com/kdnjishuzhichi/dfcrg1/yv7zgv)<font style="color:#595959;">(RequestType：8001)</font>**的区别**

:::tips
+ **无需**传快递编码_<font style="color:#595959;">（ShipperCode）</font>_**自动识别单号**所属快递公司
+ 若ShipperCode传值快递公司编码，则按照传值的快递编码获取物流信息
+ 计费方式不同

<font style="color:#585A5A;">      （8001按单计算 / 8002按次计算）</font>

:::



## <font style="background-color:#52C41A;"> </font> 支持情况
[单号识别支持的快递公司](https://www.yuque.com/kdnjishuzhichi/weubcu/yw4s6x1gbxsxadsp)

## <font style="background-color:#52C41A;"> </font> 接口信息
| **RequestType **<font style="color:#585A5A;">接口指令</font> | **<font style="color:#0070C0;">8002</font>** |
| --- | --- |
| **<font style="color:black;">批量请求</font>** | <font style="color:black;">不支持</font>，并发不超过 20次/S |
| **<font style="color:black;">计费规则</font>** | <font style="color:black;">按请求成功</font>**<font style="color:black;">次数</font>**<font style="color:black;">计算。返回无轨迹不做计费</font> |
| **轨迹排序** | 按照发生时间的升序排列 |
| **<font style="color:black;">接口地址</font>** | https://api.kdniao.com/api/dist |


_<font style="color:#585A5A;">如您第一次使用快递鸟，请参考</font>_[_<font style="color:#117CEE;">API参数示意图</font>_](https://www.yuque.com/kdnjishuzhichi/dfcrg1/hl2gthcuqft7rm34)



**<font style="color:rgb(38, 38, 38);background-color:#52C41A;"> </font>****<font style="color:rgb(38, 38, 38);"> 请求示例</font>**<font style="color:rgb(38, 38, 38);"></font>

```json
{"LogisticCode": "638650888018"}
```

```json
{
"CustomerName": "1234",
"LogisticCode": "SF00003618100"
}
```

<font style="color:rgb(38, 38, 38);"></font>

###  <font style="background-color:#1890FF;"> </font> 应用级参数
| **<font style="color:#FFFFFF;">名称</font>** | **<font style="color:#FFFFFF;">类型(长度)</font>** | **<font style="color:#FFFFFF;">是否必须</font>** | **<font style="color:#FFFFFF;">描述</font>** |
| --- | --- | --- | --- |
| LogisticCode | <font style="color:#585A5A;">String(30)</font> | - [x] <font style="color:black;"></font> | 快递单号 |
| <font style="color:black;">CustomerName</font> | <font style="color:#585A5A;">String(50)</font> | <font style="background:#F8CED3;color:#70000D">顺丰必填</font><br/><font style="background:#C0DDFC;color:#00346B">跨越必填</font><br/><font style="background:#C0CAFC;color:#101E60">中通必填</font> | 寄件人or收件人 **手机号\座机号后四位**<br/>:::danger + 尽量使用**寄件人**尾号<br/>+ 顺丰**可能**用**虚拟号**下单录入系统  作为验证标准<br/>+ 后四位**传值错误无法获取**到轨迹（可能拉取**缓存**）<br/>+ 顺丰后四位正确性可通过微信小程序【顺丰速运+】验证<br/>+ 顺丰/中通开启隐私保护的订单需要使用寄件人手机尾号或者是隐私号码验证<br/>+ 中通仅支持查询签收后**6个月**内的单号<br/>:::  |
| | | <font style="background:#F6E1AC;color:#664900">菜鸟橙运</font> | 菜鸟橙运分配的**<font style="color:#101E60;">货主编号</font>** |
| <font style="color:black;">Sort</font> | <font style="color:#585A5A;">Int(1)</font> | - [ ]  | <font style="color:black;">轨迹按时间排序，0-升序，1-降序，默认0</font> |
| OrderCode | <font style="color:#585A5A;">String(30)</font> | - [ ]  | 订单编号 |
| ShipperCode | <font style="color:#585A5A;">String(10)</font> | - [ ]  | [《快递公司编码》](https://www.yuque.com/kdnjishuzhichi/dfcrg1/mza2ln) |




## <font style="background-color:#52C41A;"> </font> 返回参数
当接口返回无轨迹时请参考下表中的**物流状态**和返回**reason**进行处理

| **<font style="color:#FFFFFF;">名称</font>** | **<font style="color:#FFFFFF;">类型</font>****<font style="color:#FFFFFF;">(</font>****<font style="color:#FFFFFF;">字符长度</font>****<font style="color:#FFFFFF;">)</font>** | **<font style="color:#FFFFFF;">是否必须</font>** | **<font style="color:#FFFFFF;">描述</font>** |
| --- | --- | :---: | --- |
| EBusinessID | <font style="color:#585A5A;">String(10)</font> | - [x]  | 用户ID |
| ShipperCode | <font style="color:#585A5A;">String(10)</font> | - [x]  | [快递公司编码](https://www.yuque.com/kdnjishuzhichi/dfcrg1/mza2ln) |
| LogisticCode | <font style="color:#585A5A;">String(30)</font> | - [x]  | 快递单号 |
| Success | <font style="color:#585A5A;">Bool</font><font style="color:#585A5A;">(10)</font> | - [x]  | 成功与否<font style="color:#585A5A;">(true/false)</font> |
| Reason | <font style="color:#585A5A;">String(50)</font> | - [ ]  | 失败原因 |
| State | <font style="color:#585A5A;">String(5)</font> | - [x] <font style="color:black;"></font> | [普通物流状态（点击查看）](https://www.yuque.com/kdnjishuzhichi/weubcu/yftcgpzg81sxwigh) |
| StateEx | <font style="color:#585A5A;">String(5)</font> | - [x]  | [详细物流状态（点击查看）](https://www.yuque.com/kdnjishuzhichi/weubcu/cti4czvp8hnatgue) |
| Location | <font style="color:#585A5A;">String(20)</font> | - [x]  | 当前所在城市 |
| Traces.<font style="color:#5C8D07;">AcceptTime</font> | <font style="color:#585A5A;">String(32)</font> | - [x]  | 轨迹发生时间，示例：<br/><font style="color:#585A5A;">Thu Mar 30 05:37:57 CST 2023</font> |
| Traces.<font style="color:#5C8D07;">AcceptStation</font> | <font style="color:#585A5A;">String(500)</font> | - [x]  | 轨迹描述 |
| <font style="color:black;">Traces</font><font style="color:#5C8D07;">.Location</font> | <font style="color:#585A5A;">String(20)</font> | - [ ]  | <font style="color:black;">历史节点所在城市</font> |
| Traces.<font style="color:#5C8D07;">Action</font> | <font style="color:#585A5A;">String(50)</font> | - [x]  | 同 **StateEx** |
| Traces.<font style="color:#5C8D07;">Remark</font> | <font style="color:#585A5A;">String(20)</font> | - [ ]  | 备注 |
| OrderCode | <font style="color:#585A5A;">String(30)</font> | - [ ]  | 订单编号 |
| Callback | <font style="color:#585A5A;">String</font><font style="color:#585A5A;">(50)</font> | - [ ]  | 用户自定义回传字段 |
| Station | <font style="color:#585A5A;">String(50)</font> | - [ ]  | 派件网点的名称 |
| StationTel | <font style="color:#585A5A;">String(50)</font> | - [ ]  | 派件网点的电话 |
| ~~StationAdd~~ | ~~<font style="color:#585A5A;">String(50)</font>~~ | - [ ] ~~~~ | ~~派件网点的地址~~ |
| DeliveryMan | <font style="color:#585A5A;">String(50)</font> | - [ ]  | 派件快递员 |
| DeliveryManTel | <font style="color:#585A5A;">String(50)</font> | - [ ]  | 派件快递员手机号 |
| NextCity | <font style="color:#585A5A;">String(50)</font> | - [ ]  | 下一站城市 |


```json
{
  "EBusinessID": "1237100",
  "ShipperCode": "YD",
  "Success": true,
  "LogisticCode": "390141793061",
  "State": "3",
  "StateEx": "304",
  "Location": "威海市",
  "Traces": [
    {
      "AcceptTime": "Thu Mar 26 15:37:57 CST 2023",
      "AcceptStation": "【北京环铁站】的【互优图书】已收件",
      "Location": "北京市",
      "Action": "1"
    },
    {
      "AcceptTime": "Thu Mar 27 04:37:57 CST 2023",
      "AcceptStation": "快件在【北京环铁站】装车,正发往【北京分拨中心】",
      "Location": "北京市",
      "Action": "2"
    },
    {
      "AcceptTime": "Thu Mar 27 05:37:57 CST 2023",
      "AcceptStation": "快件到达【北京分拨中心】,上一站是【北京环铁站】",
      "Location": "北京市",
      "Action": "2"
    },
    {
      "AcceptTime": "Thu Mar 28 05:37:57 CST 2023",
      "AcceptStation": "快件在【北京分拨中心】装车,正发往【青州分拨中心】",
      "Location": "北京市",
      "Action": "2"
    },
    {
      "AcceptTime": "Thu Mar 29 03:37:57 CST 2023",
      "AcceptStation": "快件到达【青州分拨中心】,上一站是【北京分拨中心】",
      "Location": "潍坊市",
      "Action": "2"
    },
    {
      "AcceptTime": "Thu Mar 29 05:37:57 CST 2023",
      "AcceptStation": "快件在【青州分拨中心】装车,正发往【威海】",
      "Location": "潍坊市",
      "Action": "2"
    },
    {
      "AcceptTime": "Thu Mar 30 03:37:57 CST 2023",
      "AcceptStation": "快件到达【威海】,上一站是【青州分拨中心】",
      "Location": "威海市",
      "Action": "2"
    },
    {
      "AcceptTime": "Thu Mar 30 05:37:57 CST 2023",
      "AcceptStation": "【威海】的【王奕凯】正在派件",
      "Location": "威海市",
      "Action": "202"
    },
    {
      "AcceptTime": "Thu Mar 30 06:37:57 CST 2023",
      "AcceptStation": "已签收,签收人是【毕森】,签收网点是【威海】",
      "Location": "威海市",
      "Action": "3"
    }
  ]
}
```

```json
{
    "StateEx": "0",
    "LogisticCode": "YT4841733297274",
    "ShipperCode": "YTO",
    "Traces": [],
    "State": "0",
    "EBusinessID": "1617571",
    "Reason": "暂无轨迹信息",
    "Success": true
}
```

