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.

Start the course

1. Money & Payments Fundamentals

Representing money, the payments ecosystem and integration models.

  1. Representing Money Correctly — Integer minor units or decimals, ISO 4217 currencies and rounding rules.
  2. How Card Payments Work — Merchant, PSP, acquirer, network, issuer; authorization, capture, clearing and settlement.
  3. PSP Integration Models & PCI Scope — Hosted checkout, embedded fields or direct API — and what each does to compliance.
  4. 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.

  1. Payments as State Machines — Explicit states and transitions for orders and payments.
  2. Idempotent Charges & Double-Charge Prevention — Idempotency keys end to end — client, your API and the PSP.
  3. Authorize, Capture, Void & Partial Captures — Separating authorization from capture for shipping, marketplaces and holds.
  4. 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.

  1. Payment Webhooks Done Right — Verify, dedupe, handle out-of-order events and re-fetch.
  2. Orchestrating Orders, Inventory & Payments — Outbox, sagas and timeouts across order, stock and payment services.
  3. Subscriptions, Invoicing & Dunning — Recurring billing, proration, failed payments and entitlements.
  4. 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.

  1. Double-Entry Ledgers for Engineers — Immutable journal entries where debits equal credits.
  2. Refunds, Disputes & Chargebacks — Full and partial refunds, dispute evidence and their accounting.
  3. Reconciliation — Matching your records, PSP reports and bank statements every day.
  4. Multi-Currency & FX — Presentment vs settlement currency, conversion and rounding.
  5. PCI DSS Scope, Tokenization & Payment Security — Keep card data out, secure what remains, and handle credentials safely.
  6. 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.

  1. Capstone: Food-Delivery Marketplace Payments — Design charging, payouts, ledger and reconciliation for a three-sided marketplace.
  2. Capstone: SaaS Subscription Billing — Plans, seats, usage, dunning and entitlements for a B2B SaaS.