Guides
CRM API Integration: Connect Your ERP, Store or App
Published October 10, 2026 · 10 min read
If your business runs on an ERP, a custom-built store or your own app, no off-the-shelf plugin is going to cover you. You need a CRM API integration. This guide covers what a CRM API should offer, how to design an integration that still works six months later, and what to check before you go live.
What is a CRM API integration? It is a connection where your own systems create, update and read CRM records (contacts, orders, deals) through the CRM's programmable interface, usually REST with JSON, with no one copying data by hand. Done well, your ERP or app stays the source of the data and the CRM keeps itself current.
Most failed integrations I've been asked to rescue failed for the same reason. They were designed around the happy path, and nobody decided what should happen when a request dies halfway. Let's avoid that.
When you need a CRM API integration instead of a plugin
If you sell on WooCommerce, Shopify or PrestaShop, a plugin is the easier route. See our WooCommerce CRM integration guide for that path.
An API integration makes sense when:
- Customers or orders originate in an ERP, whether commercial or built in-house.
- Your online store is custom and no connector exists.
- You run an app or SaaS platform and want new signups to land in the CRM.
- You need to move data no plugin understands: contracts, subscriptions, device readings, field service visits.
What to look for in a CRM API
APIs vary a lot. Before you commit, sit down with your developer, open the docs and check these points.
API key authentication
For server-to-server integrations, API keys sent in a header (for example Authorization: Bearer <key>) are the most practical option. Check that you can create several keys, revoke them individually and see when each was last used. Use one key per connected system. If your ERP is ever compromised, you revoke its key and everything else keeps running.
Idempotent upserts
This is the single most important feature, and the one people overlook. An upsert creates a record if it doesn't exist and updates it if it does. Idempotent means sending the same request twice gives the same result, with no duplicates.
Why it matters: networks fail. Your code will send a batch, get no response, and send it again. If the API isn't idempotent, you'll have every customer twice.
To make this work, the API has to accept an external_id holding the record's ID in your system. Email is a useful fallback, but a poor sole key, because people change email addresses.
Batch endpoints
Sending 40,000 customers one request at a time is slow and runs straight into rate limits. Look for endpoints that accept hundreds of records per call and return a result for each record, so you know exactly which ones failed.
Outbound webhooks
The API lets you write into the CRM. Webhooks are the way back: the CRM calls your system when something happens, such as a contact moving stage, a deal being won or someone unsubscribing. Without webhooks you'd be polling the CRM every few minutes to spot changes.
Documented rate limits
Every API has limits. What you need is for them to be documented, and for the API to respond with a clear status (usually 429) when you hit them, so your code can back off and retry.
Custom fields you can actually write to
If your business has its own data (member number, contract type, renewal date), the API must let you write it to custom fields. If adding a field means opening a support ticket, the integration will be painful to maintain.
CRM API integration architecture: three phases
The structure that holds up best has three distinct phases. Keep them separate.
Phase 1: initial bulk import
Load everything that exists today: customers first, then orders or invoices. You do this once, in batches, with a script you can safely rerun thanks to idempotency. Log every batch: how many records were created, updated and rejected.
A hypothetical example: a distributor with 18,000 customers and 120,000 orders in its ERP. At 500 per batch, that's 36 customer requests and 240 order requests. Even with pauses to respect rate limits, the whole load fits into an afternoon.
Phase 2: incremental sync
From then on you only send what changes. Two common patterns:
- Event-driven: when the ERP creates or edits a customer, it triggers a push to the CRM. Close to real time.
- Scheduled: every 5 or 15 minutes, a job picks up records modified since the last run and sends them as a batch.
The scheduled approach is easier to maintain and handles outages better. If the CRM is unreachable, the next cycle picks up whatever is pending. For most small businesses, a 15-minute delay changes nothing.
Phase 3: webhooks back to your system
Configure CRM webhooks so your system hears about things that only happen in the CRM: an unsubscribe, a change of account owner, a won deal that should become an order in the ERP. Always verify the webhook really came from the CRM, and acknowledge it quickly; do any heavy processing in the background.
Field mapping: the boring part that decides everything
Before anyone writes code, build a table listing every source field, its CRM destination, the data type and any transformation. It will save you weeks.
| Field in your system | CRM field | Type | Transformation |
|---|---|---|---|
| customer_id | external_id | Text | Cast to string |
| Lowercase, trim spaces | |||
| full_name | first_name / last_name | Text | Split on first space |
| tel | phone | Phone | Add country code if missing |
| signup_date | Signup date (custom) | Date | ISO 8601 |
| customer_type | Tag | Tag | "wholesale" or "retail" |
| marketing_optin | Marketing consent | Boolean | Y/N to true/false |
Also decide which system owns each field. If a sales rep corrects a phone number in the CRM and the ERP overwrites it with the old one the next morning, people stop trusting the CRM. A simple rule: billing data belongs to the ERP; tags, notes and stages belong to the CRM.
Sample payload: batch contact upsert
Here's what a typical batch upsert request looks like. This is the shape of Flowgration's POST /api/v1/contacts/batch endpoint, but the idea carries over to any well-designed CRM API.
POST /api/v1/contacts/batch
Authorization: Bearer <your_api_key>
Content-Type: application/json
{
"records": [
{
"external_id": "ERP-10482",
"email": "emma.clarke@example.com",
"first_name": "Emma",
"last_name": "Clarke",
"phone": "+447700900123",
"tags": ["wholesale", "north-region"],
"custom_fields": {
"signup_date": "2024-03-18",
"contract_type": "annual"
}
},
{
"external_id": "ERP-10483",
"email": "orders@millerhardware.example",
"first_name": "Sam",
"last_name": "Miller",
"tags": ["retail"]
}
]
}
Three details worth noticing. Every record carries an external_id, so resending the batch won't create duplicates. Tags travel as a list. And business-specific data sits inside custom_fields, kept apart from the standard fields.
Error handling in a CRM API integration
This is what separates an integration that runs quietly from one that someone has to babysit every Monday.
- Tell temporary errors from permanent ones. Retry a 429 or a 503 with exponential backoff (1, 2, 4, 8 seconds). A 400 for an invalid email won't fix itself on retry; send it to a review queue.
- Don't let one bad record sink the batch. If the API reports a result per record, store the failures and carry on with the rest.
- Log everything by
external_id. When someone asks why a customer is missing from the CRM, you should find the answer in the logs within a minute. - Alert when sync stalls. If nothing has synced for an hour during business hours, someone should get a notification.
- Validate before sending. Emails without an @, impossible dates, phone numbers with letters in them. It's cheaper to catch these at the source. If your data is already messy, run through our CRM data cleanup process first.
CRM API integration go-live checklist
Copy this and work through it before you switch anything on:
- One API key per system, stored in a secrets manager, never in source code.
- Field mapping table reviewed by both the business side and the developer.
- Field ownership decided for every synced field.
-
external_idon every record. - Idempotency test passed: the same batch sent twice creates no duplicates.
- Initial import run against a test account first.
- Final count reconciled: customers in source vs contacts in the CRM.
- Exponential backoff for 429 and 5xx responses.
- Review queue for rejected records.
- Inbound webhooks verified and acknowledged within a few seconds.
- Marketing consent synced and respected.
- Alert configured for stalled sync.
- Internal notes: who owns the integration and where the logs live.
If you're rolling out the CRM itself and not just the integration, pair this checklist with our CRM implementation plan.
Putting the data to work
The integration is the plumbing. The point is what you do with the data: segment by customer type, alert a rep when an account hasn't ordered in 60 days, or start a sequence when a new customer places their first order. For automation ideas, see our guide to email journeys. For a sense of what a CRM does with incoming orders, read how a CRM for ecommerce works.
In Flowgration, the REST API authenticates with API keys, the bulk import API takes batches of up to 500 contacts or orders and is idempotent, and outbound webhooks can be added as a step inside any journey. The full reference lives in the API documentation.
Frequently asked questions
What's the difference between an API and a webhook? With an API, your system calls the CRM to send or fetch data. With a webhook, the CRM calls your system when something happens. A complete integration usually uses both.
How many records should I send per batch? As many as the API allows, within reason. Batches of 100 to 500 records are a good balance between speed and how easy it is to pinpoint failures. Retrying 200 records is much easier than retrying 5,000.
Should I use email or my own system's ID as the key?
Use your system's ID as the external_id and email as a fallback. Emails change and are sometimes shared, like a company with one orders@ address. Your internal ID doesn't change.
Can I build a CRM API integration without a developer? For simple cases, no-code automation tools can connect two APIs. For an ERP with thousands of records, error handling and customer data at stake, it's worth having someone experienced build it.
How do I test without polluting my live CRM? Use a test account or separate environment with its own API key. Load a sample of 200 to 300 real records, check the results by hand, and only then run the full import.
To see how it fits your stack, open a free Flowgration account (up to 500 contacts, no expiry), generate an API key and send your first test batch using the API documentation.
Build your WooCommerce CRM in 60 seconds
Flowgration turns your store's orders into a living CRM and runs email, SMS and WhatsApp on autopilot. Free up to 500 contacts.
Start free