SR-014 — Checkout Completion: Payment Capture & Fulfillment Handoff System Requirements
By Engineering Team•October 3, 2026•6 min read
| Metadata | Details |
|---|---|
| System Name | order-service + payment-service + shipment-service — Checkout Completion Saga |
| Document ID | SR-2026-OPF-001 |
| Author | Engineering Team |
| Status | Approved |
Traces back to BRD-013 — Checkout Completion: Real Payment Capture and Reliable Fulfillment Handoff.
Functional Requirements
Saga-Driven Fulfillment Sequencing
- FR-01 (Order Creation Schedules, Never Executes, the Saga): creating an order MUST schedule a
CheckoutSagaWorkflow(Temporal) that sequences inventory reservation, payment capture, and shipment creation; the order-creation request/response MUST NOT perform any of these three steps synchronously itself. - FR-02 (Dedicated Worker Executes the Saga): the scheduled workflow’s activities MUST be executed by a separate worker process polling the checkout-saga task queue, independent of the process serving the order-creation API.
Real payment-order creation, signature-verified webhook capture, captured-only saga relay, and idempotent webhook persistence are specified separately as SR-016’s FR-01 through FR-04 — this saga’s payment step (within FR-01 above) is the caller of that flow, not a re-specification of it.
Fulfillment Handoff
- FR-07 (Shipment Handoff Reuses Existing Fulfillment Orchestration): the saga’s shipment step MUST hand off to
shipment-service’s existing multi-step shipment-creation sequence and automatic courier-fallback behavior, per SR-011’s FR-03 and FR-04 — the saga MUST NOT re-implement that sequencing itself.
Progress Tracking & Visibility
- FR-08 (Saga Progress Isolated From the Order Record): the saga’s current step and step history MUST be tracked in a dedicated saga-state record, never written onto the order document itself.
- FR-09 (Real-Time Progress Stream): a customer-facing endpoint MUST stream an order’s saga progress to the client — both the progress already recorded at connect time and any further change as it happens — without requiring the client to poll.
Non-Functional Requirements
Deployment
- NFR-01 (Saga Execution Requires Its Own Running Worker): the checkout saga MUST only be considered “in progress” once its dedicated worker process is confirmed running — a scheduled-but-unexecuted saga (worker process not running) MUST be treated as an operational deployment gap, not a transient delay.
Multi-Tenancy & Security
- NFR-02 (Auth Metadata on Every Saga-Signal RPC): every saga-signal RPC a webhook relay sends back into the saga (
PaymentSignalService.SignalPaymentCaptured,ShipmentSignalService.SignalShipmentCreated) MUST carry tenant/user/role gRPC metadata like any other outbound RPC in this monorepo, per the platform’s security standards.
Composition & Reuse
- NFR-03 (DTO-Based Entry Points): every saga activity and signal-handling entry point MUST take a single input DTO rather than positional parameters, per the platform’s coding standards.
The payment provider’s own per-endpoint repository split (formerly NFR-04 here) and the payment flow’s fire-and-forget audit publishing (formerly NFR-05 here) are now specified as SR-016’s NFR-01 and NFR-02.
Related Documents
- SR-016 — Payment Capture & Confirmation System Requirements — the real payment-order creation, webhook capture, and Razorpay integration this saga’s payment step calls into
- BRD-013 — Checkout Completion: Real Payment Capture and Reliable Fulfillment Handoff
- SR-018 — Dependable, Auditable Multi-Step Order Transaction Coordination: System Requirements — the generic coordination capability (retry/timer/signal primitives, single-coordinator model, audit-record contract) this saga’s own step sequencing is built on
- ADR-00027 — Asynchronous Saga + Webhook Relay vs. Synchronous Payment Capture for Checkout Completion
- Architecture — Checkout Completion: Payment Capture and Fulfillment Handoff
- Technical Debt — Checkout Completion Payment Flow Gaps
- BRD-011 — Reusable Product-to-Order Journey With Trustworthy Totals
- SR-012 — Reusable Checkout Orchestration: System Requirements — order creation and the cached checkout session this saga is scheduled from (FR-11)
- SR-011 — Multi-Courier Fulfillment via Shiprocket: System Requirements — the shipment-creation orchestration and courier fallback this saga hands off to (FR-07)
- Architecture: Multi-Courier Fulfillment via Shiprocket —
order-service’s saga as the caller ofShipmentService.CreateShipment - Microservices: order-service, payment-service, shipment-service
- Flutter walkthrough: Checkout, Buy Now Checkout