---
id: bookworm.{env}.ordering.user-checked-out
name: User Checkout Event Channel
version: 1.0.0
type: topic
summary: |
  Kafka topic owned by the commerce-fulfillment-team carrying Order API checkout
  events that initiate Finance post-checkout saga coordination.
owners:
  - commerce-fulfillment-team
badges:
  - content: Kafka
    backgroundColor: blue
    textColor: blue
  - content: Topic
    backgroundColor: teal
    textColor: teal
address: bookworm.{env}.ordering.user-checked-out
parameters:
  env:
    enum:
      - development
      - staging
      - production
    default: development
    examples:
      - development
      - staging
      - production
    description: BookWorm deployment environment.
deliveryGuarantee: at-least-once
protocols:
  - kafka
---

## Purpose & Scope

This topic transports checkout integration events published by [[service|order-api]] immediately after a new order is persisted. [[service|order-orchestration]] consumes these events to start the post-checkout saga, which coordinates basket cleanup and confirmation emails. The event confirms order persistence only—not basket deletion or email delivery.

:::note
In current payloads, the `basketId` field carries the buyer identifier rather than an independent Basket service record identifier.
:::

## Channel Specification

| Property                               | Value                                                                     |
| :------------------------------------- | :------------------------------------------------------------------------ |
| **Bounded Context / Owner**            | [[domain\|ordering]] / [[team\|commerce-fulfillment-team]]                |
| **Channel Type**                       | Topic                                                                     |
| **Address Pattern**                    | `bookworm.{env}.ordering.user-checked-out`                                |
| **Parameters**                         | `env` (`development`, `staging`, `production`; default: `development`)    |
| **Protocol & Envelope Format**         | Kafka + CloudEvents JSON (`application/json`)                             |
| **Partition Key & Ordering Guarantee** | Keyed by `orderId`; preserves per-order event ordering within a partition |
| **Delivery Semantics**                 | At-least-once                                                             |
| **Dead-Letter Channel**                | None (direct worker consumption by [[service\|order-orchestration]])      |

## Messages & Participants

| Message                                   | Type  | Producer               | Consumer(s)                      | Consumer Group               |
| :---------------------------------------- | :---- | :--------------------- | :------------------------------- | :--------------------------- |
| [[event\|UserCheckedOutIntegrationEvent]] | Event | [[service\|order-api]] | [[service\|order-orchestration]] | Finance orchestration worker |

## Ordering, Retries & Failure Handling

- **Partition-key ordering:** Keying by `orderId` ensures checkout initiation precedes subsequent status change events for the same order on that partition.
- **Transient retries:** [[service|order-orchestration]] applies bounded retry/backoff on transient orchestration host or state faults.
- **Poison & failure posture:** Direct worker consumption has no dedicated service DLQ; inspect Finance worker diagnostics and orchestration state before resetting offsets or replaying.
- **Consumer idempotency:** [[service|order-orchestration]] keys saga instances by `orderId` and ignores duplicate checkout events once an orchestration instance exists.

## Channel Details & Visualization

<ChannelInformation />

<NodeGraph />

## Related Documentation

- [[channel|bookworm.&#123;env&#125;.finance.place-order]] — Downstream command topic triggered by checkout
- [[channel|bookworm.&#123;env&#125;.ordering.order-status-change-to-complete]] — Order completion event topic
- [[channel|bookworm.&#123;env&#125;.ordering.order-status-change-to-cancel]] — Order cancellation event topic
- [[service|order-api]] — Checkout event producer
- [[service|order-orchestration]] — Finance saga consumer
- [[flow|user-checkout]] — End-to-end checkout workflow
- [[flow|order-lifecycle]] — End-to-end order lifecycle flow
- [[doc|arc42/08-crosscutting-concepts/002-contracts-and-messaging]] — Messaging standards and idempotency rules
