Automated Check Delivery to Messengers for 1C-Bitrix

After an online payment, the buyer receives an electronic receipt by email as required by 54-FZ. The problem: up to 20% of such emails end up in spam — especially with mass email services like Gmail and Yandex. The user does not see the receipt, and the store risks penalties from the Federal Tax Ser

Our competencies:

Frequently Asked Questions

After an online payment, the buyer receives an electronic receipt by email as required by 54-FZ. The problem: up to 20% of such emails end up in spam — especially with mass email services like Gmail and Yandex. The user does not see the receipt, and the store risks penalties from the Federal Tax Service for each undelivered receipt. Sending the receipt via messenger — Telegram or WhatsApp — solves the delivery issue: messengers are read more often and faster, with delivery rate reaching 99%. We will set up this process for your Bitrix: attach an event handler to the payment event, retrieve the receipt URL from the cash register module, and send it to the user in the chosen messenger. Additionally, we set up an SMS fallback if the messenger is unavailable. Saving on fines and increasing customer loyalty are the practical results of such integration.

Advantages of messengers over email

Characteristic Email Messenger (Telegram/WhatsApp)
Deliverability 70-80% 98-99%
Average read time 2-3 hours 1-2 minutes
Convenience Requires searching inbox Always in the chat

According to the Federal Tax Service letter No. ED-4-20/12470@, failure to send a receipt incurs a fine. Messengers solve this problem.

How to set up sending a receipt to Telegram?

The fiscal receipt is created by the cash register module at the moment of payment confirmation. Bitrix works with online cash registers via modules: atol.online, evotor.kassa, orangedata and similar. After fiscalization, the module saves the receipt URL in the b_sale_pay_system_action table or in the payment's custom field.

The event OnSaleOrderPaid (module sale) — by this moment the receipt should already be created. Depending on the cash register module, this may be synchronous or with a delay of up to 30 seconds.

Getting the receipt URL from the ATOL module

// Читаем URL чека из данных платежа $payment = $order->getPaymentCollection()->getInnerPayment(); $checkUrl = $payment->getField('PS_PARAMS') ?? null; // Для АТОЛ чек хранится в отдельной таблице $checkResult = \Atol\Online\Check::getByOrderId($order->getId()); $checkUrl = $checkResult['RECEIPT_URL'] ?? null; 

The exact storage location depends on the cash register module. Before development, review the documentation of the specific module and its tables/fields.

Event handler: sending a receipt after payment

\Bitrix\Main\EventManager::getInstance()->addEventHandler( 'sale', 'OnSaleOrderPaid', function (\Bitrix\Main\Event $event) { $order = $event->getParameter('ENTITY'); $payment = $event->getParameter('PAYMENT'); $userId = $order->getUserId(); // Получаем URL чека — с небольшой задержкой, если кассовый модуль асинхронный $checkUrl = self::waitForCheck($order->getId(), 3); // ждём до 3 секунд if (!$checkUrl) { // URL чека не получен — логируем, email уже отправлен стандартно return; } $message = sprintf( "Ваш кассовый чек по заказу #%d:\n%s", $order->getId(), $checkUrl ); // Определяем предпочитаемый канал пользователя $user = \Bitrix\Main\UserTable::getById($userId)->fetch(); if (!empty($user['UF_TELEGRAM_CHAT_ID']) && $user['UF_NOTIFY_TELEGRAM'] === '1') { \Local\Telegram\BotService::sendMessage( $user['UF_TELEGRAM_CHAT_ID'], $message ); } elseif (!empty($user['UF_PHONE']) && $user['UF_NOTIFY_WHATSAPP'] === '1') { \Local\WhatsApp\Service::sendMessage($user['UF_PHONE'], $message); } // email всегда отправляется стандартным механизмом Битрикс } ); 

If the cash register module creates the receipt asynchronously (via queue), synchronous waiting is not enough. In that case, we subscribe to the event of the cash register module itself:

// Событие АТОЛ Онлайн после получения ответа ОФД \Bitrix\Main\EventManager::getInstance()->addEventHandler( 'atol.online', 'OnReceiptRegistered', function (\Bitrix\Main\Event $event) { $orderId = $event->getParameter('ORDER_ID'); $checkUrl = $event->getParameter('RECEIPT_URL'); // Отправляем в мессенджер здесь } ); 

Message format with a receipt

For Telegram, you can add a button with a link to the receipt via InlineKeyboard:

$payload = [ 'chat_id' => $chatId, 'text' => "Чек по заказу #{$orderId} готов.", 'parse_mode' => 'HTML', 'reply_markup' => json_encode([ 'inline_keyboard' => [[ ['text' => 'Открыть чек', 'url' => $checkUrl], ]], ]), ]; 

How to get the receipt URL from an asynchronous module?

Asynchronous modules (ATOL with queue, Evotor with delay) do not return the receipt URL immediately after payment. Instead of OnSaleOrderPaid, we use the module's event, for example OnReceiptRegistered for ATOL. This guarantees that the URL is already saved in the database. If such an event is missing, we organize polling via an agent: every 5 seconds we check if the receipt appeared, up to 10 attempts.

Setup instructions

  1. Install and activate the online cash register module (ATOL, Evotor, Orange Data).
  2. Add custom fields to store the Telegram chat ID and phone number for WhatsApp.
  3. Implement the payment event handler as shown above.
  4. Configure the Telegram bot and WhatsApp Business APIs.
  5. Test the scenario on a test environment: pay for an order and check receipt delivery.
Test environmentWe deploy a copy of your site with the online cash register in debug mode. After successful tests, we migrate to production.

What is included in the work

Stage Description Duration
Analysis Study the current cash register module, user fields, messenger APIs 1-2 hours
Implementation Write the handler, configure sending 4-8 hours
Testing Verify on a test environment with a real receipt 1-2 hours
Documentation Operating instructions, event descriptions 1 hour
Training Demonstrate operation, answer questions 0.5 hour

Setup time: from 1 to 3 working days depending on complexity.

We guarantee that the receipt will be delivered to the messenger within 1-2 minutes after payment. In case of asynchronous fiscalization, no more than 30 seconds after the URL appears.

Comparison of delivery channels

Characteristic Telegram WhatsApp
Deliverability 99% 98%
Read speed 30-60 sec 1-2 min
Button support Yes (InlineKeyboard) Yes (via WhatsApp Business API)
Setup complexity Low Medium (requires Business API)
Limitations No limits 1000 messages per day for Business API

The choice of channel depends on the audience: Telegram is easier to set up, WhatsApp is more popular in B2C. We recommend setting up both with user priority.

Our expertise

  • Certified 1C-Bitrix specialists with over 5 years of experience.
  • Successfully completed more than 50 integrations of online cash registers with Bitrix and Bitrix24.
  • Support for all popular modules: ATOL, Evotor, Orange Data, as well as custom ones.
  • Free consultation and one month of support after launch.

Contact us to discuss details. Order turnkey setup, and your customers will always receive receipts on time.