Integrating an online store with CRM and ERP via API: a guide

  • Home
  • Integrating an online store with CRM and ERP via API: a guide
Integrating an online store with CRM and ERP via API: a guide

Integrating a store with CRM and ERP via API makes sense when your operations team manually copies orders, stock levels and invoices between three systems, and ready-made plugins cannot handle your company’s logic.

This guide shows how to plan such an integration: from a data flow map, through an architecture with a middleware layer, to security and maintenance. It is written from the perspective of a software house that designs these connections, so you will find typical pitfalls and questions worth asking before you start. It applies to a store that handles orders, stock levels, customer history, invoices and shipping statuses.

API integration or ready-made plugins - when to choose which

A ready-made connector is enough when your sales process is standard, and a custom API is needed when the company has non-standard statuses, price lists or warehouses. The first instinct is usually to look for something off the shelf, and that is a sensible start. However, ready-made connectors between an e-commerce platform and an ERP often fail with unusual logic. Typical failure points: mapping custom order fields, syncing returns that require manual work, and a plugin that stops working after an ERP update because its vendor dropped support. With hundreds of transactions a day, depending on an external plugin vendor is a real operational risk.

A sign that you need a custom integration is the requirement for full two-way synchronization. An order from the store goes straight to the ERP. A stock change in the ERP updates the website right away. The CRM collects contact history, complaints and purchase preferences that shape segmentation and offers. This kind of three-way flow can rarely be built from ready-made blocks without compromises. Check your list of requirements before choosing, especially these points:

  1. Custom order statuses - your own fulfillment stages that a typical connector does not recognize
  2. Dedicated B2B discounts - individual price lists for wholesale customers synced from the ERP to the store
  3. Multiple warehouses - several locations with separate stock levels that should look like one product range in the store
  4. Automatic invoices - documents created in the ERP that must come back to the customer account in the store
  5. Returns and corrections - a process that requires simultaneous updates in all systems

Tip 1: before you start the integration, map the data flows between systems. Draw a diagram: which data is created where, where it goes and how often it changes. Without this map, even the best API will not help, because nobody knows what actually needs to be synchronized. It is also the cheapest moment to catch conflicting expectations between departments.

Integration architecture - a middleware layer instead of point-to-point connections

The safest architecture for three or more systems is a central middleware layer that each system talks to separately. The most common mistake when connecting several systems is building direct connections between them. The store calls the CRM API, the CRM queries the ERP, the ERP updates the store, and you end up with a web of dependencies where a failure in one element takes down the rest. Middleware as a communication hub cuts these dependencies: no system talks directly to the others.

This is the classic separation of responsibilities, only at the infrastructure level. The store takes orders and displays products. The CRM manages customer relationships. The ERP controls the warehouse, finance and logistics. The middleware transforms data, queues events and handles errors. A change of data format in one system means a fix only in the middleware layer, not in all connected services. For maintenance, that is a huge difference.

There are two synchronization models to choose from: periodic polling of systems, or an event-driven architecture in which every change sends a notification right away. In practice, a hybrid often wins. Orders and status changes go through webhooks as events, because speed matters here. Stock levels can be synced periodically, for example every few minutes, if the ERP does not support webhooks for warehouse operations. It is a compromise, but a predictable one that is easy to monitor.

Tip 2: logging and monitoring from day one. Record every API call, response time, transferred data and error codes. Without logs, debugging turns into guesswork: you see the effect, but you do not know when or why something went wrong.

The most common technical problems at the start of an integration

The first months of an integration are usually a fight with data formats, API limits and write conflicts. Format mismatches are almost certain: the ERP stores dates as DD.MM.YYYY, the store uses ISO 8601, and the CRM uses Unix timestamps. Product IDs may be numeric in one system and alphanumeric in another. Prices in the ERP include tax, while the store works with net amounts. Each such difference is a separate transformation rule in the middleware, and it is worth adding buffer time to the schedule, because they only show up in tests on real data.

The second typical problem appears with higher traffic: rate limiting on the ERP side. Vendors do not always document API call limits, so with a small number of orders everything works, and during a sales peak HTTP 429 errors start coming back. The solution is queuing with exponential backoff. It is better to ask the vendor about limits before launch than to learn them from error messages.

The third category is data conflicts. A customer changes their address in the store account, and at the same time a consultant updates the same data in the CRM. Which write wins? Without a clear conflict resolution strategy, inconsistencies appear that the operations team only discovers at shipping. Rules such as “last write wins” or “master system for a given field” must be written down before deployment.

  • Wrong mapping of units of measure - the ERP counts in pieces, the store in bulk packs
  • Connection timeouts during large price list updates covering thousands of products
  • Duplicate orders when a failed API call is retried
  • Non-idempotent ERP endpoints - sending the same request twice creates two documents
  • Product categories drifting apart between the store and the ERP after manual edits in one of the systems

