Integration of 1C-Bitrix with the Wubook booking system

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1173
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    745
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

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:

  1. XML-RPC API (legacy, but still functional) — method-oriented, authentication via lkey (session key).
  2. 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