Sub topic 3
Authorization, capture, and settlement
This chapter assumes you know the five actors in a card payment (merchant, PSP, acquirer, card network, issuer) and basic HTTP and database concepts. Here you will see the three steps that move a payment from "customer clicked pay" to "merchant has the money".
Three steps, three different effects
- Authorization asks the issuer whether the card can pay the amount. If the issuer approves, it places a hold on the cardholder's available credit or balance and returns an authorization code. No money moves yet.
- Capture is the merchant's request to collect the authorized amount. The captured transaction joins a batch that goes to the acquirer.
- Settlement is the actual transfer of funds. Money flows from the issuer through the card network to the acquirer, then to the merchant, minus fees. It usually happens one to several days after capture.
One step or two
Merchants choose between two flows.
| Flow | When it fits | Trade-off |
|---|---|---|
| Sale (authorize and capture together) | Digital goods, instant delivery | Simple, but refunds are the only way to undo it |
| Authorize, then capture later | Shipping goods, hotels, rentals | Needs hold expiry handling and a void path |
A void cancels an authorization before capture and releases the hold. After capture, you must refund instead.
What this means for your design
- Store both amounts. Keep
authorized_amountandcaptured_amountseparately. A capture may be partial (for example, one item in an order ships). Reject any capture above the authorized amount. - Track hold expiry. Authorizations expire, often within about a week, and the exact window depends on network and merchant category. Store
authorization_expires_atand treat a capture after expiry as a failure that needs a new authorization. - Model the steps as states.
authorizedandcapturedare different states with different allowed moves, which the state machine chapter formalizes. - Treat settlement as asynchronous. Your system learns that funds arrived from PSP or bank reports, not from a synchronous API reply. Comparing those reports to your records is reconciliation.
- Keep the ledger honest. An authorization is a promise, not money, so do not book it as received funds. Record money movement when the PSP confirms capture or settlement, as your ledger design requires.
Common errors
- Treating an approved authorization as a completed sale and showing the order as paid in reports.
- Forgetting to void unused authorizations, which leaves holds on customers' cards and causes support complaints.
- Capturing without an idempotency key, so a retry after a timeout captures twice.
- Assuming the settled amount equals the captured amount. Fees, currency conversion, and chargebacks make them differ.
Exercise
A merchant authorizes 80.00 USD, then ships one item and captures 30.00 USD. What happens to the remaining 50.00 USD hold, and what should your system store?
Show answer
The remaining hold is released when the authorization is voided or expires, depending on the PSP and issuer. Your system should store authorizedamount = 8000 and capturedamount = 3000 (minor units) and the authorization expiry time. It should reject any later capture that would push the captured total above 8000 or that arrives after expiry.