Security and authorization in communication between systems

Every connected system is a separate attack vector, so the integration needs a consistent policy for authorization, encryption and key storage. Customer personal data, financial information, order details and stock levels all pass through the API. A leak of any of them has legal and reputational consequences. On top of that, systems often offer different mechanisms: the store OAuth 2.0, the ERP static API keys, the CRM both models.

Good practice is OAuth 2.0 wherever possible: automatic token refresh and granular permissions. For a system with static keys, it is worth building an additional proxy layer that limits the scope of access and logs every call. All communication should go over encrypted TLS connections, and tokens and keys should be kept in a dedicated vault. Never in the source code and never in the repository.

Tip 3: API keys in code or in a Git repo are asking for trouble. Use environment variables and vaults such as HashiCorp Vault, even in small projects. Leaking a single key to a public repository can cost much more than the time spent setting up a vault.

This is complemented by regular key rotation and monitoring of unauthorized calls. The system should raise an alert when requests come from unknown IP addresses or when the number of authorization errors exceeds a set threshold. Such mechanisms let you detect an access attempt before it causes damage. API integration security is not something you set once: it is an ongoing process of reviews, updates and vigilance.

Which integration results to measure and what to expect

The most important results to measure are the time spent manually copying data, order fulfillment time and the number of errors, and their baseline values should be recorded before launch. Without a “before” measurement, you cannot fairly assess the return. After deployment, manual work should come down to checking exceptions and unusual cases, and the team can focus on things that need a human decision.

The second indicator is order fulfillment time. Without integration, an order waits to be entered manually into the ERP, then for a stock check, then for an invoice. After integration, this flow can run automatically right after the order is placed, and the customer gets a confirmation with the invoice number almost immediately. It is also worth tracking store ratings and the share of returning buyers. If your store runs on WooCommerce and the company works with Subiekt or Comarch ERP Optima, a similar flow is provided by WooCommerce integration with Subiekt and Optima.

On the cost side, maintenance is the most often underestimated. ERP vendors update their APIs, which forces changes in the middleware, and on top of that comes time for monitoring and responding to incidents. The integration budget should therefore have a separate line for maintenance, and the return on investment should compare saved working time and fewer errors with the cost of that maintenance, not just with the implementation price.

FAQ - common questions about integrating a store with CRM and ERP

How long does it take to implement a store, CRM and ERP integration via API?

Implementation time depends on the quality of the API documentation of the connected systems, the complexity of the flows and the availability of test environments. Usually the longest part is not the programming itself, but agreeing on business rules: what should happen when data in two systems conflicts, and which system wins. Such decisions can drag on for weeks. Reserve separate time in the schedule for load testing and stabilization.

Does API integration require changes to an existing online store?

Usually you do not need to touch the store itself. Most modern e-commerce platforms have an API that allows reading and writing data without modifying the source code. Changes may be needed if the store uses custom fields or processes that the API does not expose by default. In that case, extensions are built on the store side and the platform core stays untouched, so later updates are not a problem.

What happens when one of the connected systems is temporarily unavailable?

The middleware layer buffers events in a queue and retries data delivery according to configurable rules. When the ERP stops responding for a few minutes, orders wait in the queue and go through automatically once the connection is back. During longer outages, the system sends alerts to the technical team. The queue should store events on disk, not only in memory, and it is worth testing the mechanism by simulating an outage lasting several hours.

Is it worth integrating a store with CRM and ERP via API

Yes, if manual data copying eats up your team’s time and ready-made plugins do not support your company’s logic. However, you need to look at maintenance costs with your eyes open. API integration saves time, eliminates copying errors and speeds up order handling, but it requires ongoing work, mainly due to API updates in external systems and growing data volumes.

The most important rule is simple: an API integration is not a project with an end date. It is a living part of the infrastructure that needs monitoring, updates and adjustments. Treating it as a closed task leads to gradual degradation of synchronization and growing technical debt.

If you are considering integrating your online store with a CRM, an ERP or other systems, start with a data flow map and a list of conflict rules. Web Systems designs and implements API integrations, process automation and e-commerce solutions, so it can help you choose an architecture that will work not only on launch day, but also several years later. A well-planned integration of a store with CRM and ERP pays off when it has a maintenance budget from the start.

Book a free consultation

Provide your phone number or schedule a meeting