How to Sync an App with an ERP Without Duplicate Records or Lost Changes
A practical playbook for assigning data ownership, linking record IDs, handling conflicts and retries, and rolling out an app-to-ERP integration in controlled stages.
An order is submitted in an app but does not appear in the ERP straight away. Someone presses “Submit” again; when the connection recovers, two orders appear. Elsewhere, an update from the app overwrites a newer ERP status. These failures point to the same unanswered questions: which system is allowed to change each piece of data, and how does the integration recognize work it has already done?
Syncing an app with an ERP is more than connecting two APIs. The integration has to support the people creating, processing, and checking records. Before choosing tools, map that workflow and decide what should happen when a system is unavailable, a message arrives twice, or the two systems disagree.
Start with the workflow and data ownership
Pick a narrow process, such as sending orders from an app to the ERP. List its states: draft, submitted, accepted, being prepared, and closed. For each transition, identify who initiates it, which system confirms it, and what users see while confirmation is pending. “Submitted” in the app should not imply “accepted by the ERP” when no acknowledgement has arrived.
Then assign ownership by field and by stage, not just by record. The app might own the draft and user-facing notes; the ERP might own the confirmed order ID and operational status. A delivery address could be editable before preparation starts but require validation or human intervention afterwards. If both systems permit edits, agree on an explicit rule to accept, reject, or review competing changes.
This ownership map also exposes unnecessary synchronization. If a field is only displayed in the app, showing the ERP’s current value may be better than maintaining two editable copies. Reducing two-way writes often simplifies the product more than building elaborate reconciliation rules.
Use stable IDs and make creation safe to repeat
Do not match orders by customer name, date, or another field that might change. Give each app submission a stable identifier and retain the link to the ID returned by the ERP. That mapping lets later updates reach the right record and gives operators a way to trace what happened.
Creation needs idempotency: repeating the same request must not create another order. If the ERP supports a unique external key, use the app’s identifier. If it does not, the integration layer must keep the mapping and check the outcome before attempting the operation again. One failure deserves particular attention: the ERP accepts the order, but its response is lost. A blind retry could create a duplicate; first determine whether the earlier operation succeeded.
Store pending integration work alongside the business action that produced it, so a failure between “save the order” and “send it” does not leave invisible work behind. A queue or outbox record can help, provided someone owns its monitoring and recovery policy. The tool alone does not guarantee correct delivery.
Plan for concurrent edits, retries, and exceptions
An update should identify its order and the version of that order on which the change was based. If the ERP has moved to an incompatible state, the integration should not overwrite it automatically. It can reject the update, return the current status to the app, and offer a review path. Timestamps help with investigation, but “last change wins” does not answer who was authorized to edit a field.
Separate temporary failures from permanent ones. A network interruption may warrant spaced retries; a missing required field needs a data correction, not another attempt. Cap retries, record the reason for failure, and route unresolved items to an operational worklist with clear next steps. Do not let a silent exception block every subsequent change to the same order indefinitely.
Set a reconciliation routine as well: compare expected orders and statuses across both systems to find missing records, duplicates, or mismatches. The goal is not to hide differences with a bulk overwrite. Investigate their cause and repair them with a traceable action. Decide who reviews the worklist, who may correct a record, and when the process owner must be consulted.
Test the real journey, then roll out gradually
Tests should cover more than successful API responses. Submit the same creation twice; interrupt the connection after the ERP accepts an order; deliver updates out of sequence; edit the same field in both systems; try invalid data and an extended outage. Check the records and the user experience: confirmations, pending states, and error messages people can act on.
Protect the integration with narrowly scoped credentials, access controls for corrective actions, and logs that support investigation without exposing more data than necessary. Before launch, agree on how to pause submissions, recover pending work, and return to a known state if something goes wrong. Operations staff need to distinguish an expected delay from an issue requiring intervention.
Begin with one order type or a limited user group. Track how many submissions remain pending, how many need review, whether duplicates appear, and how long confirmed changes take to show up. Examine actual exceptions with process owners before expanding. If ownership rules or states remain unclear, fix them first: scaling an ambiguous sync only increases reconciliation work.
If you are planning this integration, Cibercoding can help review the workflow and define a first rollout that can be checked in production.
Topics
- Integrations
- ERP
- App Development
- Data Synchronization
- Software Architecture
Related content
Related articles
- Webhooks vs. polling: choosing how applications stay in syncA practical comparison of webhooks and polling for keeping applications in sync. Explore latency, API limits, reliability, and operational effort, plus criteria for choosing and testing an integration.
- How to integrate an external service without letting its outages stop your appAn external provider's outage should not automatically become a product outage. Learn how to classify dependencies, set timeouts, retry safely, handle pending states, and test the experience when a provider fails.
- How to prevent duplicate records when connecting two systems through an APIA practical guide to preventing duplicate records in API integrations: establish record identity, make repeated requests safe, handle retries and test the workflow before launch.