CRM integration: Bitrix24, amoCRM, Salesforce, HubSpot
A sales manager keeps deals in CRM, but leads from the site drop to email. They manually move them. Half are lost. Forgets to call back. This is not the manager's problem — it's an architectural gap between the site and the company's processes.
CRM integration closes this gap: form submissions, chats, calls, e-commerce fall directly into the funnel, deals are created automatically, the manager gets notified within 30 seconds of form submission, not 3 hours later.
Bitrix24: REST API and events
Bitrix24 — most common CRM on the Russian market. REST API available via OAuth 2.0 or incoming webhook (simpler, but less secure for production). Main entities: lead (lead), deal (deal), contact, company.
Creating a lead: POST /rest/crm.lead.add with set of fields. Binding to funnel (deal type): SOURCE_ID. Adding comment: crm.timeline.comment.add. Real-time change tracking — via Event Handlers: register hook via event.bind, Bitrix24 sends POST to our endpoint when deal status changes.
Bitrix24 complexity — custom fields. Each installation has unique ones, their IDs need to be queried via crm.lead.fields. Full field synchronization between site and CRM requires either manual mapping or automatic field discovery mechanism.
amoCRM: modern REST
amoCRM (now Kommo for international market) has cleaner API. OAuth 2.0 with refresh token, JSON API, predictable endpoints. Funnels — pipelines, deals — leads, contacts — contacts.
Feature: when creating a deal, you must explicitly pass pipeline_id and status_id. Without them, the deal falls into default funnel, which often isn't what's needed. Tags for classifying lead sources — via _embedded.tags. Webhook for incoming events — configured in personal account, supports add, update, delete, status, note.
What to do with Salesforce and HubSpot
Salesforce — enterprise choice. REST API, SOQL for complex queries, Apex for server-side logic within the platform. Integration via Salesforce REST API or via Zapier/MuleSoft if budget allows middleware. For direct integration from PHP — phpforce/soap-client or developerforce/Force.com-Toolkit-for-PHP. Main complexity — mapping custom objects and fields, which each enterprise instance has hundreds of.
HubSpot — popular with SaaS companies and international B2B. HubSpot API v3 — REST, good SDK for PHP and Node.js (@hubspot/api-client). Contacts, Companies, Deals — standard objects. Forms API allows sending data from any form directly to HubSpot without native widget (important for custom form design).
Integration architecture
Queue — mandatory. Synchronous API request to CRM directly from form handler — bad idea. API can be unavailable 2 seconds, user waits. Right scheme: form submits → save to DB → put job in queue → return 200 to user immediately → worker asynchronously sends to CRM → on error — retry with exponential backoff.
Deduplication. Same contact can fill form twice. CRM shouldn't create two duplicate leads. Check before creating: search by email via crm.duplicate.findByComm (Bitrix24) or contacts/search (HubSpot), if found — add task/comment to existing, don't create new.
Two-way synchronization. If manager changes deal status in CRM — site should know (for example, for customer personal account). Webhooks from CRM → endpoint on site → updating status in DB → notifying customer. Important: verify webhook signature and respond 200 OK quickly (within 5 seconds), otherwise CRM considers delivery failed.
Timelines
| Scenario | Timeline |
|---|---|
| One CRM, lead transfer from forms | 1–2 weeks |
| Two-way synchronization + statuses | 3–5 weeks |
| Multiple CRM + custom field mapping | 4–8 weeks |
Cost calculated individually after auditing current processes and data structure in CRM.







