Integrate A1 SMS with 1C-Bitrix: Fast Sending in Belarus
Standard SMS providers (SMS.ru, SMSC) often fail with Belarusian numbers. They lack alphanumeric sender ID, have high costs, and deliverability issues. A1 (formerly Velcom) — Belarus's largest operator — offers an SMS gateway for legal entities. It uses a Belarusian sender and guarantees delivery across MTS, A1, life:) networks. For Bitrix integration, we develop a handler connecting the A1 SMS API with the messageservice module (for B24) or main.mail (for on-premise Bitrix). With 5+ years of experience and over 50 successful SMS integrations, we ensure a reliable setup. Contact our team for a consultation.
Why A1 SMS is Better Than Alternatives for Belarus
Unlike foreign SMS providers, A1 guarantees delivery to MTS, A1, and life:) numbers. It retains the alphanumeric Sender ID. The cost per message is significantly lower than via SMS.ru for Belarusian numbers. Pricing starts at $0.02 per SMS, depending on volume. A1 also provides official DLR (Delivery Report) and callback notifications, giving full control over delivery.
How the A1 SMS API Works
A1 provides an HTTP API; documentation is given after signing a contract. Main endpoints:
-
POST /api/sms/send— send one or multiple messages -
GET /api/sms/status/{messageId}— delivery status -
GET /api/sms/balance— account balance
Authentication uses Basic Auth or token in the header (check your contract). Request body format is JSON:
{ "phone": "375291234567", "text": "Your order #1234 confirmed", "sender": "MyShop" } Sender ID is an alphabetic name registered with A1 upon signing. Without registration, SMS come from a numeric number.
Integration with On-Premise Bitrix
In on-premise Bitrix, SMS can be sent via the messageservice module or directly via event handler. The main scenario is sending SMS on order events.
Option 1: OnSaleStatusOrder event handler
EventManager::getInstance()->addEventHandler( 'sale', 'OnSaleStatusOrder', ['A1SmsHandler', 'onStatusChange'] ); class A1SmsHandler { public static function onStatusChange($orderId, $status) { if ($status !== 'F') return; // F = completed $order = \Bitrix\Sale\Order::load($orderId); $phone = $order->getPropertyCollection() ->getPhone()->getValue(); self::sendSms($phone, "Order #{$orderId} completed"); } private static function sendSms(string $phone, string $text): void { $ch = curl_init('https://a1sms.by/api/sms/send'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'Authorization: Bearer ' . A1_SMS_TOKEN, ], CURLOPT_POSTFIELDS => json_encode([ 'phone' => $phone, 'text' => $text, 'sender' => 'MyShop', ]), CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10, ]); $response = curl_exec($ch); curl_close($ch); // Log response } } Option 2: sms.manager module. If the project uses the sms.manager module (from Marketplace or custom), we write a provider adapter. The provider is registered in settings, making A1 SMS available as a sending channel.
Integration with Bitrix24
In Bitrix24, connect an SMS provider via REST API:
- Register the provider:
messageservice.sender.addwithCODE=a1sms,TYPE=SMS,HANDLER=https://your-site.by/a1sms-handler.php. - The handler (
a1sms-handler.php) receives the request from B24 (number, text), forwards to A1 API, returns status. - For statuses, A1 sends DLR to a specified URL. The handler calls
messageservice.sender.updateto update status in B24.
After registration, A1 SMS appears in contact cards, CRM robots, and marketing campaigns.
Encoding and Transliteration
Cyrillic SMS: 70 characters per message (UCS-2). Latin: 160 characters (GSM 7-bit). To save budget, send long notifications in Latin or keep them within 70 characters. The A1 API accepts UTF-8; conversion occurs on the gateway side. However, special characters like «» and em dashes may convert incorrectly. Replace them with ASCII equivalents before sending.
Error Handling
The A1 SMS API returns error codes:
| Code | Meaning | Action |
|---|---|---|
| 0 | Success | Save messageId for status tracking |
| 1 | Invalid number | Log, do not retry |
| 2 | Insufficient funds | Alert admin |
| 3 | Limit exceeded | Queue, retry after 60 sec |
| 5 | Service unavailable | Retry after 300 sec, max 3 attempts |
For retry in on-premise Bitrix, use a CAgent that selects unsent SMS from an HL-block SmsQueue and retries. For B24, retry at the handler level.
What's Included in the Work
- A1 SMS account registration and API access
- Developing a handler to send SMS via A1 API
- Connecting to
messageservicemodule (B24) or event handlers (on-premise) - Setting up a callback for delivery statuses
- Error handling and retry logic
- Logging all sent SMS (HL-block or table)
- Documentation for installation and maintenance
- Handover of access and staff training
- Post-launch technical support (optional)
For a consultation on your project, contact our team. We will assess the scope and timelines.
Timeframes
| Stage | Tasks | Duration |
|---|---|---|
| API connection + basic sending | Handler, testing on a real number | 2–3 days |
| CRM integration (robots, campaigns) | Provider registration, SMS templates, robots | 2–3 days |
| Callback + retry + monitoring | DLR handler, queue, alerts | 3–4 days |
| Full integration | All stages + documentation | 1.5–2 weeks |
Main organizational step: contract with A1 and Sender ID registration. The technical part takes a week. Coordination with the operator takes 3 to 10 business days. Start the contract in parallel with development.
Order integration — get a consultation on your project.







