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
| Parameter | Type | Description | Example |
|---|---|---|---|
| product_id *Required | String | Product's ID 主商品ID | 58d33bed01cda31bfb000029 |
| id *Required | String | Product Variation's Key 商品規格ID | 5a1c3fc369702d2ad2070000 |
| quantity *Required | Number | Quantity (新增/減少)商品數量
| |
| replace | Boolean | Whether replacing the original quantity 是否取代原本數量
增加/減少數量
| |
Response Fields
| Field | Column Type | Description | Example |
|---|---|---|---|
| id | String | Product Variation's Key 商品規格ID | 5a1c3fc369702d2ad2070000 |
| sku | String | Product Variation sku 商品貨號 | sku_a01 |
| quantity | Number | Product Variation's Current Quantity 商品規格現有數量 | 12 |
| updated_at | DateTime | Last Updated Time 最後更新時間 | 2018-02-23T04:11:31.059+00:00 |
| product_id | String | Product'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"
}Updated 6 months ago
Did this page help you?
