跳转到内容

仓库与库位 ​

本页说明如何查询您可用的仓库、仓库详情,仓库方如何查询库位与库区,以及客户信息接口。

接口一览 ​

方法路径用途scopeKey 类型
GET/open-api/v1/warehouse/list可见仓库列表warehouse:read货主 / 仓库
GET/open-api/v1/warehouse/{id}仓库基础详情warehouse:read货主 / 仓库
GET/open-api/v1/warehouse/detail/{id}仓库完整详情warehouse:read货主 / 仓库
GET/open-api/v1/location/list库位分页location:read仅仓库
GET/open-api/v1/location/{id}库位详情location:read仅仓库
GET/open-api/v1/location/zones按仓列库区location:read仅仓库
GET/open-api/v1/customer/list客户列表customer:read货主 / 仓库
GET/open-api/v1/customer/{id}客户详情customer:read货主 / 仓库
GET/open-api/v1/customer/warehouses客户绑定的仓库customer:read货主 / 仓库

可见仓库列表 ​

GET /open-api/v1/warehouse/list

只返回当前 Key 可见的仓库:货主 Key = 您当前可用的仓;仓库 Key = 本企业的仓或指定的仓。不分页,一次返回全部。

参数必填说明
warehouseCode否包含匹配,不区分大小写
warehouseName否包含匹配
status否仓库状态

主要返回字段:id、warehouseCode、warehouseName、warehouseNameEn、warehouseType、partnerType、locationType、status、country、state、city、postalCode、address、companyName、contactName、contactPhone、contactEmail。

bash
curl https://api.vmwms.com/open-api/v1/warehouse/list -H "x-api-key: <YOUR_API_KEY>.<YOUR_API_SECRET>"
json
{
  "total": 1,
  "rows": [
    {
      "id": "1800000000000000101",
      "warehouseCode": "DEMO-CA1",
      "warehouseName": "Demo Warehouse",
      "country": "US",
      "state": "CA",
      "city": "Ontario",
      "postalCode": "91761",
      "address": "123 Example Rd"
    }
  ],
  "code": 200,
  "msg": "查询成功"
}

下单、入库预报时的 warehouseId 取 id,warehouseCode 取 warehouseCode。

仓库详情 ​

  • GET /open-api/v1/warehouse/{id}:基础字段。
  • GET /open-api/v1/warehouse/detail/{id}:基础字段外,另含 imgList(仓库图片)、whContent(仓库介绍)、priceObj / priceJson(价格信息)。

仓库不可见时返回 code 404「数据不存在」。

库位与库区(仅仓库 Key) ​

货主 Key 调用以下接口会返回 code 403「该接口需要仓库(仓库管理员 / 库管)API Key」。

库位分页 ​

GET /open-api/v1/location/list

参数说明
warehouseId仓库 ID
zoneId库区 ID
locationCode库位编码,模糊
status0 停用 / 1 启用
pageNum / pageSize

主要返回字段:id、warehouseId、warehouseCode、zoneId、locationCode、locationType、status、pArea(片区)、totalStock(库位当前库存)。

bash
curl "https://api.vmwms.com/open-api/v1/location/list?warehouseId=<WAREHOUSE_ID>&pageSize=200" \
  -H "x-api-key: <YOUR_STAFF_API_KEY>.<YOUR_STAFF_API_SECRET>"

库位详情 ​

GET /open-api/v1/location/{id},库位不在可见仓时返回 code 404。

按仓列库区 ​

GET /open-api/v1/location/zones?warehouseId=<WAREHOUSE_ID>

返回 data 数组,每项含 id、warehouseId、zoneCode、zoneName、zoneType、status、zoneCategory。

客户信息 ​

客户列表 ​

GET /open-api/v1/customer/list

  • 货主 Key:固定只返回您自己一条,过滤条件无效。
  • 仓库 Key:返回可见仓下的货主,可按 keyword(编码 / 账号 / 名称 / 公司模糊)、status(0 停用 / 1 启用)过滤并分页。

主要返回字段:id、customerCode、customerName、companyName、skuPrefix、status、warehouseNames。

客户详情 ​

GET /open-api/v1/customer/{id},货主 Key 只能查自己的 ID,其它返回 code 404。

客户绑定的仓库 ​

GET /open-api/v1/customer/warehouses

参数说明
customerId仓库 Key 必传;货主 Key 忽略此参数,固定查自己

返回 data 数组,每项含 id、customerId、warehouseId、warehouseCode、warehouseName、startTime、endTime、status。仓库 Key 未传 customerId 时提示「customerId 不能为空」。

常见问题 ​

为什么仓库列表里没有我想发货的仓 ​

仓库列表只返回您当前已开通、可用的仓。需要使用新仓库,请先联系仓库开通,开通后即可在列表中看到。

调用库位接口提示「该接口需要仓库(仓库管理员 / 库管)API Key」 ​

库位、库区属于仓库内部作业数据,只对仓库方 Key 开放,货主 Key 无法调用。

仓库列表能分页吗 ​

不能,也不需要。该接口一次返回全部可见仓库,pageNum / pageSize 无效。