版本:202201
查询商品库存详情
GET/openapi/2022-01/products/:product_id/inventory
通过商品 ID 获取指定商品的库存详情。
请求
Path参数
product_id string必填
商品 ID。
Query参数
location_id string
地点 ID(可选;指定后只返回该地点的库存)。
响应
- 200
- 500
200
- application/json
- 数据结构
- 示例
- Result
数据结构
- Array [
- Array [
- ]
- ]
product_idstring
示例:
f854e9a2-986d-4e2b-9df0-8e4c139ae80evariants object[]
variant_idstring
示例:
5723299f-238a-4491-8b42-a187462e748alocation_items object[]
location_idinteger
默认值:
0示例:
327627904831724000stockinteger
默认值:
0示例:
1{
"product_id": "f854e9a2-986d-4e2b-9df0-8e4c139ae80e",
"variants": [
{
"variant_id": "5723299f-238a-4491-8b42-a187462e748a",
"location_items": [
{
"location_id": 327627904831724000,
"stock": 1
}
]
}
]
}
{
"product_id": "f854e9a2-986d-4e2b-9df0-8e4c139ae80e",
"variants": [
{
"variant_id": "5723299f-238a-4491-8b42-a187462e748a",
"location_items": [
{
"location_id": 327627904831724058,
"stock": 1
}
]
}
]
}
500
- application/json
- 数据结构
- 示例
- Result
数据结构
errorsstring[]
{
"errors": [
"invalid UUID length: 10"
]
}
{
"errors": [
"invalid UUID length: 10"
]
}