Get Stock/Quantity for Warehouse (Product/Gift/Add-on)
Function
To get stock information for a specific product/ gift/ add-on product with its ID
使用商品 ID 獲取特定一個商品/ 贈品/ 加購品的庫存資料
URL
Product stock: GET <<api_domain>>/v1/products/:id/stocks
Gift stock: GET <<api_domain>>/v1/gifts/:id/stocks
Add-on stock: GET <<api_domain>>/v1/addon_products/:id/stocks
Request Parameters
Parameter | Type | Description | Example |
|---|---|---|---|
Id
| String | Product’s id | 5d3594c276e7ec003b7021c0 |
excludes | String | Could exclude certain parameters in the response |
|
fields | String | Could only show certain parameters in the response |
|
Response Fields
Field | Type | Description | Example |
|---|---|---|---|
id | String | Product’s id | 5d3594c276e7ec003b7021c0 |
title_translations | Title translations | Please check the link on the left | |
stocks | Stock [] | Each stock | Please check the link on the left |
Response Example
{
"id": "5ef1e5cbf1159c004ed9e789",
"title_translations": {
"zh-hant": "測試商品*"
},
"variations": [
{
"id": "5ef1e5cb214bbc0013813cfd",
"fields_translations": {
"en": [
"s"
],
"zh-hant": [
"s"
]
},
"stocks": [
{
"warehouse_id": "5e83216e2e4f81001e756014",
"quantity": 0
},
{
"warehouse_id": "5e831cb68fa5fc000f9925ab",
"quantity": 0
}
]
},
{
"id": "5ef1e5cb214bbc0013813cfe",
"fields_translations": {
"en": [
"m"
],
"zh-hant": [
"m"
]
},
"stocks": [
{
"warehouse_id": "5e83216e2e4f81001e756014",
"quantity": 0
},
{
"warehouse_id": "5e831cb68fa5fc000f9925ab",
"quantity": 0
}
]
}
]
}{
"id":"5ed4b4cc4ff2fe003019c8cd",
"title_translations":{
"zh-hant":"測試商品",
"en":"Test"
},
"stocks":[
{
"warehouse_id":"5e83216e2e4f81001e756014",
"quantity":15
},
{
"warehouse_id":"5e831cb68fa5fc000f9925ab",
"quantity":5
}
]
}Updated 13 days ago