Integrating 1C-Bitrix with the Wubook Booking System
Wubook is an Italian PMS with a built-in channel manager. Among hotel systems, it stands out for its strong focus on European properties, though it is also used by independent Russian hotels — particularly those selling through Booking.com and Airbnb via a unified channel manager. The integration goal is to mirror Wubook's online booking engine on the 1C-Bitrix site without abandoning the PMS, and to synchronize data in both directions.
Wubook API: Two Layers
Wubook provides two APIs:
-
XML-RPC API (legacy, but still functional) — method-oriented, authentication via
lkey(session key). -
Zak API (REST) — more modern, JSON-based, base URL
https://wubook.net/api/zak/. Recommended for all new integrations.
Obtaining a session key for XML-RPC:
$client = new \PhpXmlRpc\Client('https://wubook.net/xrws/');
$msg = new \PhpXmlRpc\Request('wired.acquire_token', [
new \PhpXmlRpc\Value(WUBOOK_USER),
new \PhpXmlRpc\Value(WUBOOK_PASS),
new \PhpXmlRpc\Value(WUBOOK_PROVIDER_KEY),
]);
$response = $client->send($msg);
$token = $response->value()->scalarval();
For the Zak API, authentication uses Authorization: Bearer {access_token}, with the token obtained via OAuth 2.0.
Availability Synchronization via Wubook
The Zak API method GET /properties/{id}/rooms returns room types. GET /properties/{id}/availability returns availability for a date range.
The availability response includes a rooms array (room types), and for each type — an array of dates with an avail field (number of free units). Results are stored in bl_wubook_availability using the same pattern as other PMS integrations:
foreach ($availData['rooms'] as $roomType) {
foreach ($roomType['dates'] as $dateEntry) {
WubookAvailabilityTable::addOrUpdate([
'ROOM_TYPE_ID' => $roomType['id'],
'DATE' => new \Bitrix\Main\Type\Date($dateEntry['date']),
'QTY' => (int)$dateEntry['avail'],
]);
}
}
Creating a Reservation via the Zak API
POST /properties/{id}/reservations:
$payload = [
'checkin' => $dateFrom,
'checkout' => $dateTo,
'rooms' => [['id' => $wubookRoomId, 'amount' => 1]],
'customer' => [
'name' => $guestName,
'email' => $guestEmail,
'phone' => $guestPhone,
],
'amount' => $totalAmount,
'currency' => 'RUB',
'channel' => 'WEB',
'notes' => 'Order #' . $orderId . ' from website',
];
$result = $zakClient->post('/properties/' . WUBOOK_PROPERTY_ID . '/reservations', $payload);
Wubook returns a reservation_id (numeric) and a reservation_code (string, shown to the guest). Both are saved to the 1C-Bitrix order.
Channel Manager and Availability Conflicts
Wubook distributes rooms across channels (Booking.com, Airbnb, direct). When the channel manager allocates a room on Booking.com, Wubook automatically reduces availability. This makes availability synchronization critical: a 15-minute agent interval may be too slow.
The solution is webhook notifications from Wubook on availability changes. Wubook supports push notifications (notifications) via POST /properties/{id}/notifications/subscribe. Upon receiving an availability_changed event, immediately invalidate the cache and issue a targeted availability request for the affected dates and room types.
Cancelling Reservations
DELETE /properties/{id}/reservations/{reservation_id} or PUT with status cancelled. Wubook immediately releases the slot for other channels.
In 1C-Bitrix: an order status handler triggers the cancellation API call when the order moves to "Cancelled". On network error — the operation is saved to bl_wubook_pending_ops for retry processing by an agent.
Timeline
| Phase | Duration |
|---|---|
| Zak API + OAuth setup | 1 day |
| Room and availability synchronization | 2–3 days |
| Reservation creation and cancellation | 2 days |
| Webhook subscription and handler | 2 days |
| Testing with a live property | 2 days |
| Total | 9–12 days |







