Order API
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
| Property | Value |
|---|---|
| Bounded Context / Domain | OrderingDomainv1.0.0OrderingCreates durable Orders from a buyer's current basket, locks purchase-time pricing, and owns order lifecycle transitions ...Ownercommerce-fulfillment-teamDiagramOpen docs |
| Owner Team | Commerce Fulfillment TeamTeamCommerce Fulfillment TeamStream-Aligned team owning customer shopping baskets, checkout coordination, order lifecycle, and financial saga orchest...Open docs |
| Runtime Style | REST API, SSE Dashboard Stream, gRPC Client, and Async Kafka Producer/Consumer |
| Public / Gateway Exposure | Yes via API Gateway |
| Authentication & Authorization Policy | Microsoft 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 Pattern | 1-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.
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.
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.Receives messages (13)
Quickly find the message you need by searching for the name, type, or summary.- Order event stream: Domain events append to an event stream 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
to support chronological order history and time-travel summary views. - Lifecycle separation:
Completing or cancelling an Order is permitted only from
Newstatus; receiving Acknowledge basket deletion completedCommandv1.0.0Acknowledge basket deletion completedReports Finance's successful basket-cleanup outcome to Order API without changing the Order's business status. Ownercommerce-fulfillment-teamSchemaDiagramOpen docs never auto-completes an Order, and Handle basket deletion failedCommandv1.0.0Handle basket deletion failedReports Finance's failed basket-cleanup outcome so Order API can soft-delete the affected Order. Ownercommerce-fulfillment-teamSchemaDiagramOpen docs soft-deletes the Order without changing its business status.
Architecture Visualizations & Specifications
Order API Context
Loading graph...
Service Interactions
Owned Entities
Attached Resources & Related Docs
- API and contracts indexCustom DocAPI and contracts indexConsolidated index of BookWorm HTTP v1, gRPC, AG-UI, MCP, A2A, and Kafka/Wolverine contracts grouped by service with aut...Ownerplatform-engineering-teamOpen doc — Consolidated service, HTTP, gRPC, and Kafka directory.
- 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 — Downstream Finance durable workflow.
- 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 — PostgreSQL relational, event-store, and outbox storage.
- 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 — Redis locks, idempotency, and dashboard cache.
- Order LifecycleDiagramv1.0.0Order LifecycleBusiness status lifecycle of an accepted Order showing creation in the New state and irreversible transitions to Complet...Ownercommerce-fulfillment-teamOpen diagram — Order status transitions and saga separation.
- domains/bookworm/subdomains/ordering/engineering/01-order-consistency-and-data-ownership — Ordering consistency and ownership boundaries.