Free course · 20 lessons · Advanced
Payments & Money APIs
Build correct money systems: representing money, how card payments work, PSP integration models and PCI scope, SCA, payment state machines, idempotent charges, auth/capture, webhooks, sagas, subscriptions, marketplaces, double-entry ledgers, refunds and disputes, reconciliation, FX and fraud.
1. Money & Payments Fundamentals
Representing money, the payments ecosystem and integration models.
- Representing Money Correctly — Integer minor units or decimals, ISO 4217 currencies and rounding rules.
- How Card Payments Work — Merchant, PSP, acquirer, network, issuer; authorization, capture, clearing and settlement.
- PSP Integration Models & PCI Scope — Hosted checkout, embedded fields or direct API — and what each does to compliance.
- Payment Methods, Wallets & Strong Customer Authentication — Cards, wallets, bank debits, real-time payments and 3-D Secure.
2. Charging Safely
State machines, idempotency, auth/capture and amounts.
- Payments as State Machines — Explicit states and transitions for orders and payments.
- Idempotent Charges & Double-Charge Prevention — Idempotency keys end to end — client, your API and the PSP.
- Authorize, Capture, Void & Partial Captures — Separating authorization from capture for shipping, marketplaces and holds.
- Amounts, Taxes, Discounts & Price Integrity — The server computes the price; clients never send amounts you trust.
3. Webhooks, Orchestration & Recurring Payments
Event-driven payment processing, subscriptions and marketplaces.
- Payment Webhooks Done Right — Verify, dedupe, handle out-of-order events and re-fetch.
- Orchestrating Orders, Inventory & Payments — Outbox, sagas and timeouts across order, stock and payment services.
- Subscriptions, Invoicing & Dunning — Recurring billing, proration, failed payments and entitlements.
- Marketplaces, Split Payments & Payouts — Collecting for others: platforms, connected accounts and KYC.
4. Ledgers, Reconciliation & Risk
Double-entry accounting, refunds, disputes, reconciliation, FX, PCI and fraud.
- Double-Entry Ledgers for Engineers — Immutable journal entries where debits equal credits.
- Refunds, Disputes & Chargebacks — Full and partial refunds, dispute evidence and their accounting.
- Reconciliation — Matching your records, PSP reports and bank statements every day.
- Multi-Currency & FX — Presentment vs settlement currency, conversion and rounding.
- PCI DSS Scope, Tokenization & Payment Security — Keep card data out, secure what remains, and handle credentials safely.
- Fraud Prevention & Risk Management — Card testing, account takeover, friendly fraud and rules vs ML scoring.
5. Capstone
Design a payments platform for a marketplace and a subscription SaaS.
- Capstone: Food-Delivery Marketplace Payments — Design charging, payouts, ledger and reconciliation for a three-sided marketplace.
- Capstone: SaaS Subscription Billing — Plans, seats, usage, dunning and entitlements for a B2B SaaS.