Appearance
Pricing Models
We use various pricing models to let the user of the API alter how the pricing engine calculates prices and reacts to changes.
The list of available pricing models is tied to specific projects, this allows us to serve individual needs and tailor our pricing engine to specific clients when necessary.
Pricing Model Options
Every pricing model accepts a set of options, since the structure of these options might be different for each model, we don't cover them in documentation but rather use JSON Schemas that can be retrieved via the API.
Common Options
Even though model options vary, currently most (if not all) pricing models accept a rounding and price change limit option.
Rounding
Rounding is defined by a set (list) of rounding rules, each rule is made up of three optional fields (defaults in parentheses):
- threshold (0): An inclusive threshold from which the rounding rule applies, prices lower than this will not be affected by the rule
- stepSize (0.001): The rounding steps to use, the final prices will divisible by this value.
- base (0): A modifier that determines where the steps will be calculated from, this allows rounding to specific numbers, e.g. with a value of
0.99
, the prices will always end with0.99
.
Rounding rules can be defined for all items by default and for specific items as well.
Examples
Round to 50
The following ruleset rounds all prices to multiples of 50
, e.g. 0, 50, 100, 150, ...
json
{
"rounding": {
"default": [
{
"stepSize": 50
}
]
}
}
Item-specific override
The following ruleset rounds all prices to multiples of 50
, apart from a specific item, that will be rounded to 10
.
json
{
"rounding": {
"default": [
{
"stepSize": 50
}
],
"items": {
"myItemId": [
{
"stepSize": 10
}
]
}
}
}
Multiple levels
The following ruleset defines multiple price steps, so that smaller values are roudned differently.
The ruleset will produce 0, 10, 20, 30, 40, 50, 75, 100, 200, ...
.
jsonc
{
"rounding": {
"default": [
// By default we round to 10.
{
"stepSize": 10
},
// From 50, we round to steps of 25.
{
"threshold": 50,
"stepSize": 25
},
// From 100, we round to multiples of 100.
{
"threshold": 100,
"stepSize": 100
}
]
}
}
Different bases
The following ruleset produces the prices 0.99, 25.99, 50.99, 75.99, 199, 299, ...
.
jsonc
{
"rounding": {
"default": [
{
"base": 0.99,
"stepSize": 25
},
{
"threshold": 100,
"base": 99,
"stepSize": 100
}
]
}
}
Price Change Limit
It is possible to limit the change of prices between two price calculations.
INFO
This feature is tied to price calculations only, it is not time-based, the percieved price changes depend on how often prices are recalculated.
WARNING
Use with caution!
When this feature is combined with rounding, it is possible to create situations where prices are impossible to change, e.g. specifying a change limit of 5
, with a rounding of 10
.
Just like rounding rules, a default change limit rule can be defined for all items by default as a well as specific item IDs.
Examples
Exact value
The price change will not exceed 100 compared to the previous price.
json
{
"priceChangeLimit": {
"default": {
"difference": 100
}
}
}
Percent-based
WARNING
All percentage values are mapped to the interval [0;1]
on the API, so a 10%
must be given as 0.1
.
The price change will not exceed 10% of the previous price.
json
{
"priceChangeLimit": {
"default": {
"percent": 0.1
}
}
}