Setting Up Order Transfer from Site to Bitrix24 CRM
An order is placed on the site, but CRM is empty. The manager copies data manually — 30 minutes per order. With 20 orders per day, that's 10 hours lost. The client calls back, but there's no history. Connecting the site and Bitrix24 via the OnSaleOrderSaved event and REST API is a task that takes a few hours and saves dozens of human-hours monthly. We, certified Bitrix24 specialists with over 6 years of experience, have implemented over 50 such integrations. We guarantee stable operation without data loss and with minimal modifications. We'll assess your project in one day — request a consultation.
Transferring Orders to CRM: Why It Matters?
Without automatic deal creation, managers work blind. Contacts are created manually, statuses are not synchronized, analytics are missing. The result: lost leads and reduced LTV. Integration via REST API solves these problems: all customer data, order total, and product list immediately enter the funnel. Order processing time reduction reaches up to 80% — this is not just convenience but a direct conversion boost. Manual entry takes 30 minutes, automation takes 3 minutes — 10 times faster. Operational cost savings can reach up to 150,000 rubles per month at 30 orders daily. At 50 orders per day, savings exceed 200,000 rubles monthly.
How to Implement Integration?
What Is Transferred to CRM
Upon order creation, we create in Bitrix24:
-
Contact (
crm.contact.add) — with name, phone, email. -
Deal (
crm.deal.add) — with amount, status, and link to contact. -
Product rows (
crm.deal.productrows.set) — list of items with quantity and price.
For legal entities, additionally create a Company (crm.company.add) and link via COMPANY_ID.
Order Event Handler
// В init.php или обработчике модуля AddEventHandler('sale', 'OnSaleOrderSaved', 'onOrderSavedHandler'); function onOrderSavedHandler($order) { $isNew = $order->isNew(); if (!$isNew) return; // обрабатываем только новые заказы $orderId = $order->getId(); $orderProps = $order->getPropertyCollection(); $basket = $order->getBasket(); // Собираем данные покупателя из свойств заказа $name = $orderProps->getItemByOrderPropertyCode('NAME')->getValue(); $phone = $orderProps->getItemByOrderPropertyCode('PHONE')->getValue(); $email = $orderProps->getItemByOrderPropertyCode('EMAIL')->getValue(); // Передаём в Б24 $b24 = new B24Integration(); $contactId = $b24->findOrCreateContact($phone, $email, $name); $dealId = $b24->createDeal($orderId, $order->getPrice(), $contactId); $b24->setDealProducts($dealId, $basket); } Field Mapping Between Order and CRM
| Order field (property) | Contact field (CRM) | Comment |
|---|---|---|
| NAME | NAME + LAST_NAME | Split by space (optional) |
| PHONE | PHONE[0].VALUE | Number with country code |
| EMAIL[0].VALUE | Primary email | |
| Note | UF_CRM_ORDER_COMMENT | Custom field if needed |
Similarly for deals: order total → OPPORTUNITY, status → STAGE_ID.
Status Mapping Configuration
| Order status | Status code | Bitrix24 deal stage |
|---|---|---|
| New | N | NEW |
| Confirmed | P | PREPARATION |
| Paid | A | EXECUTING |
| Shipped | D | FINAL_INVOICE |
| Completed | F | WON |
| Canceled | C | LOSE |
When the order status changes on the site, call crm.deal.update with the new stage. Save the Bitrix24 deal ID in the order property B24_DEAL_ID or in b_sale_order_props_value. Time saved: instead of 5 minutes of manual update — 0.5 seconds automatically.
Storing Order–Deal Link
// Сохраняем ID сделки в свойствах заказа $dealProp = $orderProps->getItemByOrderPropertyCode('B24_DEAL_ID'); if ($dealProp) { $dealProp->setValue($dealId); $order->save(); } Product Rows
crm.deal.productrows.set replaces the entire product list. Each item:
$products[] = [ 'PRODUCT_NAME' => $basketItem->getField('NAME'), 'PRICE' => $basketItem->getPrice(), 'QUANTITY' => $basketItem->getQuantity(), 'CURRENCY_ID' => 'RUB', 'PRODUCT_ID' => 0, // если нет каталога в Б24 — 0 ]; If Bitrix24 has a product catalog synchronized with the site via CommerceML, pass the real PRODUCT_ID for correct product analytics.
How to Avoid Contact Duplicates?
On repeat orders, check for existing contact via crm.duplicate.findByComm by phone. If a contact exists, use its ID — do not create a duplicate. The new deal links to the existing contact. According to Bitrix24 REST API documentation, the crm.duplicate.findByComm method prevents duplicates. Manual check takes 5 minutes per order, automatic — 0.5 seconds.
Typical Errors and Their Solutions
What usually goes wrong?
- Missing contact duplicate check — leads to CRM clutter. Solution: always call
crm.duplicate.findByComm. - Incorrect status mapping: for example, if the funnel has multiple stages and the status code doesn't match. Solution: agree on mapping before launch.
- Exceeding REST API request limits. Solution: use agent queue and no more than 2 requests per second.
- Ignoring custom fields: if the order has custom properties, they need to be explicitly mapped to UF_CRM_*.
Our Approach and Process
We use the stack: PHP 8.1+, infoblocks v2.0, Bitrix ORM, REST API (cloud or on-premise). Handlers are wrapped in try-catch, errors are written to an HL-block. Webhook permissions are set: crm.contact.add, crm.deal.add, crm.deal.update, crm.duplicate.findByComm, crm.deal.productrows.set. We adhere to limits — no more than 2 requests per second.
Work Stages
- Analysis — study order structure, sales funnel, identify non-standard fields.
- Design — create field and status mapping scheme, agree with you.
- Implementation — write handler, configure webhook, test on a sample order.
- Testing — check deal creation/update, duplicates, error handling.
- Deployment — roll out to production, monitor logs for the first day, provide warranty.
Timeline Estimates
Basic setup for new orders — 6–8 hours. Full two-way status synchronization — 2–3 business days. Cost is calculated individually after auditing your site. We'll assess your project for free — request a consultation.
Typical problems arise from missing duplicate checks or incorrect status mapping. Our experience shows: 80% of errors are solved by adding checks and async processing. We guarantee stable integration and post-launch support. Contact us for a detailed audit of your system.

