版本:202506
查询商品库存详情
GET/openapi/2025-06/products/:product_id/inventory
通过商品 ID 获取指定商品的库存详情。
请求
Path参数
product_id string必填
商品 ID
Query参数
location_id uint64
地点 ID(可选;指定后只返回该地点的库存)
响应
- 200
OK
- application/json
- 数据结构
- 示例
数据结构
- Array [
- Array [
- ]
- ]
codestring
错误码
messagestring
错误信息
data object
product_idstring
商品 ID
Stockint32
库存
variants object[]
子款式库存列表
variant_idstring
子款式 ID
location_items object[]
各地点的库存详情
location_iduint64
地点 ID
stockint32
该地点的当前库存数量
{
"code": "string",
"message": "string",
"data": {
"product_id": "string",
"Stock": 0,
"variants": [
{
"variant_id": "string",
"location_items": [
{
"location_id": 0,
"stock": 0
}
]
}
]
}
}