Update Product Variation Quantity

📘

Notice 提醒

Product unlimited_quantity should be false
商品 無限數量 需要設定為 false

Function

To update product variation's quantity with open API
透過open API 更新規格數量

URL

PUT <<api_domain>>/v1/products/:product_id/variations/:id/update_quantity

Request parameters

ParameterTypeDescriptionExample
product_id
*Required
StringProduct's ID
主商品ID
58d33bed01cda31bfb000029
id
*Required
StringProduct Variation's Key
商品規格ID
5a1c3fc369702d2ad2070000
quantity
*Required
NumberQuantity
(新增/減少)商品數量
-
This value should be between -9999999 and 9999999.
數值必須在 -9999999 和 9999999 之間。
ruby "quantity":120
replaceBooleanWhether replacing the original quantity
是否取代原本數量
-
true: replace the product's quantity with the number you provided
取代原本數量

false: increase/decrease the quantity with the number you provided
增加/減少數量

*Default: true
ruby "replace":false

Response Fields

FieldColumn TypeDescriptionExample
idStringProduct Variation's Key
商品規格ID
5a1c3fc369702d2ad2070000
skuStringProduct Variation sku
商品貨號
sku_a01
quantityNumberProduct Variation's Current Quantity
商品規格現有數量
12
updated_atDateTimeLast Updated Time
最後更新時間
2018-02-23T04:11:31.059+00:00
product_idStringProduct's ID
主商品ID
58d33bed01cda31bfb000029

Response Example

{
    "id": "5a1c3fc369702d2ad2070000",
    "sku": "sku_a01",
    "quantity": 12,
    "updated_at": "2018-02-23T04:11:31.059+00:00",
    "product_id": "58d33bed01cda31bfb000029"
}