RATE & CALENDAR API
Update Calendar Inventory API
Technical documentation for the method that builds and sends booking data as JSON.
Summary
| Purpose | Send inventory data (number of available rooms) for selected dates to the Allbookers API. |
| Entry Method | POST /updateCalendarInventory |
| Input | roomId as a request parameter and a list of InventoryData in the request body. |
| Output | A plain String with the operation status. |
Description
This endpoint is called by Channel Manager to update the inventory of a room in Allbookers for the specified dates. Channel Manager calls it asynchronously (fire-and-forget) using .subscribe() — meaning it does not wait for a response and ignores a successful response. If the call fails, Channel Manager automatically retries up to 2 times with a 5-second delay.
Endpoint
POST
/updateCalendarInventory
Request
Request parameter: roomId. Content-Type: application/json
Authorization: Bearer <token>
| Field | Type | Description |
|---|---|---|
| roomId | Long | Room identifier |
| date | Date | Date to update |
| inventory Number |
Integer | Inventory value for that date |
| propertyName | String | Property name supplied in the payload |
Request Body Example
POST /updateCalendarInventory?roomId=12
[
{"date": "2026-03-15", "inventoryNumber": 3, "propertyName": "Hotel Example"},
{"date": "2026-03-16", "inventoryNumber": 2, "propertyName": "Hotel Example"}
]
Process
- The list is checked for emptiness — if empty, a notification email is sent and an error message is returned.
- The Room is looked up in the database by roomId — if not found, a notification email is sent and an error message is returned.
- All RatePlans of the room are retrieved.
- For each date in the list, the system checks whether a RoomAvailability entry exists.
- If it exists, totalRooms is updated with the new value.
- If it does not exist, a new RoomAvailability is created with the given totalRooms.
- For each RatePlan of the room, the system checks whether a RateRoomAvailability exists — if not, a new one is created.
- All changes are saved to the database.
- derivedPriceService is called to propagate changes to derived rate plans.
Response
Returns a plain String (not JSON).
| Value | Description |
|---|---|
| Inventory is successfully updated | Inventory was updated successfully. |
| "inventory is received as empty list {roomId}" | The sent list was empty. |
| "Room with ID: {roomId} not exist in db..." | Room was not found in the database. |
Headers
- Content-Type: application/json
- Accept: application/json
Notes
- This operation follows a fire-and-forget approach, meaning that Channel Manager does not wait for or process the response after sending the request.
- In case of failure, Channel Manager automatically retries the request up to two additional times, with a 5-second interval between attempts.
- Only technical or connection-level errors are logged by Channel Manager. Logical issues occurring within the Allbookers API, such as missing data, are not captured by the caller.
- If the provided inventory data is empty, a notification email is sent to the designated Allbookers contact address.
- If the specified room identifier is not found, a notification email is sent to the Channel Manager support address.