Update Gift Quantity
Function
To update quantity of gifts with open API
透過open API 更新贈品數量
URL
PUT <<api_domain>>/v1/gifts/:id/update_quantity
Request parameters
Parameter | Value | Description | Example |
|---|---|---|---|
id |
| Gift's ID | |
quantity |
| Quantity
| |
replace |
| Whether replacing the original quantity
| |
Response fields
Field | Column Type | Description | Example |
|---|---|---|---|
id |
| Gift's ID | 5a8165efe38809548f0000f8 |
sku |
| Stock Keeping Unit | FRU008 |
quantity |
| Gift's Current Quantity | 21 |
updated_at |
| Last Updated Time | 2018-02-23T04:17:15.544+00:00 |
Response Example
{
"id": "5d8b0a6552910502640e8a76",
"sku": "GIFT-SKU-0002",
"quantity": 10,
"updated_at": "2021-06-25T10:55:07.159+00:00"
}Sample Request
Update Gift quantity with 10
curl --location --request PUT '<<api_domain>>/v1/gifts/5d8b0a6552910502640e8a76/update_quantity' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ${token}' \
--header 'User-Agent: shopline-test' \
--header 'Content-Type: application/json' \
--data-raw '{
"quantity": 10,
"replace": true
}'increase 3 gift quantity
curl --location --request PUT '<<api_domain>>/v1/gifts/5d8b0a6552910502640e8a76/update_quantity' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ${token}' \
--header 'User-Agent: shopline-test' \
--header 'Content-Type: application/json' \
--data-raw '{
"quantity": 3,
"replace": false
}'decrease 4 gift quantity
curl --location --request PUT 'https://open.shoplineapp.com/v1/gifts/5d8b0a6552910502640e8a76/update_quantity' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ${token}' \
--header 'User-Agent: shopline-test' \
--header 'Content-Type: application/json' \
--data-raw '{
"quantity": -4,
"replace": false
}'Updated 13 days ago