Update AddonProduct Quantity by SKU
Notice 提醒
Addon Product unlimited_quantity should be false
加購品 無限數量 需要設定為 false
Function
To Update add-on product quantity by SKU
使用商品貨號更新加購品庫存數量
URL
PUT <<api_domain>>/v1/addon_products/update_quantity
Request parameters
Parameter | Column Type | Description | Example |
---|---|---|---|
sku *Required | String | Addon Product sku 加購品的商品貨號 | ruby "sku": "sku-123" |
quantity | Integer | Quantity (新增/減少)加購品數量 - *if replace sets as false, allows quantity to be negative number 如果 replace 為 false,准許 quantity 為負數 | ruby "quantity": 10 "quantity": -1 |
replace | Boolean | Whether replacing the original quantity 是否取代原本數量 - true: replace the quantity with the number you provided 取代原本數量 false: increase/decrease the quantity with the number you provided 增加/減少數量 *Default: true | ruby "replace": true |
Request Example
curl -X PUT \
<<api_domain>>/v1/addon_products/update_quantity \
-H 'Accept: application/json' \
-H 'Authorization: Bearar {{access_token}}' \
-H 'User-Agent: shopline-test' \
-H 'Content-Type: application/json' \
-d '{
"sku": "sku-123",
"quantity": 10,
"replace": true
}'
curl -X PUT \
https://open.shoplineapp.com/v1/addon_products/update_quantity \
-H 'Accept: application/json' \
-H 'Authorization: Bearar {{access_token}}' \
-H 'User-Agent: shopline-test' \
-H 'Content-Type: application/json' \
-d '{
"sku": "sku-123",
"quantity": -1,
"replace": false
}'
Response fields
Response Example
Updated about 3 years ago