Architecture Pattern Guide

Commerce Enterprise Integration Scenario

Goal

Apply the chapter's boundary, contract, change-control, security, and operating models to one end-to-end commerce order.

The durable idea is:

A strong integration walkthrough connects every path to a business outcome, contract, failure response, and owner.

Scenario

A retailer has grown into a marketplace. Its customer-facing commerce platform must cooperate with:

  • Tax, fraud, and payment providers during checkout.

  • An ERP system for enterprise order and financial records.

  • Regional warehouses for fulfillment.

  • Carriers for shipment booking and tracking.

  • A customer support platform for case handling.

  • Supplier and marketplace partners that still exchange scheduled files.

Today, several point-to-point integrations make checkout fragile. Partner changes break consumers unexpectedly. Operations can see failed requests but cannot always connect them to affected orders. Replaying failed work is risky, and finance does not fully trust that exported records are complete.

The goal is not to create one central system that owns everything. It is to create controlled crossings between systems that retain their own responsibilities.

Step 1: Name Owners and Contracts

Before drawing technology, map the business relationships.

PathMeaningOwner of MeaningTiming
Checkout to taxRequest a tax calculation for this basket and address.Checkout owns the request; tax capability owns the calculation result.Immediate, with a bounded timeout.
Checkout to fraudRequest an initial risk decision.Fraud domain owns decision semantics.Immediate or referred for later review.
Commerce to ERPRecord an accepted order for enterprise processing.Commerce owns order acceptance; ERP owns enterprise posting.Durable and eventual.
Fulfillment to warehouseRelease an accepted order for physical work.Fulfillment owns the release contract; warehouse owns execution.Durable and deadline-bound.
Warehouse to carrierBook a ready parcel.Warehouse owns parcel readiness; carrier owns delivery movement.Rate-limited partner interaction.
Carrier to commerceAnnounce tracking facts.Carrier states transport facts; commerce owns customer-visible interpretation.Eventual and possibly duplicated.
Commerce to supportProvide a safe order and shipment timeline.Source domains own facts; support owns case workflow.Near-real-time read model.
Supplier to inventoryExchange a scheduled availability set.Supplier owns supplied availability; inventory owns its internal promise model.Batch with reconciliation.

This table prevents the integration layer from becoming the accidental owner of every business concept.

Step 2: Place the Communication Patterns

Now choose a mechanism for each relationship:

flowchart TB
    A[Storefront and Checkout]
    B[Tax, Fraud, and Payment Providers]
    C[Order Domain]
    D[ERP]
    E[Fulfillment Workflow]
    F[Warehouse]
    G[Carrier]
    H[Support View]
    I[Finance and Reconciliation]
    J[Supplier File Boundary]

    A -->|"bounded APIs"| B
    A -->|"accept order"| C
    C -->|"durable order posting"| D
    C -->|"release command"| E
    E -->|"durable command"| F
    F -->|"rate-controlled booking"| G
    G -->|"tracking events"| C
    C -->|"customer-safe events"| H
    D -->|"controlled records"| I
    C -->|"order and refund facts"| I
    J -->|"validated availability records"| F

The diagram deliberately mixes APIs, commands, events, workflows, and files. One mechanism would not fit all of these business relationships.

Step 3: Walk the Happy Path

Checkout

The customer submits checkout. The commerce platform calls protected tax, fraud, and payment interfaces because those decisions affect whether the order can be accepted. Each call has a timeout and a defined response to uncertainty. A transport timeout does not automatically mean the partner performed nothing, so any retry uses a stable operation identity where the provider contract supports it.

Once the platform has enough evidence to accept the order, the order domain records that acceptance before acknowledging success to the customer. Downstream ERP, fulfillment, support, and reporting work does not all remain in the customer response path.

Enterprise Posting and Fulfillment

The order domain hands an enterprise posting to the ERP through durable work. ERP unavailability creates a visible backlog rather than rejecting new customer orders, as long as business policy allows delayed posting.

In parallel, the order domain issues a fulfillment release command. A workflow records the progress of warehouse acceptance, allocation, packing, and carrier booking. The warehouse remains owner of physical work; the workflow coordinates deadlines and exceptions rather than rewriting warehouse state.

Shipping and Customer Visibility

When a parcel is ready, carrier booking is paced according to the partner's limits. The carrier reference is retained with the booking outcome. Later tracking updates may arrive more than once or out of order, so the receiving contract identifies the event and protects valid state progression.

