Update a volume discount
Updates an existing volume discount.
PUT
/volume_discounts/{id}Authorization
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idintegerrequiredID of the volume discount to update.
Request body
requiredapplication/jsonshop_idintegerrequiredID of the shop to create the volume discount in
namestringrequireddiscount_typestringDiscount type.
cumulative_modestringOmit for non-cumulative
Allowed:
within_productglobalapply_on_tier_start_onlybooleantiersobject[]requiredShow propertiesHide properties
Array of
objectfromintegerUnits in cart at which this tier starts applying
valueintegerDiscount value for this tier
Responses
200Volume discount updated
_linksHalLinksidintegernamestringdiscount_typestringapply_modestringrepeating_tierbooleantiersobjectKeyed by tier boundary — not an array.
cumulativebooleancumulative_modestringavailable_forstringcreated_atstring<date-time>updated_atstring<date-time>404Volume discount not found
Request
curl -X PUT "https://api.onbolder.com/v2/volume_discounts/30" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tiers": [
{
"from": 5,
"value": 15
}
]
}'const response = await fetch("https://api.onbolder.com/v2/volume_discounts/30", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"tiers": [
{
"from": 5,
"value": 15
}
]
})
});import requests
response = requests.put(
"https://api.onbolder.com/v2/volume_discounts/30",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"tiers": [
{
"from": 5,
"value": 15
}
]
},
)Response
{
"id": 30,
"tiers": {
"5": 15
},
"_links": {
"self": {
"href": "https://api.onbolder.com/v2/volume_discounts/30"
}
}
}Volume discount not found