Design Idempotent Payment Capture for Split Shipment Orders

Last updated: November 29, 2026

Quick Overview

Design the service that authorizes a customer's payment at checkout and captures the right amount when each shipment of a multi-item order ships, guaranteeing customers are never double charged.

Amazon
System Design
Software Engineer
Amazon
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design the service that authorizes a customer's payment at checkout and captures the right amount when each shipment of a multi-item order ships, guaranteeing customers are never double charged.

Amazon charges when items ship, not when the order is placed, and orders often split into several shipments. Interviewers use this to test idempotency, state machines, and reconciliation with external payment processors where requests can time out with unknown outcomes.

What the Interviewer Expects
  • An explicit payment state machine per order and per shipment
  • Idempotency keys for every external call
  • Handling processor timeouts with unknown results
  • Authorization expiry and re-authorization
  • Reconciliation and audit trail
Key Topics to Cover
Idempotency
State machines
Exactly-once effects
Outbox pattern
Reconciliation
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • What happens if an authorization expires before the last shipment?
  • How do you refund a partial return?
  • How do you handle a processor that is down during peak?
  • How would you support split tender (gift card plus credit card)?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: authorize the order total at checkout; when each shipment ships, capture that shipment's amount; void remaining authorization if items are canceled; support refunds. **Non-functional:*...

High-Level Design
  • Payment Service owns Payment (per order) and Capture (per shipment) records in a strongly consistent store, with explicit states: AUTHORIZED, CAPTURE_PENDING, CAPTURED, FAILED, `VOID...

Submit Your Answer
Markdown supported