Skip to main content

Bundles

A bundle is a SKU sold as one unit but made up of several component SKUs. Quantaprice prices bundles deterministically, and you read a bundle price exactly like any other price, with no special handling.

A bundle's components are defined on the article. Its pricing rule is defined per pricelist and is passed down to the pricelists below it; see Inheritance.


Defining a bundle​

A bundle is an article with "type": "bundle" and a list of components, each with a SKU and a quantity:

json
POST /article
{
"sku": "BUNDLE-START-KIT",
"type": "bundle",
"components": [
{ "sku": "COMP-A", "quantity": 2 },
{ "sku": "COMP-B", "quantity": 1 }
]
}

The components must meet these conditions:

  • There is at least one component.
  • Each quantity is positive. Fractional quantities are allowed.
  • A component cannot be the bundle itself.
  • A component cannot be a bundle: bundles cannot be nested.
  • Each component article must already exist.

Without "type": "bundle", the article is a plain article and components is ignored.

You cannot price a bundle directly: a price written for a bundle SKU is rejected with 400. The bundle's price is calculated from its components and its bundle rule.


Pricing methods​

A bundle's price on a pricelist is set by its bundle rule, through the rule's method:

sum_of_parts​

The price is the sum of each component's price multiplied by its quantity, with an optional discount:

text
base = Σ ( component.quantity × effectivePrice(component) )

discount_type = "percentage" → price = base × (1 − discount_value/100)
discount_type = "absolute" → price = base − discount_value (never below 0)
none → price = base

effectivePrice(component) is the component's price under normal pricelist inheritance: its own price on this pricelist, or otherwise the price inherited from a parent. A customer with negotiated component prices therefore automatically gets a bundle price calculated from their component prices.

fixed​

The bundle has an explicit fixed_price, and component prices do not affect it. The response still includes a per-component VAT breakdown, derived proportionally from the components, so VAT is calculated correctly across mixed VAT classes.

With either method, the component prices in the breakdown add up to the bundle price exactly in the pricelist's currency: the price is shared across the components in proportion to their price × quantity, to four decimals, and a ten-thousandth that the division leaves over goes to the component with the largest remainder. Delivered in another currency, the shares add up when a rounding profile rounds the price, since the rounded price is shared the same way. Without a profile, or for a price below the profile's lowest range_start, each share is converted on its own to four decimals, so their sum can differ from the converted bundle price by a ten-thousandth per component.


Inheritance​

The rule is passed down, not the calculated price. A pricelist prices a bundle when:

  1. it has its own bundle rule, which it uses; or
  2. a pricelist above it has a bundle rule, and it has no price rules or one of its price rules matches the bundle article (a rule with a blank filter matches every article). The nearest such pricelist's rule applies.

This is the same as for other prices: a pricelist without price rules uses the bundle rule of the pricelist above it, and a pricelist with price rules uses it only if one of them matches the bundle. For example, with base → wholesale → customer-acme, and outlet below base:

PricelistOwn bundle rulePrice rulesBundle price
basesum_of_partsNoneYes, from its own rule
wholesaleNonesales * 0.85, blank filterYes, from base's rule
customer-acmeNoneNoneYes, from base's rule
outletNonesales * 0.7, filter category = 'shoe'No: no rule matches the bundle

For sum_of_parts, the price is calculated from the pricelist's own component prices, which follow normal inheritance. For example, if customer-acme inherits component prices of 100 and 50 and has its own price of 40 for the second, the bundle costs 140 on customer-acme, not 150.

A child pricelist can override the rule: switch the method, change the discount or set a fixed price. Components cannot be overridden per pricelist; they are defined on the article.


Scheduling​

Bundle prices follow time. Both rules and component prices can be scheduled, and the bundle price changes automatically at the scheduled moment, with no manual step.

  • Scheduled fixed price: set a fixed rule with a future effective_from. The bundle switches to that price at that time.
  • Scheduled discount or method change: schedule a change to a sum_of_parts discount (for example, 10 % today and 25 % from Black Friday) or a change of method.
  • Scheduled component prices: a scheduled change to any component's price, its own or inherited, is reflected in the bundle price from the moment it takes effect.

