Design a merchant settlement and reconciliation system
Last updated: August 6, 2025
Quick Overview
Design a system that tracks BNPL purchases across merchants, calculates settlement amounts after fees and refunds, batches payouts, and provides reconciliation reports for financial auditing.
Affirm
August 6, 20257
3
4,755 solved
Design a system that tracks BNPL purchases across merchants, calculates settlement amounts after fees and refunds, batches payouts, and provides reconciliation reports for financial auditing.
Merchant settlement is a critical financial operation at Affirm. This question appears in onsite system design rounds to assess your ability to design systems where financial accuracy is paramount and eventual consistency must be carefully managed.
What the Interviewer Expects
- Design a ledger system that tracks every financial movement with double-entry bookkeeping
- Handle the timing difference between consumer payment collection and merchant settlement
- Support configurable settlement schedules (daily, weekly) per merchant
- Design reconciliation jobs that detect and flag discrepancies
- Address partial refunds and how they affect settlement calculations
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How would you handle a scenario where a consumer disputes a charge after the merchant has been settled?
- How do you ensure idempotency in the settlement batch job?
- What happens if the bank transfer for settlement fails?
- How would you support real-time settlement for high-priority merchants?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Core Data Model
The settlement system is built on a ledger that uses double-entry bookkeeping. Every financial event creates two entries: a debit and a credit. When ...
Settlement Calculation Pipeline
The settlement batch job runs on a configurable schedule per merchant (most are daily). Step 1: Query all transactions for the merchant in the settle...