Pricing policies
Summary
A pricing policy is a set of rules applicable to different entities such as resources
or event-types
that allow the automatic calculation of a reservation's price. Pricing policies are designed to offer flexibility and cover various use cases.
A pricing policy is made of the following attributes:
Pricing policy spec
Name | Type | Description |
---|---|---|
id | String | An unique string identifying the policy. |
name | String | An user friendly string to identify the policy |
price | Price | The default price that will be applied in this policy. |
overrides | Array<Override> | An array of overrides that will replace the default price according to a set of rules. |
tags | object | Arbitrary key/value collection for storing metadata. |
{
"id": "some-unique-id",
"name": "Tennis court price",
// Use tags to store arbitrary metadata
"tags": { "color": "green"},
// This will be the default price for this policy
"price": {
"type": "TIME_BASED",
"duration": "PT1H",
"amount": "30.00",
"currency": "EUR",
},
// We have one price override for weekends
"overrides": [
{
"name": "weekends",
"price": {
"type": "TIME_BASED",
"duration": "PT1H",
"amount": "50.00",
"currency": "EUR",
},
// This set of rules indicate when the override takes place
"rules": {
// See the schedule docs for a complete example
"schedule": "BEGIN:VCALENDAR..."
},
"tags": {}
}
]
}
Override
Spec
Name | Type | Description |
---|---|---|
name | String | An user friendly string to identify the policy |
price | Price | The default price that will be applied in this policy. |
rules | OverrideRules | An object with a set of rules that determine when the price applies For now only schedule is supported. |
tags | object | Arbitrary key/value collection for storing metadata. |
OverrideRules
Name | Type | Description |
---|---|---|
schedule | Schedule | A set of time periods during which the price is overridden |
Price
The price indicates how much the event will cost once booked. Prices can be fixed, time based or tiered:
Fixed
A fixed pricing policy charges a set amount for each reservation, regardless of the duration or other factors. This is straightforward and suitable for services where the cost is consistent.
For example, a fixed price of 30€ per reservation:
{
type: 'FIXED',
amount: "30.00",
currency: "EUR"
}
Time based
A time-based pricing policy charges a set amount per unit of time, such as per hour. This is useful for services where the cost is dependent on the length of time the resource is used.
Fixed price of 30€ per hour:
{
type: 'TIME_BASED',
duration: 'PT1H',
amount: "30.00",
currency: "EUR",
}
Tiered
A tiered pricing policy charges different rates based on predefined time intervals. This approach is suitable for services where the cost varies with the duration, encouraging longer usage periods with different rates.
{
type: 'TIERED',
tiers: [
{
duration: 'PT1H'
amount: "30.00",
currency: "EUR"
},
{
duration: 'PT1H30M'
amount: "40.00",
currency: "EUR"
},
{
duration: 'PT2H'
amount: "45.00",
currency: "EUR"
},
]
}