update_variation_quantity
Directly set the absolute inventory quantity for a product variation. Ideal for stock corrections after inventory counts or manual restocking.
Instructions
[WRITE] 更新商品變體庫存數量。
【用途】 直接設定特定變體的庫存數量。適用於盤點後調整庫存或手動補貨場景。 若要批次更新多個 SKU 庫存,可改用 bulk_update_quantities。
【呼叫的 Shopline API】
PUT /v1/products/{product_id}/variations/{variation_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>",
"variation_id": "<variation_id>",
"quantity": "<quantity>"
},
"name": "update_variation_quantity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| quantity | Yes | 新庫存數量(絕對值,非增減量) | |
| product_id | Yes | 商品內部 ID | |
| variation_id | Yes | 變體內部 ID |