Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Authenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting prices, and coordinating status events.

Service Responsibility & Boundary

Order API is the system of record within the OrderingDomainv1.0.0OrderingCreates durable Orders from a buyer's current basket, locks purchase-time pricing, and owns order lifecycle transitions ...Ownercommerce-fulfillment-teamDiagramOpen docs domain for BuyerEntityv1.0.0BuyerRepresents a customer's ordering profile and delivery address within the Ordering bounded context.Ownercommerce-fulfillment-teamOpen docs profiles, accepted OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs aggregates, purchase-time Order ItemEntityv1.0.0Order ItemChild entity within an Order capturing a purchased book identifier, positive quantity, and locked checkout-time unit pri...Ownercommerce-fulfillment-teamOpen docs price snapshots, and Order lifecycle statuses (New, Completed, Cancelled). It serves versioned HTTP endpoints and Server-Sent Events (SSE) backoffice dashboards, queries Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs and Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs over gRPC during checkout, and delegates post-checkout basket cleanup and email coordination to Order OrchestrationServicev1.0.0Order OrchestrationMessage-driven Finance workflow service that coordinates post-checkout basket cleanup and order notifications using Dura...PublishesPlaceOrderCommand, DeleteBasketCompleteCommand +3SubscribesUserCheckedOutIntegrationEvent, OrderStatusChangedToCompleteIntegrationEvent +3APIsAsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs over Kafka.

Service Profile

PropertyValue
Bounded Context / DomainOrderingDomainv1.0.0OrderingCreates durable Orders from a buyer's current basket, locks purchase-time pricing, and owns order lifecycle transitions ...Ownercommerce-fulfillment-teamDiagramOpen docs
Owner TeamCommerce Fulfillment TeamTeamCommerce Fulfillment TeamStream-Aligned team owning customer shopping baskets, checkout coordination, order lifecycle, and financial saga orchest...Open docs
Runtime StyleREST API, SSE Dashboard Stream, gRPC Client, and Async Kafka Producer/Consumer
Public / Gateway ExposureYes via API Gateway
Authentication & Authorization PolicyMicrosoft Entra ID JWT via Identity ProviderSystemv1.0.0Identity ProviderExternal identity infrastructure that authenticates BookWorm users and provides OAuth-compatible identity verification f...Ownerplatform-engineering-teamDiagramOpen docs; customer or admin roles with ordering scopes; backoffice dashboard also requires admin and catalog read scope
Owned Data Store(s)Order DatabaseContainerv1.0.0Order DatabaseAuthoritative PostgreSQL system of record owned by the Ordering bounded context for buyers, accepted orders, purchase-ti...Ownercommerce-fulfillment-teamDiagramOpen docs (relational, event-sourced history, and transactional outbox), Order Cache and Distributed LocksContainerv1.0.0Order Cache and Distributed LocksRedis-backed coordination and caching slice owned by the Ordering bounded context for buyer-scoped creation locks, HTTP ...Ownercommerce-fulfillment-teamDiagramOpen docs (distributed locks, idempotency markers, and dashboard cache)
Key Resilience / Idempotency Pattern1-hour x-request-id idempotency markers, buyer-scoped distributed write locks, per-user rate limiting, and dead-letter routing on Ordering Dead Letter QueueChannelv1.0.0Ordering Dead Letter QueueKafka dead-letter topic owned by the platform-engineering-team that captures basket-cleanup outcome commands that Order ...Ownerplatform-engineering-teamOpen docs

Contracts & Data Ownership

Order API owns BuyerEntityv1.0.0BuyerRepresents a customer's ordering profile and delivery address within the Ordering bounded context.Ownercommerce-fulfillment-teamOpen docs, OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs, and Order ItemEntityv1.0.0Order ItemChild entity within an Order capturing a purchased book identifier, positive quantity, and locked checkout-time unit pri...Ownercommerce-fulfillment-teamOpen docs in Order DatabaseContainerv1.0.0Order DatabaseAuthoritative PostgreSQL system of record owned by the Ordering bounded context for buyers, accepted orders, purchase-ti...Ownercommerce-fulfillment-teamDiagramOpen docs and uses Order Cache and Distributed LocksContainerv1.0.0Order Cache and Distributed LocksRedis-backed coordination and caching slice owned by the Ordering bounded context for buyer-scoped creation locks, HTTP ...Ownercommerce-fulfillment-teamDiagramOpen docs for checkout concurrency locks, idempotency markers, and short-lived dashboard caching.

Note

Every new Order starts in New status with line totals locked to active Catalog prices (sale price when set, otherwise regular price). Later Catalog price edits never rewrite accepted Orders, and soft-deletion on failed basket cleanup preserves audit records without altering business status.

Warning

State-changing Order operations require an x-request-id idempotency header. Duplicate keys within the 1-hour idempotency window return 409 Conflict—callers should inspect existing Order status before generating a new idempotency key.

Sends messages (7)

Quickly find the message you need by searching for the name, type, or summary.
NameVersionTypeSummaryChannels
Get basket over gRPC
v1.0.0queryReturns the current basket through the basket.v1 gRPC contract.
-
Get book over gRPC
v1.0.0queryReturns one Catalog book by identifier through the book.v1 gRPC contract.
-
Get books over gRPC
v1.0.0queryReturns multiple Catalog books by identifier through the book.v1 gRPC contract.
-
Get catalog dashboard over gRPC
v1.0.0queryReturns Catalog totals and category counts through the admin-protected book.v1 gRPC contract.
-
User checked out
v1.0.0eventReports that an Order was placed and its checkout details are ready for Finance coordination.
-
Order completed
v1.0.0eventReports that an Order transitioned from New to Completed.
-
Order cancelled
v1.0.0eventReports that an Order transitioned from New to Cancelled.
-

Receives messages (13)

Quickly find the message you need by searching for the name, type, or summary.
NameVersionTypeSummaryChannels
Create order
v1.0.0commandCreates an Order for the authenticated Buyer using the current basket and Catalog pricing.
-
Complete order
v1.0.0commandMarks an existing Order as Completed when its current status is New.
-
Cancel order
v1.0.0commandMarks an existing Order as Cancelled when its current status is New.
-
Delete order
v1.0.0commandSoft-deletes an Order by its identifier without changing its business status.
-
Create buyer
v1.0.0commandCreates a Buyer profile for the authenticated customer from the supplied address.
-
Update buyer address
v1.0.0commandUpdates the authenticated Buyer's address using the supplied street, city, and province.
-
Delete buyer
v1.0.0commandDeletes a Buyer profile by identifier; the operation is restricted to administrators.
-
Get order
v1.0.0queryReturns Order details, including the recorded item quantities and prices.
-
List orders
v1.0.0queryReturns Orders with pagination and optional status and Buyer filters.
-
Get buyer
v1.0.0queryReturns the Buyer profile selected by identifier, subject to the caller's authorization.
-
List buyers
v1.0.0queryReturns Buyer profiles with pagination.
-
Acknowledge basket deletion completed
v1.0.0commandReports Finance's successful basket-cleanup outcome to Order API without changing the Order's business status.
-
Handle basket deletion failed
v1.0.0commandReports Finance's failed basket-cleanup outcome so Order API can soft-delete the affected Order.
-

Architecture Visualizations & Specifications

Order API Context

Loading graph...

Service Interactions

Owned Entities