# Update inventory
# Dxplaination of Interface Call Request
http请求方式:POST
https://api.weixin.qq.com/product/stock/update?access_token=xxxxxxxxx
# Example of request parameters
{
"product_id": 23423523452345235,
"out_product_id": "1234566",
"sku_id": 1343,
"out_sku_id": "1024",
"type": 1,
"stock_num": 100
}
# Examples of back-up
{
"errcode": 0,
"errmsg":"ok",
"data":
{
"update_time": "2020-03-25 12:05:25"
}
}
# Dxplaination of request parameters
| 参数 | type | Is it compulsory? | Introductions |
|---|---|---|---|
| product_id | number | no | Mini Store internal product ID, and out_product_id two choice |
| out_product_id | string | no | Choose between product_id and product_id |
| sku_id | number | no | Mini Store internal skuID, or out_sku_id choice |
| out_sku_id | string | no | Merchant custom skuID, and sku_id two choices |
| type | number | yes | 1: full update 2: incremental update |
| stock_num | number | yes | The stock_num must be greater than 0 when the full quantity is updated; When incremental updates, the positive number increases the stock, the negative number decreases the stock. |
# Dxplaination of callback parameters
| 参数 | type | Introductions |
|---|---|---|
| errcode | number | Error code |
| errmsg | string | Error message |
| data.update_time | string | Updated time |
# Return code
| 返回码 | Error Type |
|---|---|
| 100004 | Sku does not exist |
| 100002 | Product_id does not exist |
| -1 | System exceptions |