Manage rates
A comprehensive guide for viewing and managing AccommodationRateDates.
AccommodationRateDate represents the daily rate for an accommodation. Each AccommodationRateDate contains the rate for a specific date under an AccommodationRateSpecification.
AccommodationRateSpecification define how rates are structured for an accommodation, including factors like length of stay. When you update or create an AccommodationRateDate, you're setting or adjusting the price for a particular day for a specific accommodation and for a specific AccommodationRateSpecification.
The Recranet Booking API supports two methods for updating rates:
- Indexing - Apply a percentage or absolute adjustment to the existing rate
- Overwriting - Replace the existing rate with a new value
All changes are automatically versioned, allowing the system to track historical rates over time.
Prerequisites
Before managing rates, ensure you have:
- API credentials - Valid authentication credentials for the Recranet Booking API
- Accommodations - Synced the accommodations to your system.
- AccommodationRateSpecifications - Synced the rate specifications for the accommodations to your system.
Viewing rates
To retrieve the current rates for an Accommodation, use the GET AccommodationRateDate endpoint. This endpoint allows you to fetch the AccommodationRateDates for a specific accommodation for a two month (62 days) period.
Rates are stored per date, per accommodation and per rate specification. This means an accommodation can have different rates for the same date depending on the rate specification (e.g., different pricing tiers or length-of-stay configurations).
When fetching rates, you must specify:
- The rate specification you want to view rates for
- The date range you're interested in
The API will return one rate entry for each date in the requested period. When no rate entry is present for a specific date, no rate exists for that date.
Managing rates
Rates are updated through a batch operation that allows you to modify multiple dates in a single request. Each update targets a specific date and rate specification. To update rates, use the PATCH AccommodationRateDate endpoint. You can also take a look at the recipe we have written for this part of the guide. The recipe will give you a simple code example for updating rates.
Update methods
There are two ways to update a rate:
Indexing
Indexing applies an adjustment to the existing rate. This is useful when you want to increase or decrease rates by a certain amount or percentage without knowing the current value.
You can choose between:
- Percentage - Adjust the rate by a percentage (e.g., increase by 10%)
- Absolute - Adjust the rate by a fixed amount (e.g., decrease by โฌ5.00)
And specify the direction:
- Increase - Add the adjustment to the current rate
- Decrease - Subtract the adjustment from the current rate
For example, applying a 10% increase to a rate of โฌ100.00 results in a new rate of โฌ110.00.
Overwriting
Overwriting replaces the existing rate with a new value. Use this when you know the exact rate you want to set, regardless of the current value.
This is the simplest approach when your system manages rates independently and just needs to push the final price to Recranet Booking.
Batch updates
You can update multiple dates and rate specifications in a single request. Each update in the batch is processed independently, allowing you to mix indexing and overwriting operations.
Versioning
All rate updates are automatically versioned. Each batch update creates a new version, providing a complete audit trail of when rates were changed and what the previous values were.
Updated 10 days ago