UpdateSpareStock¶
Use this API to update the spare stock of an product,Support for increase, decrease, and overriding updates.
POST /openapi/v1/oms/stock/spare-stock/update
Request Parameters¶
Parameter | Type | Required | Description |
---|---|---|---|
stockList |
array(object) |
true |
Stock update list, Maximum 20, Please refer to Stock Info for details |
Stock Info¶
Parameter | Type | Required | Description |
---|---|---|---|
masterSku |
string |
true |
Master sku |
action |
string |
true |
INCREASE/DECREASE/OVER_WRITE, INCREASE(Increase in stock on top of existing stock), DECREASE(Reduction of stock on top of existing stock),OVER_WRITE(Overwrite original stock) |
quantity |
long |
true |
Quantity |
warehouseId |
string |
true |
Ginee warehouse id |
shelfInventoryId |
string |
false |
Ginee shelfInventory Id,If there is only one shelf in the warehouse, it can be left out, otherwise it is required. |
remark |
string |
false |
remark |
Response Parameters¶
Name | Type | Description |
---|---|---|
failedList |
array(object) |
Failed list, please refer to Failed Info for details |
successList |
array(object) |
Success list , please refer to Success Info for details |
Failed Info¶
Name | Type | Description |
---|---|---|
masterSku |
string |
Master product sku |
errorMessage |
string |
Error message |
Success Info¶
Name | Type | Description |
---|---|---|
warehouseId |
long |
Warehouse id |
masterSku |
string |
Master product sku |
masterProductName |
string |
Master product name |
masterVariationId |
string |
Master variation id |
transportStock |
Long |
Transport stock |
warehouseStock |
Long |
Warehouse stock |
spareStock |
Long |
Spare stock |
promotionStock |
Long |
Promotion stock |
lockedStock |
Long |
Locked stock |
availableStock |
Long |
Available stock |
safetyStock |
Long |
Safety stock |
outStock |
Long |
Out stock |
updateDatetime |
datetime |
Update date and time |
Request Example¶
Example
curl --location --request POST '{Ginee Host}/openapi/v1/oms/stock/spare-stock/update' \
--header 'Content-Type: application/json' \
--header 'X-Advai-Country: ID' \
--header 'Authorization: {Your Access Key} + ':' + signature' \
--data-raw '{
"stockList":[
{
"masterSku": "dsftest0221004",
"action": "INCREASE",
"quantity": 10,
"warehouseId": "WW66AC91A946E0FB01114CD1B4",
"shelfInventoryId": "",
"remark": "from openapi"
},
{
"masterSku": "24324324324",
"action": "INCREASE",
"quantity": 90,
"warehouseId": "WW66AC91A946E0FB01114CD1B4",
"shelfInventoryId": "",
"remark": "from openapi"
}
]
}'
Success
{
"code": "SUCCESS",
"message": "成功",
"data": {
"failedList": null,
"successList": [
{
"warehouseId": "WW62BEF8F26522050001FB4921",
"masterSku": "dsftest0221004",
"masterProductName": "dsftest0221004",
"masterVariationId": "MV660BA9F39B97170001945E08",
"transportStock": 1,
"warehouseStock": 109,
"spareStock": 100,
"promotionStock": 0,
"lockedStock": 9,
"availableStock": 0,
"outStock": 0,
"safetyStock": 0,
"updateDatetime": "2024-06-13T09:24:16Z"
}
]
},
"extra": null,
"pricingStrategy": "PAY"
}
Parameter error
{
"code": "SUCCESS",
"message": "成功",
"data": {
"failedList": [
{
"masterSku": "dsftest0221004111",
"errorMessage": "masterSku is invalid, please check."
},
{
"masterSku": "24324324324",
"errorMessage": "masterSku has more than one warehouse, please fill in the warehouseId."
}
],
"successList": [
{
"warehouseId": "WW62BEF8F26522050001FB4921",
"masterSku": "dsftest0221004",
"masterProductName": "dsftest0221004",
"masterVariationId": "MV660BA9F39B97170001945E08",
"transportStock": 1,
"warehouseStock": 109,
"spareStock": 100,
"promotionStock": 0,
"lockedStock": 9,
"availableStock": 0,
"outStock": 0,
"safetyStock": 0,
"updateDatetime": "2024-06-13T09:24:16Z"
}
]
},
"extra": null,
"pricingStrategy": "PAY"
}