分拣机接口

请求URI:
SIT: wms.qa.xiyou56.com
PRO: https://w.westernfulfill.com/

所有请求西邮接口增加请求头
header appKey:待提供

统一响应格式

data = Object
{
  "success": true,
  "message": "message_488d0c9a9f1e",
  "data": [],
  "code": 200
}





前端调分拣机

1.连接分拣机

西邮——>分拣机

request:

http://localhost:xxxx/xxx/xx

Response Data

[
    {
        "uniqId":"A-001",
        "grid_no":"1",
        "container_no":"1",
        "status":"1"
    },
    {
        "uniqId":"A-001"
        "grid_no":"2",
        "container_no":"2",
        "status":"2"
    }
]
参数 类型 说明
uniqId String 分拣机唯一码
grid_no String 格口
container_no String 容器号
status Integer 格口状态 1.空闲 2.已绑定容器 3.满箱

2.格口绑定/解绑容器推送分拣机

西邮——>分拣机
URL: 待提供

request:

参数 类型 说明
uniqId String 分拣机唯一码
grid_no String 格口
container_no String 容器号
type Integer 操作类型 1绑定 2解绑
carrier String 承运商
scCode String 物流渠道

json示例:

{
    "uniqId":"A-001"
    "grid_no": "1",
    "container_no": "IN-2025-08-01",
    "type":1
    "carrier": "UPS",
    "scCode": "UPS_GROUND",
}

3.包裹推送

西邮——>分拣机
URL: /xiyou/package/push

request:

参数 类型 说明
uniqId String 分拣机唯一码
grid_no String 格口
tracking_number String 包裹号
length Double 包裹长
width Double 包裹宽
height Double 包裹高
weight Double 包裹重量
length_in Double 包裹长(IN)
width_in Double 包裹宽(IN)
height_in Double 包裹高(IN)
weight_lb Double 包裹重量(LB)
length_threshold Double 包裹长阈值
width_threshold Double 包裹宽阈值
height_threshold Double 包裹高阈值
weight_threshold Double 包裹重量阈值
threshold_type Integer 阈值类型 1百分比 2差值
to_abnormal Integer 是否进入异常格口 1是 0否

json示例:

{
  "uniqId":"A-001"
  "grid_no": "G001",
  "tracking_number": "PKG123456789",
  "length": 30.5,
  "width": 20.0,
  "height": 15.0,
  "weight": 2.35,
  "length_threshold": 32.0,
  "width_threshold": 21.0,
  "height_threshold": 16.0,
  "weight_threshold": 2.5,
  "threshold_type": 1,
  "to_abnormal":1
}

4.包裹号截取规则

西邮->分拣机
URI:待提供

request:

参数 类型 说明
totalLength Integer 总长度
startPosition Integer 起始位置
endPosition Integer 结束位置

json示例:

[
    {
      "totalLength": 34,
      "startPosition": 2,
      "endPosition": 14
    }
]
示例:
存在系统记录跟踪号与实际面单跟踪号长度不一致需要截取匹配
面单识别的跟踪号:"1234567890123456789012345678901234"; // 长度34
截取开始:2
截取结束:14
结果:345678901234





西邮对外分拣机API

1.格口解绑

分拣机——>西邮
URL: /system/config/sorter/unbundling

request:

参数 类型 是否必填 说明
uniqId String 分拣机唯一码
grid_no String 格口
container_no String 容器号
type Integer 操作类型 1满箱 2解绑

json示例:

{
    "uniqId":"A-001"
    "grid_no": "1",
    "container_no": "IN-2025-08-01"
    "type": 1
}

2.分拣结果接收

分拣机——>西邮
URL: /system/config/sorter/result/accept

request:

参数 类型 说明
uniqId String 分拣机唯一码
grid_no String 格口
container_no String 容器号
tracking_number String 包裹号
length Double 包裹长(cm)
width Double 包裹宽(cm)
height Double 包裹高(cm)
weight Double 包裹重量(kg)
length_in Double 包裹长(IN)
width_in Double 包裹宽(IN)
height_in Double 包裹高(IN)
weight_lb Double 包裹重量(LB)
actual_length Double 包裹实际长
actual_width Double 包裹实际宽
actual_height Double 包裹实际高
actual_weight Double 包裹实际重量
length_threshold Double 包裹长差异百分比/差值
width_threshold Double 包裹宽差异百分比/差值
height_threshold Double 包裹高差异百分比/差值
weight_threshold Double 包裹重量差异百分比/差值
threshold_type Integer 阈值类型 1百分比 2差值
abnormal_remark String 异常说明

json示例:

{
  "uniqId":"A-001"
  "grid_no": "G001",
  "container_no": "C123456",
  "tracking_number": "PKG123456789",
  "length": 30.5,
  "width": 20.0,
  "height": 15.0,
  "weight": 2.35,
  "actual_length": 31.0,
  "actual_width": 20.5,
  "actual_height": 15.2,
  "actual_weight": 2.4,
  "length_threshold": 32.0,
  "width_threshold": 21.0,
  "height_threshold": 16.0,
  "weight_threshold": 2.5,
  "threshold_type": 1,
  "abnormal_remark": "识别失败"
}
计算公式:
结果忽略正负比较
百分比差异


差值