Reliable Calculator-to-CRM Integration: Avoid Lead Loss

Reliable Calculator-to-CRM Integration: Avoid Lead Loss Picture this: 50 visitors per hour on your site, each running a calculation—and 5 leads vanish without a trace. Sound familiar? The cause is the strict limits of the Bitrix24 REST API. The cloud tariff allows 2 requests per second and 5000 p

Our competencies:

Frequently Asked Questions

Reliable Calculator-to-CRM Integration: Avoid Lead Loss

Picture this: 50 visitors per hour on your site, each running a calculation—and 5 leads vanish without a trace. Sound familiar? The cause is the strict limits of the Bitrix24 REST API. The cloud tariff allows 2 requests per second and 5000 per day. Exceeding them returns the error QUERY_LIMIT_EXCEEDED. For example, a client—a network of auto dealers—had a delivery cost calculator generating up to 50 requests per minute. Direct submission led to losing 10% of the leads. With 10+ years of Bitrix development experience, we have developed a reliable scheme with a queue and automatic retries. Below is a full breakdown of the implementation. Typical development cost ranges from $500 to $2000 depending on complexity. With a queue system, you avoid losing 10% of leads, potentially saving thousands per month—for example, a typical client saves $1,500 monthly. Contact us for a consultation—we will evaluate your project.

How It Works

Transferring Data from the Calculator to CRM via REST API

The site on 1C-Bitrix and Bitrix24 are two products with different APIs. To transfer data from a form to CRM, the Bitrix24 REST API is used:

  • crm.lead.add — create a lead
  • crm.deal.add — create a deal without a lead
  • crm.contact.add + crm.deal.add — contact + deal

Authorization: incoming webhook (simple) or OAuth application (for multiple portals). According to the documentation, limits are 2 requests per second and 5000 per day for cloud tariffs. Example of creating a lead:

// Prepare webhook URL (replace with your actual Bitrix24 webhook URL) $webhookUrl = 'https://company.bitrix24.com/rest/1/TOKEN/'; $fields = [ 'TITLE' => 'Request from calculator: ' . $calculatorName, 'NAME' => $clientName, 'PHONE' => [['VALUE' => $clientPhone, 'VALUE_TYPE' => 'WORK']], 'EMAIL' => [['VALUE' => $clientEmail, 'VALUE_TYPE' => 'WORK']], 'COMMENTS' => $calcResultText, 'SOURCE_ID' => 'WEB', 'UF_CRM_CALCULATOR_PARAMS' => json_encode($calcParams), 'UF_CRM_TOTAL_PRICE' => $totalPrice, ]; $response = file_get_contents( $webhookUrl . 'crm.lead.add.json?' . http_build_query(['fields' => $fields]) ); $result = json_decode($response, true); 

Creating Custom Fields for Calculation Parameters

Custom fields UF_CRM_* store all calculation details—selected options, total amount, configuration. The manager opens the lead and immediately sees the context. Fields are created in advance: CRM → Leads → Field settings → Add field. The type depends on the data.

Data type Example field Purpose
String UF_CRM_TYPE Product or service
Number UF_CRM_QUANTITY Quantity
List UF_CRM_COLOR Selection option
String (JSON) UF_CRM_PARAMS_JSON Full calculation configuration

How to Handle API Limits and Errors?

Cloud Bitrix24 restricts REST requests: 2 requests per second, 5000 per day (depends on tariff). When exceeded, response: {error: "QUERY_LIMIT_EXCEEDED"}. A typical implementation without a queue loses 5–10% of leads under a load of 50 requests/min.

The correct solution:

  1. Save the calculator data to a queue table (highload-block or separate table)
  2. A Bitrix agent that sends records in batches every 30 seconds, respecting limits
  3. Retry on error with exponential backoff (1s, 2s, 4s, 8s)
  4. A flag is_synced to control status
function sendPendingLeadsToCRM(): string { $pendingLeads = getUnsentLeads(limit: 10); foreach ($pendingLeads as $lead) { $result = sendLeadToB24($lead); if ($result['result']) { markLeadAsSent($lead['id'], $result['result']); } else { incrementRetryCount($lead['id']); } usleep(600000); // 0.6 sec between requests } return __FUNCTION__ . '();'; } 
Agent configuration details The agent is registered in `/bitrix/php_interface/init.php`:
\CAgent::AddAgent( 'sendPendingLeadsToCRM();', '', 'N', 30, '', 'Y', '', 100 ); 

Parameters: period 30 seconds, module empty (global), active from installation.

Why Queue Is the Best Option?

Direct submission at the moment of calculation fails under peak load. The queue guarantees delivery: 0% loss with proper configuration. Comparison:

Parameter Without queue With queue
Lead loss at peak 50/min 5–10% 0%
Lead creation time in CRM <1 sec up to 30 sec
API load peak uniform

The queue system is 10 times more reliable than direct submission, ensuring zero lead loss.

How to Not Lose a Single Inquiry?

Our client—a non-bank financial organization—faced lead loss under a peak load of 50 requests per minute. The calculator: loan amount, term, collateral type → rate and payment. Direct REST request is impossible due to limits.

Solution: queue in PostgreSQL (site on non-standard stack), sending agent every 15 seconds with 5 leads, logging all Bitrix24 responses. In parallel, an immediate email to the client with results. The manager sees the lead in CRM within 15 seconds at most after form submission. Additionally, a business process "Primary request processing" was configured: automatic assignment of responsible manager and a first-contact deadline of 30 minutes. Zero lead loss over the entire period of operation.

What's Included (Deliverables)

  • Client-side and server-side parts of the calculator
  • Creation of custom lead/deal fields
  • Handler with queue and retries
  • Configuration of Bitrix24 incoming webhook
  • Logging of all API requests and responses
  • Monitoring with alert when the unprocessed queue exceeds N records
  • Detailed documentation
  • Setup of access rights
  • Training for managers
  • 30 days of support

Development Timelines

Complexity Timeline Composition
Basic from 2 to 3 working days Simple formula, lead with 5–10 fields, without queue
Medium from 4 to 6 working days With queue and retries
Full from 5 to 8 working days Full monitoring and logging

The cost is calculated individually. Get a consultation—we will evaluate your project for free.

We have been developing on Bitrix for over 10 years and have completed 50+ integrations with CRM. We guarantee reliability and transparent support. Order the development of a calculator with saving results to CRM—contact us.