Create a volume discount
Creates a new volume discount for a shop. Volume discounts automatically
apply tiered pricing when a customer orders above a unit threshold.
shop_id is required in the body.
POST
/volume_discountsAuthorization
AuthorizationBearer token (JWT) · headerrequiredRequest 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
201Volume discount created
_linksHalLinksidintegernamestringdiscount_typestringapply_modestringrepeating_tierbooleantiersobjectKeyed by tier boundary — not an array.
cumulativebooleancumulative_modestringavailable_forstringcreated_atstring<date-time>updated_atstring<date-time>422Validation error
Request
curl -X POST "https://api.onbolder.com/v2/volume_discounts" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"shop_id": 1,
"name": "Buy 5+ get 10% off",
"discount_type": "percentage",
"tiers": [
{
"from": 5,
"value": 10
},
{
"from": 10,
"value": 15
},
{
"from": 20,
"value": 20
}
]
}'const response = await fetch("https://api.onbolder.com/v2/volume_discounts", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"shop_id": 1,
"name": "Buy 5+ get 10% off",
"discount_type": "percentage",
"tiers": [
{
"from": 5,
"value": 10
},
{
"from": 10,
"value": 15
},
{
"from": 20,
"value": 20
}
]
})
});import requests
response = requests.post(
"https://api.onbolder.com/v2/volume_discounts",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"shop_id": 1,
"name": "Buy 5+ get 10% off",
"discount_type": "percentage",
"tiers": [
{
"from": 5,
"value": 10
},
{
"from": 10,
"value": 15
},
{
"from": 20,
"value": 20
}
]
},
)Response
{
"id": 30,
"name": "Buy 5+ get 10% off",
"discount_type": "percentage",
"tiers": {
"5": 10,
"10": 15,
"20": 20
},
"_links": {
"self": {
"href": "https://api.onbolder.com/v2/volume_discounts/30"
}
}
}Validation error