Scaled pricing

By default, total price is calculated based on the price property of the product and the quantity of the order.

Scaled pricing is for more complex cases when pricing might differ based on the volume of the order. It is a combination of price points and pricing strategies.

It also supports date overrides for special prices for certain periods or to implement seasonal pricing of fresh products.

Properties

  • strategy: The pricing strategy, one of "VOLUME", "INCREMENTAL", or "DIVISIBLE"
  • price_points: The prices used in the pricing based on the quantity of products.
    • from: The number of products the price point is applied from
    • price: The price for one product
  • date_overrides: Optional property, an array of date periods where the price points are different from the default ones. Each product of the array can have the following properties:
    • from_date: The start of the validity for the date override. Can be open ended if no to_date is given.
    • to_date: Optional field, represents the last day of the date range. It is inclusive, the override is still valid on this date.
    • price_points: The price points to be used for this date range or from this start date.

Example:

{
"pricing": {
"strategy": "INCREMENTAL",
"price_points": [
{ "from": 1, "price": 2675 },
{ "from": 6, "price": 2650 },
{ "from": 96, "price": 2610 }
],
"date_overrides": [
{
"from_date": "2023-11-25",
"to_date": "2023-11-28",
"price_points": [
{ "from": 1, "price": 2650 },
{ "from": 6, "price": 2610 },
{ "from": 96, "price": 2575 }
]
}
]
}
}

It is recommended to add a price point with from = 1, or if order_by is kg and strategy is VOLUME then from = 0. The shop will not use the price set on the product itself if scaled pricing is defined.

Constraints

  • The smallest price point defines min_order_count, if not provided. If provided, they must match.
  • order_by: 'kg' can only be used with the VOLUME strategy. The price points from field may be a float only in this case.
  • Within date_overrides, dates cannot overlap. The to_date is optional, if not defined the date range ends at the next from_date, or never.
  • DIVISIBLE and INCREMENTAL strategies require from to be ≥ 1 – zero is not allowed.
  • When using the DIVISIBLE strategy, if bundles are defined on the product, all price points have to be a factor of one bundle vessel count.
  • For order_by: "kg", from may be fractional only with the VOLUME strategy. In all other cases it must be an integer ≥ 1.

Strategies

Scaled pricing supports three strategies: VOLUME, INCREMENTAL and DIVISIBLE

VOLUME

This is the most straightforward pricing strategy, the more a customer orders, the cheaper the product becomes.

Example:

{
"pricing": {
"strategy": "VOLUME",
"price_points": [
{ "from": 1, "price": 2675 },
{ "from": 50, "price": 2650 },
{ "from": 100, "price": 2625 }
]
}
}

With the pricing above here are some quantities with their total price:

number of products calculation total
49 products 49 x 26.75 1310.75
50 products 50 x 26.50 1325.00
99 products 99 x 26.50 2623.50
100 products 100 x 26.25 2625.00

INCREMENTAL

This strategy will break the pricing down to multiples of price points. If you have different bundles for a product and they are priced differently based on their size, this strategy will find the breakdown for a customer's order. Let's say there are two shipping bundles, a carton of 12 and a pallet of 8 cartons (96 products). If a customer orders 13 cartons (156 products), it will be shipped and priced as one pallet and five cartons.

Example:

{
"pricing": {
"strategy": "INCREMENTAL",
"price_points": [
{ "from": 1, "price": 2675 },
{ "from": 12, "price": 2650 },
{ "from": 96, "price": 2625 }
]
}
}

With the pricing above here are some quantities with their total price:

number of products calculation total
11 products 11 x 26.75 294.25
12 products 12 x 26.50 318.00
95 products 7 x 12 x 26.50 + 11 x 26.75 2520.25
111 products 96 x 26.25 + 12 x 26.50 + 3 x 26.75 2918.25

DIVISIBLE

This is the bundle pricing strategy, prices will always be calculated based on the highest price point that is divisible with the quantity ordered. Unlike INCREMENTAL, this strategy will only apply one price point, the one with the highest from value that is divisible with the quantity.

Example:

{
"pricing": {
"strategy": "DIVISIBLE",
"price_points": [
{ "from": 1, "price": 2675 },
{ "from": 12, "price": 2650 },
{ "from": 96, "price": 2625 }
]
}
}

With the pricing above here are some quantities with their total price:

number of products calculation total
11 products 11 x 26.75 294.25
12 products 12 x 26.50 318.00
36 products 3 x 12 x 26.50 954.00
95 products 95 x 26.75 2520.25
96 products 96 x 26.25 2520.00
192 products 2 x 96 x 26.25 5040.00

Date Overrides

Price points can be defined for specific date ranges or from specific dates by using the date_overrides property. When a customer is placing an order, the price points from the date override with the latest from_date will be applied, if any found.

If a date override is found, the original price points are completely ignored and replaced with the price points from the override.

Example:

{
"strategy": "VOLUME",
"price_points": [
{ "from": 1, "price": 2700 },
{ "from": 100, "price": 2650 }
],
"date_overrides": [
{
"from_date": "2023-07-01",
"price_points": [
{ "from": 1, "price": 2700 },
{ "from": 100, "price": 2550 }
]
},
{
"from_date": "2023-10-01",
"price_points": [
{ "from": 1, "price": 2700 },
{ "from": 100, "price": 2575 }
]
},
{
"from_date": "2023-11-25",
"to_date": "2023-11-28",
"price_points": [
{ "from": 1, "price": 2700 },
{ "from": 100, "price": 2475 }
]
}
]
}

With the above setup, given the date of ordering, the price for 100 products will be:

date of order date override price for 100 products
16th of June 2023 none 2650.00
7th of July 2023 from 1 July 2550.00
22nd of November from 1 October 2575.00
26th of November 25–28 November 2475.00
21st of December from 1 October 2575.00