SYNC & UPDATE API

Get Room Response Connectivity API

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

Summary

Purpose Sync room capacity details from Channel Manager to Allbookers during initial connectivity setup, then push all calendar data (prices, min/max stay, inventory) if the sync is successful.
Entry Method updateAllbookersDatas(Room room, RoomMapping roomMapping)
Input Room and RoomMapping objects from Channel Manager internally. RoomResp object sent to Allbookers API.
Output Boolean indicating success or failure of the room sync.

Description

This is a two-step operation. First, Channel Manager sends room capacity details to the Allbookers API via /getRoomResponseConnectivity. If Allbookers confirms success, Channel Manager proceeds to push all calendar data — prices, min stay, max stay, and inventory — for that room. The room sync call is synchronous (.block()) since the calendar push depends on its result.

Endpoint

POST /getRoomResponseConnectivity

Request

Content-Type: application/json

Field Type Description
id Long Room identifier
qty Integer Total number of rooms.
MaxGuests Integer Maximum number of guests.
maxAdults Integer Maximum number of adults.
maxChildren Integer Maximum number of children.
minStay Integer Optional in some payloads; not applied by this endpoint
maxStay Integer Optional in some payloads; not applied by this endpoint
Request Body Example
{
  "allbookersId": 501,
  "qty": 4,
  "maxGuests": 3,
  "maxAdults": 2,
  "maxChildren": 1,
  "minStay": 1,
  "maxStay": 30
}

Process

Step 1 — Room sync (Channel Manager → Allbookers API):

  • A RoomResp object is built from the Room and RoomMapping data. Any null values are defaulted to 0.
  • The RoomResp is sent to /getRoomResponseConnectivity via WebClient synchronously.
  • Allbookers API fetches the room by allbookersId, updates totalRooms, maximum_guests, adults, and children, then saves and returns true.
  • If the room is not found, an exception is caught and false is returned.

Step 2 — Calendar push (only if Step 1 returns true):

  • Channel Manager checks if the room has an Allbookers mapping.
  • For each DailyPriceSetup of the room:
    1. If it is the main price setup, prices are sent directly.
    2. If it is not the main and has no priceFrom, rate plan prices are fetched and sent.
    3. If priceFrom is set, derived rate prices are calculated and sent.
  • Min stay data is sent to Allbookers.
  • Max stay data is sent to Allbookers.
  • Inventory data is sent to Allbookers.

JSON Structure Sent

Content-Type: application/json

Value Description
true Room updated successfully.
false Room not found or update failed.

Headers

  • Content-Type: application/json
  • Accept: application/json

Notes

  • This operation is executed synchronously, meaning Channel Manager waits for the response before proceeding, as the calendar update depends on the outcome.
  • If the response indicates a failure or is missing, the calendar update is skipped and an error is recorded.
  • The Allbookers API updates only specific room-related fields, including total rooms, number of guests, adults, and children. Other values, such as minimum and maximum stay, are not affected by this operation.
  • Any missing room values are automatically replaced with default values before the request is sent.