查询预报单称重信息
汇星国际开放文档

查询预报单称重信息

按 po_number 查询预报单的称重数据(长宽高/重量),以及称重器拍摄的图片和预报单拍照图片。

预报单送达仓库后,仓库称重机会对称重包裹进行称重并回写长、宽、高、重量,同时拍摄称重图片。通过本接口可按 po_number 实时查询这些数据,用于租户侧对账、计费核对或问题件排查。

接口说明

方法GET
路径/open/v1/forecasts/weighing
鉴权ApiKey 鉴权

请求

请求头

请求头必填说明
X-Api-KeyApiKey,详见鉴权说明

查询参数

参数类型必填说明
po_numberstringPO 号(业务键,提交预报单时传入)

请求示例

curl 'https://open.test.huixingguoji.com/open/v1/forecasts/weighing?po_number=180401699' \
  -H 'X-Api-Key: YOUR_API_KEY'

响应

成功(HTTP 200)

{
  "code": "0",
  "message": "success",
  "data": {
    "po_number": "180401699",
    "status": 6,
    "length_cm": 35.5,
    "width_cm": 25.0,
    "height_cm": 18.2,
    "weight_kg": 4.26,
    "weighing_images": [
      {
        "id": 1024,
        "express_no": "180401699",
        "image_path": "storage/20260814/weigh_1024.jpg",
        "image_url": "https://open.huixingguoji.com/storage/20260814/weigh_1024.jpg",
        "file_size": 245760,
        "upload_time": "2026-08-14T16:03:05+08:00"
      }
    ],
    "forecast_images": [
      {
        "id": 88,
        "forecast_id": 1201,
        "image_type": "package",
        "image_url": "https://open.huixingguoji.com/storage/20260813/fc_88.jpg",
        "image_order": 1,
        "upload_source": "tenant"
      }
    ]
  }
}

字段说明

字段类型说明
po_numberstringPO 号
statusinteger预报单状态(1~7,见提交预报单状态说明)
length_cmnumber称重回写的长(cm);未称重为 null
width_cmnumber称重回写的宽(cm);未称重为 null
height_cmnumber称重回写的高(cm);未称重为 null
weight_kgnumber称重回写的重量(kg);未称重为 null
weighing_imagesarray称重器拍摄图片,最新在前;无图片为空数组
forecast_imagesarray预报单拍照图片,按 image_order 升序;无图片为空数组

weighing_images[] 节点字段:

字段类型说明
image_urlstring图片访问 URL
file_sizeinteger文件大小(字节)
upload_timestring上传时间(ISO8601)

forecast_images[] 节点字段:

字段类型说明
image_typestring图片类型:product 产品图 / package 包装图 / shipping 发货图 / document 单据图 / other 其他
image_urlstring图片访问 URL
image_orderinteger排序序号

仓库称重完成并通过 Webhook parcel.weighed 通知后,即可调用本接口获取称重数据;称重数据由仓库侧回写,存在短暂延迟属正常现象。

失败

常见错误码(完整列表见错误码):

错误码含义触发场景
42201字段校验失败未携带 po_number
40401包裹不存在po_number 不存在或不属于当前租户