SYNC & UPDATE API

Update Calendar Blackout API

Technical documentation for the method that builds and sends booking data as JSON.

Summary

Purpose Send blackout (closed) status for selected dates from Channel Manager to the Allbookers API, then trigger an inventory sync.
Entry Method sendBlackout(Room room, Set<RoomAvailability> roomAvailabilitySet)
Input roomId as a request parameter and a list of BlackoutData in the request body.
Output Plain String with the operation status.

Description

This endpoint is called by Channel Manager when a room's blackout status changes for specific dates. Channel Manager builds a list of BlackoutData entries and sends them to the Allbookers API asynchronously (fire-and-forget) using .subscribe(). After a successful blackout update, Channel Manager also triggers an inventory sync for the same room. The call only executes in a production environment — it is skipped in development.

Endpoint

POST /updateCalendarBlackout

Request

Request parameter: roomId. Content-Type: application/json

Authorization: Bearer <token>

Field Type Description
roomId Long Room identifier
date Date The date to update.
blackoutStatus Boolean True = closed, False = open.
propertyName String Property name supplied in the payload
Request Body Example
POST /updateCalendarBlackout?roomId=12
[
{"date": "2026-03-15", "blackoutStatus": true, "propertyName": "Hotel Example"},
{"date": "2026-03-16", "blackoutStatus": false, "propertyName": "Hotel Example"}

Process

Channel Manager side:

  • Checks if the environment is production — if not, the entire method is skipped.
  • Checks if the property has an Allbookers connection — if not, logs an error and throws an exception.
  • Checks if the room is connected to Allbookers — if not, saves a connection error record and throws an exception.
  • Builds a BlackoutData list from the RoomAvailability set.
  • Sends the list to /updateCalendarBlackout asynchronously with retry logic.
  • If an unexpected exception occurs, saves a connection error record and throws an exception.
  • After the blackout call, triggers sendInventory() for the same room.

Allbookers API side:

  • Checks if the list is empty — if so, sends a notification email and returns an error message.
  • Looks up the room by roomId — if not found, sends a notification email and returns an error message.
  • For each date in the list, checks if a RoomAvailability entry exists.
  • If it exists and the closed status has changed, updates it with the new blackout status.
  • If it does not exist, creates a new RoomAvailability with the given blackout status.
  • For each RatePlan of the room, ensures a RateRoomAvailability entry exists — creates one if missing.
  • Saves all changes to the database.
  • Calls derivedPriceService for each rate plan to propagate changes.

JSON Structure Sent

Content-Type: string

Value Description
"Blackout is successfully updated" Blackout dates updated successfully.
"Blackout 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 Channel Manager does not wait for or process the response after sending the request.
  • The method is executed only in the production environment and is skipped entirely during development.
  • 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 room is not connected to Allbookers, a connection error record is stored before the process fails.
  • After the blackout operation, the inventory update is always triggered, regardless of the blackout result, as the process continues without waiting for completion.
  • If the blackout 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.