Calculators
Bundle pricing & discount API
Compute bundle economics: sum-of-parts vs bundle price, implied discount% (Σprice − bundlePrice), bundle profit and margin% over Σcost, with a rating. Deterministic. Answers 'what discount is this bundle','bundle margin and profit from item prices and costs'.
Price$0.01per request
MethodPOST
Route/v1/calc/ecom-bundle-pricing
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
ecombundlepricingdiscountmarginmerchandisingecommercecalc
API URL
Integration docshttps://x402.hexl.dev/v1/calc/ecom-bundle-pricingExample request
{
"items": [
{
"price": 40,
"cost": 20
},
{
"price": 30,
"cost": 15
},
{
"price": 20,
"cost": 10
}
],
"bundlePrice": 75
}Example response
{
"formula": "discount = Σprice − bundlePrice; bundleMargin = (bundlePrice − Σcost) / bundlePrice",
"itemCount": 3,
"sumOfParts": 90,
"totalCost": 45,
"bundlePrice": 75,
"discount": 15,
"discountPercent": 16.67,
"bundleProfit": 30,
"bundleMarginPercent": 40,
"rating": "moderate"
}Input schema
{
"type": "object",
"required": [
"items",
"bundlePrice"
],
"properties": {
"items": {
"type": "array",
"description": "Array of {price, cost} (>=2)",
"items": {
"type": "object",
"required": [
"price",
"cost"
],
"properties": {
"price": {
"type": "number"
},
"cost": {
"type": "number"
}
}
},
"examples": [
[
{
"price": 40,
"cost": 20
},
{
"price": 30,
"cost": 15
},
{
"price": 20,
"cost": 10
}
]
]
},
"bundlePrice": {
"type": "number",
"examples": [
75
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}