Skip to content
Web Development

Ecommerce Event-Driven Architecture: How Events Keep Commerce Systems in Sync

How event-driven architecture works in ecommerce: events, producers, consumers, event buses, queues, webhooks, eventual consistency, retries, idempotency and monitoring.

Quick answer

In an event-driven ecommerce architecture, systems publish events when something important happens (order placed, payment captured, stock changed, return received) and other systems subscribe and react asynchronously. An event bus or broker delivers events; queues buffer work; webhooks bring events in from SaaS platforms. Because delivery can be delayed, repeated or out of order, consumers must be idempotent, retries need backoff and dead-letter queues, systems must tolerate eventual consistency, and every flow needs monitoring of lag and failures.

Where This Fits

This is the hub for the architecture cluster. Related deep dives: webhooks, queue architecture, observability and scalability. Integration basics are in API integration.

Why Events

When an order is placed, many things must happen: payment capture, inventory reservation, fulfilment, confirmation email, ERP posting, loyalty points, analytics, fraud review. If checkout calls each system directly, it becomes slow and fragile; one failing system can break checkout. Publishing an 'order placed' event lets each system react independently, and checkout only needs to succeed at its own job.

The Architecture

Adding a new consumer, such as a loyalty system, does not require changing checkout.

Common Ecommerce Events

EventTypical producerTypical consumers
order.placedCommerce platformOMS, ERP, email, analytics, fraud
payment.captured / failedPayment providerOMS, finance, customer messaging
inventory.adjustedWMS, POS, inventory serviceStorefront availability, search, marketplaces
product.updatedPIM or platformSearch index, feeds, caches
shipment.created / deliveredWMS, carrierCustomer messaging, OMS
return.receivedReturns system, POSRefunds, inventory, ERP
customer.updatedPlatform, CRMEmail and SMS, CDP

Designing Events

  • Name events in past tense for facts that happened: order.placed, not place.order
  • Include an event ID, type, timestamp, source and a version
  • Include the entity ID and the data consumers commonly need, or a reference to fetch it
  • Avoid leaking sensitive data consumers do not need
  • Version event schemas and keep changes backward compatible
  • Document each event's meaning and guarantees
Example event envelope
{
  "id": "evt_01J...",
  "type": "order.placed",
  "version": 2,
  "occurredAt": "2026-10-01T09:14:03Z",
  "source": "commerce-platform",
  "data": { "orderId": "1042", "total": "86.00", "currency": "GBP" }
}

Event Bus, Topics and Queues

Events are published to topics (or channels) on a broker or event service. Each consumer gets its own subscription, often backed by a queue, so a slow consumer does not affect others. Choose infrastructure by volume, ordering needs, retention and team familiarity: managed cloud queues and event services, message brokers or streaming platforms. Do not adopt heavy infrastructure before the volume justifies it.

Integrations breaking every time something changes?

ZSpace can design an event model and messaging setup that lets your commerce systems react reliably without tight coupling.

Start a Project

Webhooks as Event Sources

SaaS commerce platforms and payment providers publish events as webhooks. Receive them at a small endpoint that verifies the signature, stores or enqueues the event and responds quickly, then process asynchronously. Platforms retry failed deliveries (Shopify, for example, retries for several hours; Stripe for up to three days in live mode), so duplicates are normal. See ecommerce webhooks.

Eventual Consistency

Systems will briefly disagree. Inventory may lag a sale; search may show a price for seconds after it changed. Design for it: confirm stock and price at checkout, use safety stock for availability, show order status from the system of record, reconcile on a schedule and make delays visible in monitoring.

Ordering

Events can arrive out of order. If ordering matters for an entity (for example, stock adjustments for one SKU), partition by entity key so events for the same key are processed in sequence, or include versions or timestamps and ignore older updates. Do not assume global ordering.

Retries and Idempotency

Consumers fail: a downstream API times out, a database is busy. Retry with exponential backoff and jitter, and after a limit move the message to a dead-letter queue with an alert. Because retries and redeliveries happen, consumers must be idempotent: record processed event IDs, use idempotency keys for downstream calls and design updates so applying them twice has no extra effect. See queue architecture.

The Outbox Pattern

A common bug: the database update succeeds but publishing the event fails, or vice versa. The outbox pattern writes the event to an outbox table in the same transaction as the change, then a separate process publishes it. This keeps state and events consistent for services you control.

Monitoring

  • Event volume by type, compared with normal patterns
  • Consumer lag: how far behind each consumer is
  • Error and retry rates per consumer
  • Dead-letter queue size with alerts
  • End-to-end latency, such as order placed to warehouse received
  • Distributed tracing with correlation IDs

When Not to Go Event-Driven

Small stores with a handful of platform apps rarely need their own event infrastructure. Synchronous APIs remain right for requests needing an immediate answer, such as availability on a product page or payment authorization at checkout. Event-driven design adds operational responsibility; adopt it where many systems react to the same changes.

Worked Example

An illustrative scenario, not a client case: a retailer's checkout calls the ERP, email service and loyalty system synchronously, and when the loyalty system slows down, checkout times out. The team changes checkout to create the order and publish an order.placed event; separate consumers handle ERP posting, emails and loyalty with retries and dead-letter queues. A loyalty outage now delays points by minutes instead of blocking orders.

Implementation Steps

  • Identify the flows where coupling causes failures
  • Define a small set of well-documented events
  • Choose infrastructure that fits current volume
  • Build idempotent consumers with retries and dead-letter queues
  • Add tracing, lag metrics and alerts
  • Add reconciliation for critical flows

Common Mistakes

  • Non-idempotent consumers
  • Processing webhooks synchronously in the request
  • No dead-letter queue or alerts
  • Assuming events arrive in order
  • Events without versions or documentation
  • No reconciliation

Ready to make your commerce integrations event-driven?

Talk to ZSpace about event-driven commerce architecture, workflow and integration automation and Shopify webhook integrations.

Start a Project

Conclusion

Event-driven architecture decouples commerce systems so each can react to changes reliably. It works when events are well designed, consumers are idempotent, retries and dead-letter queues are in place, consistency gaps are expected and flows are monitored. Related: webhooks, queues, observability and scalability.

FAQ

Common questions

A way of connecting systems where significant changes (order placed, payment captured, stock adjusted, return received) are published as events, and other systems react to them asynchronously, instead of every system calling every other system directly.

Get in touch

Have a project in mind?

Whether you're building a new digital product, improving an existing website, or looking to automate part of your business — let's talk.