update_product_quantity
Set stock quantity for non-variant products after inventory count or restocking. Updates availability immediately; zero disables sales unless overselling is allowed.
Instructions
[WRITE] 更新商品庫存數量(無變體商品)。
【用途】 直接設定無變體商品的庫存數量。適用於盤點後調整庫存或手動補貨場景。 若商品有變體,請改用 update_variation_quantity。
【呼叫的 Shopline API】
PUT /v1/products/{product_id}/quantity
【回傳結構】 dict 含 success: bool, resource_id: str, message: str。
【副作用】
庫存數量立即更新,影響前台可購買數量
若設為 0 且商品設定不允許超賣,前台將顯示缺貨
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"product_id": "<product_id>",
"quantity": "<quantity>"
},
"name": "update_product_quantity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| quantity | Yes | 新庫存數量(絕對值,非增減量) | |
| product_id | Yes | 商品內部 ID |