Manage prices for flexible services
The Bookla platform provides a sophisticated system for defining price rules for flexible services. This documentation outlines the key concepts and best practices for implementing effective pricing strategies for services with variable durations.
Core Concepts
Duration Step
The duration step is a fixed time interval that serves as the basis for pricing calculations. All booking durations must be divisible by this step.
Price Rules
Price rules for flexible services include:
- A price for the duration step
- Priority level
- Optional minimum duration (minDuration)
- Optional maximum duration (maxDuration)
- Optional limitations (days, hours, resources)
Rule Priority and Selection
When a booking is made, the system applies all matching rules based on their priority and the booking duration.
Currency
Before creating any price rules, you must select the currency for your company. This setting applies to all price rules.
Implementing Price Rules
Basic Structure
{
"id": "077890d3-5acc-48a5-bc62-efd529fb68d7",
"createdAt": "2024-01-01T00:00:00Z",
"limitation": {},
"price": {
"comparedPrice": 200,
"price": 100
},
"priority": 1,
"serviceID": "a118dfd3-95b0-4635-895c-4e06d22f5dbc",
"type": "flexible",
"duration": "PT30M",
"minDuration": "PT1H",
"maxDuration": "PT2H"
}
Limitations
You can narrow the applicability of a price rule using the following optional limitations:
- Days: Specify days of the week when the rule applies using a 7-bit bitmask. Each bit represents a day of the week, starting from Monday. For example:
- 1111111 (127 in decimal) represents all days
- 1111100 (124 in decimal) represents Monday through Friday
- 0000011 (3 in decimal) represents Saturday and Sunday
- Hours: Define time ranges for rule application (e.g., 10:00-12:00, 17:00-20:00).
- Resources: Apply the rule to specific resources, enabling different pricing per resource.
- Activity Period: Set a start and end date for the rule's validity.
{
"limitation": {
"dates": [
{
"start": "2021-01-01T00:00:00Z",
"end": "2021-02-01T00:00:00Z"
}
],
"daysOfWeek": 127,
"resourceIDs": [
"6c5cba5e-52da-4ca3-8f86-25b3d09e0fb5"
],
"times": [
{
"start": "09:00",
"end": "18:00"
}
]
}
}
Pricing Calculation
The total price is calculated by applying the most appropriate rule for each duration step in the booking.
Example (30-minute duration step):
- Basic rule: $10 per 30 minutes
- Higher priority rule: $15 for durations up to 30 minutes (maxDuration: 30 min)
- Lower priority rule: $8 per 30 minutes for bookings 2 hours or longer (minDuration: 120 min)
Resulting prices:
- 30 minutes: $15
- 1 hour: $20 ($10 + $10)
- 2 hours: $32 ($8 + $8 + $8 + $8)
- 3 hours: $48 ($8 + $8 + $8 + $8 + $8 + $8)
Using minDuration and maxDuration
minDuration
: The rule applies only to bookings with a duration greater than or equal to this value.maxDuration
: The rule applies only to the portion of the booking up to this duration.
These parameters allow for tiered pricing based on booking duration.
Activity Periods
Use dates.start
and dates.end
dates to create smooth transitions between pricing periods. This is particularly useful for seasonal pricing or promotional periods.
Best Practices and Considerations
- Cover All Scenarios: Ensure your rules account for all possible booking durations to avoid pricing gaps.
- Rule Hierarchy: Organize rules from most specific (highest priority) to most general (lowest priority).
- Duration Step: Choose a duration step that aligns with your business model and common booking patterns.
- Long Durations: While there's no system limit, it's recommended to use this pricing model for services shorter than 24 hours.
- Testing: Thoroughly test your pricing rules with various booking durations to ensure correct calculations.
- Documentation: Maintain internal documentation of your pricing strategy for easier management and troubleshooting.
API Reference
For detailed information on implementing and managing price rules through our API, please refer to the Pricing API Documentation.
By leveraging these pricing capabilities, you can create sophisticated pricing strategies that adapt to your business needs while ensuring a smooth booking experience for your clients.