Send order cancelled notification
Shared Finance cancellation command consumed by Notification to render and submit a canceled-order email.
CancelOrderCommand is an asynchronous Kafka integration command published by 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 and consumed by Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders
MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs to render and submit a cancelled-order customer email. It never mutates order state in Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle,
creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs.
Overview
| Property | Value |
|---|---|
| Bounded Context | Platform / Notifications |
| Producer | 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 |
| Consumer(s) | Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs |
| Protocol / Format | Kafka + CloudEvents JSON (camelCase payload) |
| Channel / Topic | Order Cancellation Command ChannelChannelv1.0.0Order Cancellation Command ChannelKafka topic owned by the contributor team carrying Finance order-cancellation commands consumed by Notification API to s...Ownercommerce-fulfillment-teamOpen docs |
| Dead-Letter Channel | Notification Dead Letter QueueChannelv1.0.0Notification Dead Letter QueueKafka dead-letter topic owned by the platform team that captures order notification commands that Notification API could...Ownerplatform-engineering-teamOpen docs |
| Partition Key | OrderId |
| Delivery / Idempotency Guarantee | At-least-once delivery; consumed with Redis-backed 24-hour idempotency keyed by id |
CancelOrderCommand requests a customer email only. To change an order’s authoritative status to Cancelled, call Cancel orderCommandv1.0.0Cancel orderMarks an existing Order as Cancelled when its current status is New.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs.
Payload Fields & Envelope
Command Payload
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | Yes | UUIDv7 | Unique message identifier used for 24-hour Redis deduplication |
creationDate | string (date-time) | Yes | ISO 8601 UTC timestamp | UTC timestamp when the command was created |
orderId | string (uuid) | Yes | Valid UUID; Kafka partition key | Identifier of the cancelled order |
fullName | string | null | No | Nullable (defaults to "Customer" when null) | Customer display name |
email | string | null | No | Nullable | Recipient email address; null, empty, or whitespace values skip email rendering and delivery |
totalMoney | number | Yes | Non-negative monetary amount | Order total displayed in the cancellation email template |
Delivery Guarantees & Error Handling
| Condition | System Behavior | Recovery / Compensation |
|---|---|---|
| Duplicate delivery within 24 hours | Consumer skips reprocessing via Redis-backed 24-hour idempotency keyed by id | Safe at-least-once delivery; newly published commands with a different id execute again |
Blank or null email | Consumer returns without error and skips template rendering and SMTP submission | No action required |
| Transient SMTP or network failure | Retried by the notification resilience pipeline (circuit breaker, exponential backoff with jitter, 30s timeout) | Exhausted retries route to Notification Dead Letter QueueChannelv1.0.0Notification Dead Letter QueueKafka dead-letter topic owned by the platform team that captures order notification commands that Notification API could...Ownerplatform-engineering-teamOpen docs |
| Permanent SMTP failure | Retried with cooldown (50ms, 250ms, 1s with full jitter) | Routed to Notification Dead Letter QueueChannelv1.0.0Notification Dead Letter QueueKafka dead-letter topic owned by the platform team that captures order notification commands that Notification API could...Ownerplatform-engineering-teamOpen docs |
Related Documentation
- Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs — Stateless email worker architecture and SMTP configuration.
- 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 — Producing orchestration service.
- Order Cancellation Command ChannelChannelv1.0.0Order Cancellation Command ChannelKafka topic owned by the contributor team carrying Finance order-cancellation commands consumed by Notification API to s...Ownercommerce-fulfillment-teamOpen docs — Kafka channel specification.
- Notification Dead Letter QueueChannelv1.0.0Notification Dead Letter QueueKafka dead-letter topic owned by the platform team that captures order notification commands that Notification API could...Ownerplatform-engineering-teamOpen docs — Dead-letter queue for failed Notification consumers.
- Order cancelledEventv1.0.0Order cancelledReports that an Order transitioned from New to Cancelled. Ownercommerce-fulfillment-teamSchemaDiagramOpen docs — Upstream Ordering event that triggers cancellation notification.
- Cancel orderCommandv1.0.0Cancel orderMarks an existing Order as Cancelled when its current status is New.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs — Ordering API HTTP command that cancels an order.
Send order cancelled notification schema
not allowed