Skip to content

库存列表 ​

POST/channel/api/v1/inventory/list

Auth: request-token (channel_partner)

返回当前认证渠道伙伴可见库存的分页列表,按 sku_id + 仓库聚合。默认仅包含 owner_member_id 与令牌解析成员一致的库存行;若已授予 platform_stock 能力,还会包含平台自有库存(owner_member_id 为 NULL)。

所需能力: inventory_view(缺少时返回 606)。如需查看平台库存,另需 platform_stock。

请求头 ​

请求头必填说明
request-token是渠道伙伴应用令牌
Content-Type是application/json

请求体 ​

字段类型必填说明
pageNumberinteger否页码,从 1 开始。默认 1;兼容别名 page
pageSizeinteger否每页条数,最大 100。默认 20
warehouse_idinteger否按仓库筛选
sku_idinteger否按 SKU id 精确筛选
keywordstring否关键字:仓库名称模糊匹配;纯数字额外按 sku_id 精确匹配;同时匹配变体的 sku / ean / origin_sku / shop_sku

响应 ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "data": [
      {
        "sku_id": 789,
        "sku_code": "PPS-500-BLK",
        "product_title": "Portable Power Station",
        "image": "https://cdn.example.com/products/pps500.jpg",
        "options": { "color": "black", "size": "500W" },
        "warehouse_id": 1,
        "warehouse": { "id": 1, "name": "深圳仓" },
        "sellable_quantity": 120,
        "frozen_quantity": 5
      }
    ],
    "total": 1,
    "per_page": 20,
    "current_page": 1
  }
}

字段说明 ​

字段类型说明
sku_idinteger变体 id
sku_codestring变体 SKU 编码
product_titlestring商品标题
imagestring主图 URL,无图时为空字符串
optionsobject变体选项(来自 standard),无选项时为 {}
warehouse_idinteger仓库 id
warehouseobject{ id, name }
sellable_quantityinteger未冻结的可售数量
frozen_quantityinteger已冻结数量

total 为聚合后的分组数;分页字段为 per_page / current_page(不返回 has_more)。按 sku_id + 仓库 + 归属范围(自有/平台)聚合,未授予 platform_stock 时只有自有行;同一 SKU 与仓库的自有/平台行会分别成行。sellable_quantity 与 frozen_quantity 同时为 0 的行不返回。

错误码 ​

code含义
909令牌缺失/无效
606能力不足(需要 inventory_view)

cURL ​

cURL
curl -X POST 'https://apigate.e2c-energy.com/channel/api/v1/inventory/list' \
  -H 'request-token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "pageNumber": 1,
  "pageSize": 20,
  "warehouse_id": 1
}'