Bundle prices include scheduled changes up to 90 days ahead, and at most 25 versions including the one in force now, whichever limit is reached first. Changes further ahead still take effect on time, but a query with an as_of beyond that window does not show them yet.

Historical pricing​

Each change creates a new version with its own start, so you can query past bundle prices with as_of, just like regular prices.


Reading a bundle price​

You request a bundle price exactly like a regular price. In a price query response, a bundle's result has is_bundle: true and a per-component breakdown in bundle. One result:

json
{
"sku": "BUNDLE-START-KIT",
"is_bundle": true,
"sales_price_ex_vat": 180.00,
"sales_price_inc_vat": 225.00,
"vat_amount": 45.00,
"vat_rate": 0.0,
"price": { "pricelist": "RETAIL", "currency_code": "SEK", "sales": 180.00, "fields": {}, "quantity_breaks": [], "meta": { "inherited": false, "...": "..." } },
"bundle": [
{ "sku": "COMP-A", "quantity": 2, "price": 120.00, "vat_rate": 25.0, "vat_amount": 30.00, "pricelist": "RETAIL" },
{ "sku": "COMP-B", "quantity": 1, "price": 60.00, "vat_rate": 25.0, "vat_amount": 15.00, "pricelist": "RETAIL" }
]
}

bundle is present only for bundles. Each component entry shows the pricelist its price comes from and its own VAT. VAT is calculated per component, so bundles with mixed VAT classes are taxed correctly. For the same reason, the bundle's own vat_rate is 0, and its vat_amount is the sum of the components' VAT.

If a component of a sum_of_parts bundle has no price anywhere in the hierarchy, the bundle is unavailable: it has no price, rather than a partial sum.


Bundle rules API​

Bundle rules are managed under /bundle-rules.

Set or update a rule​

PUT/bundle-rules/{bundleSku}/{pricelistCode}
json
{
"method": "sum_of_parts",
"discount_type": "percentage",
"discount_value": 10,
"effective_from": "2026-11-27T00:00:00Z"
}
json
{
"method": "fixed",
"fixed_price": "499.00"
}

effective_from is optional and defaults to now; a future value schedules the rule. The rule applies to this pricelist, and to the pricelists below it that have no bundle rule of their own and either have no price rules or have a price rule that matches the bundle. PUT returns 404 for an unknown bundle or pricelist, and 400 for a SKU that is not a bundle or a request without method.

Validation: discount_value must be 0–100 for percentage and ≥ 0 for absolute. fixed_price is required for fixed and must be ≥ 0.

Get the effective rule​

GET/bundle-rules/{bundleSku}/{pricelistCode}

Returns the rule in effect now, following inheritance up the parent chain. The response includes inherited (true or false), the method, the discount or fixed-price fields, and effective_from.

List rule versions​

GET/bundle-rules/{bundleSku}

Lists every rule version set explicitly for the bundle, on every pricelist.

Remove a rule​

DELETE/bundle-rules/{bundleSku}/{pricelistCode}?effective_from=...

Removes a rule version; by default, the version in effect now. The pricelist then uses the rule of the nearest pricelist above it that has one, if the pricelist has no price rules or one of its price rules matches the bundle. Otherwise, the bundle has no price on that pricelist.


See also​

  • Inheritance: how bundle rules are inherited through the pricelist hierarchy.
  • VAT: how VAT is calculated per component for bundles with mixed VAT classes.
  • Querying prices: reading bundle prices with the query API.
  • API reference: the full specification of the /bundle-rules endpoints.

Summary​

Bundles are SKUs made up of component SKUs, priced on each pricelist by an inherited rule: sum_of_parts, with an optional discount, or a fixed price. Rules and component prices can be scheduled, so fixed prices, discounts and component price changes all take effect automatically. You query a bundle price like any other price, and it comes with a per-component breakdown.