Commerce translates carrier facts into the customer order timeline. Support consumes a safe read model rather than querying every operational system during a customer call. Finance receives the order, payment, refund, tax, and settlement information it needs through controlled, reconcilable paths.

Step 4: Interrupt the Normal Path

A useful walkthrough must show what happens when reality refuses to cooperate.

At 2:00 p.m., the carrier introduces a new tracking status and starts rate-limiting bookings. Some shipment events fail contract validation. Booking retries cause the queue to grow.

The boundary responds in layers:

  1. It quarantines the unknown status rather than letting it corrupt the customer timeline.

  2. It reduces booking concurrency and uses delayed retries with jitter.

  3. It reports oldest-booking age and orders at risk of missing dispatch, not just request errors.

  4. The partner owner confirms whether the new status is compatible or requires a contract update.

  5. The commerce team decides how affected customers should be informed.

  6. Once the translator is updated and tested, an authorized operator previews and replays only the quarantined events for that partner and version.

  7. A reconciliation compares shipment bookings, carrier references, tracking facts, and commerce shipment state.

Meanwhile, the ERP is also unavailable. Its order-posting backlog is isolated from carrier work and warehouse release. When ERP returns, the consumer resumes at a controlled rate and uses stable posting identities to avoid duplicate enterprise records.

This is the benefit of explicit boundaries: two partner failures do not become one untraceable platform failure.

Step 5: Make Control and Ownership Visible

The solution needs more than message movement.

ConcernDesign Response
SecuritySeparate workload and partner identities; authorize by contract and operation; minimize customer and payment data in payloads.
Contract changeNamed owners, compatibility rules, contract tests, supported-version windows, and deprecation monitoring.
OverloadPartner-specific concurrency, quotas, bounded buffering, retry budgets, and backlog-age alerts.
Duplicate deliveryStable operation identities, idempotent consumers, and state-transition checks.
TraceabilityCorrelation across request, order, workflow, partner reference, and business outcome.
AuditProtected evidence for sensitive decisions, manual releases, corrections, and replays.
RecoveryScoped replay, approval where required, gradual drain, and reconciliation after restoration.
SupportDomain-specific dashboards and runbooks with named service, domain, and partner owners.

Architecture Decisions and Trade-Offs

Several choices in this design are deliberate trade-offs.

Keeping ERP posting out of checkout improves customer-path resilience but creates eventual consistency and a backlog that must be monitored. Buffering carrier bookings absorbs short outages but cannot protect the shipping promise forever. A support read model reduces runtime coupling but may be briefly stale. Retaining raw partner exchanges can help correction and audit, but increases sensitive-data and retention obligations.

The right answer depends on business deadlines and risk. The architecture should state those trade-offs rather than presenting asynchronous communication or central integration as automatically superior.

A Concise Scenario Answer

If someone asks you to design this system, structure the answer like this:

  1. Map the business outcomes and system owners.

  2. Define each crossing as an API, command, event, workflow, or file contract.

  3. Keep immediate checkout decisions bounded; hand suitable downstream work off durably.

  4. Add partner controls for identity, validation, versioning, throttling, quarantine, and replay.

  5. Add technical and business telemetry, audit evidence, runbooks, and explicit support ownership.

  6. Prove recovery with idempotency and reconciliation, not only with retries.

That answer explains why the design works when systems change and fail, not only how they connect on a diagram.

Common Mistakes

  • Listing integration technologies without naming the contracts and owners.

  • Making checkout wait for ERP, warehouse, carrier, support, and finance completion.

  • Treating every partner error as retryable.

  • Replaying failed orders without checking business state and duplicate effects.

  • Giving support a technical error dashboard but no customer-impact view.

  • Ending an incident when traffic recovers instead of reconciling business records.

If Someone Asks You

What should a commerce integration scenario teach beyond message passing?

A good answer is:

It should show which system owns each outcome, why each boundary uses an API, command, event, workflow, or file, how contract change and overload are contained, and how teams secure, observe, recover, and reconcile the flow. Good integration shows controlled business collaboration, not just connectivity.

What You Should Remember

Good integration shows control, not just connectivity.

Questions to Check Your Understanding

  1. Which checkout dependencies truly need an immediate response?

  2. Why should carrier recovery and ERP recovery be isolated from each other?

  3. What evidence proves that replay restored business state without duplicating effects?

Further Study

  • AsyncAPI documentation - Explore provider-neutral contract documentation for the commands and events in the scenario.

  • OpenTelemetry concepts - Review context propagation and telemetry concepts for tracing work across integration boundaries.