update_variation_quantity
Set the exact inventory quantity for a specific product variation. Use after inventory counts or for manual restocking to update stock levels immediately.
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 且商品設定不允許超賣,前台將顯示缺貨
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| product_id | Yes | 商品內部 ID | |
| variation_id | Yes | 變體內部 ID | |
| quantity | Yes | 新庫存數量(絕對值,非增減量) |