Product.updateStock
Used for the mass product stock update.
Request
JSON example:
{
"api":1,
"method":"Product.updateStock",
"params":{
"productsInfo":[
{
"product_id":"13",
"seller_sku":"duplicate",
"sku":"ZI501OT89AAKANMY-13",
"quantity":"50",
"seller_id": "10"
},
{
"product_id":"14",
"seller_sku":"Duplicate_1",
"sku":"ZI501OT88AALANMY-14",
"quantity":"50",
"seller_id": "10"
},
{
"product_id":"15",
"seller_sku":"14728-14378",
"sku":"ZI501OT87AAMANMY-15",
"quantity":"50",
"seller_id": "10"
},
{
"product_id":"16",
"seller_sku":"duplicate_2",
"sku":"ZI501OT86AANANMY-16",
"quantity":"50",
"seller_id": "10"
},
"id":1
}
]
Request fields:
Field name |
Type |
Example value |
Description |
---|---|---|---|
method |
string |
"Product.updateStock" |
Action name |
product_id |
string |
"123" |
Endpoint product id |
seller_sku |
string |
"ABC-123" |
Seller given SKU |
sku |
string |
"DEF-456" |
Product SKU |
quantity |
string |
"100" |
Seller stock |
seller_id |
string |
"10" |
ID of the product's Seller |
Response
JSON example:
[
{
"api":1,
"result":[
{
"status":"success",
"product":{
"seller_sku":"1310535504",
"sku":"CO766ELA-934440",
"id":"934440",
"config_id":null,
"updated_at":"2015-08-21 16:29:29"
}
},
{
"status":"success",
"product":{
"seller_sku":"0582037019",
"sku":"GA390ELA-875049",
"id":"875049",
"config_id":null,
"updated_at":"2015-08-21 16:29:29"
}
},
{
"status":"failure",
"error":{
"message":"Stock failed to update"
}
},
],
"id":1
}
]
Response fields:
Field name |
Type |
Value |
Description |
---|---|---|---|
status |
string |
"success" |
Update status:
|
message |
string |
"Stock failed to update" |
Optional Must be set only in case of error. Error message explaining the issue |
code |
int |
0 |
Optional can be returned in case of error. Internal error code. |
seller_sku |
string |
"0582037019" |
Seller given SKU |
sku |
string |
"GA390ELA-875049" |
Product SKU |
id |
string |
"875049" |
Endpoint product id |
config_id |
string |
undefined | Endpoint product set id |
updated_at |
string |
"2015-08-21 16:29:29" |
Time when the price was updated |