Choose the system of record for each data type

Products, prices, inventory, orders and logistics status should not all be authoritative in every system. Define where each type is created, which systems may update it and how conflicts are resolved.

For example, ERP may own product master data and available inventory, the storefront may create orders, and the warehouse may own fulfillment and tracking events. Stable boundaries prevent constant changes to mapping and direction.

Status mapping matters more than the API call

Systems may define paid, confirmed, ready to ship, partially fulfilled and completed differently. Build a state map that explains each transition and the event that triggers it.

  • Order IDs and external references must remain stable
  • Partial cancellation and refund need explicit handling
  • Reserved and physically deducted inventory should be separated
  • Logistics events should preserve their original timestamps
Key principle: define data ownership, direction and failure handling before writing integration code.

Use idempotency and retries to prevent duplicate orders

A timeout does not mean the receiving system failed to process the request. Every write should carry a repeatable business key, and retries should check the previous result to avoid duplicate orders, inventory deductions or notifications.

Retries should distinguish temporary failure from permanent error. Expired credentials, missing fields and business rule conflicts need a human resolution queue rather than endless retries.

Make synchronization observable

Operators need to see status, failure reason, last successful run and affected records rather than relying on server logs. Provide business-level logs, exception filters and controlled retry actions.

Before launch, test realistic copies of peak order volume, zero inventory, partial refunds, delayed tracking events and API rate limits.