Commerce
Bundle savings & allocation API
Compares a fixed bundle price to the à-la-carte sum, returning absolute and percent savings and a list-price-proportional allocation of the bundle price for revenue recognition. Answers 'How much does this bundle save vs buying separately?', 'How do I split bundle revenue across items?'.
Price$0.02per request
MethodPOST
Route/v1/commerce/bundle-savings
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
commercepricingbundlesavingspackageallocationmerchandisingrevenue
API URL
Integration docshttps://x402.hexl.dev/v1/commerce/bundle-savingsExample request
{
"items": [
{
"name": "a",
"price": 30
},
{
"name": "b",
"price": 20,
"qty": 2
}
],
"bundlePrice": 50
}Example response
{
"bundlePrice": 50,
"alaCarteTotal": 70,
"savings": 20,
"savingsPct": 28.5714,
"isDiscount": true,
"allocation": [
{
"name": "a",
"qty": 1,
"listValue": 30,
"allocatedPrice": 21.43
},
{
"name": "b",
"qty": 2,
"listValue": 40,
"allocatedPrice": 28.57
}
],
"interpretation": "Bundle saves $20 (28.5714%) vs buying separately ($70)."
}Input schema
{
"type": "object",
"required": [
"items",
"bundlePrice"
],
"properties": {
"items": {
"type": "array",
"examples": [
[
{
"name": "a",
"price": 30
},
{
"name": "b",
"price": 20,
"qty": 2
}
]
]
},
"bundlePrice": {
"type": "number",
"examples": [
50
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}