|
1 | 1 | --- |
2 | 2 | title: "Capture an Authorization" |
3 | | -keywords: ["Commerce Payments capture", "capture escrowed USDC", "PaymentCaptured", "deferred settlement Base"] |
4 | | -description: "Capture authorized funds from escrow before the authorization expires." |
| 3 | +keywords: ["Commerce Payments capture", "capture escrowed USDC", "PaymentCaptured", "deferred settlement Base", "Commerce Payments partial capture", "split shipment payment", "variable USDC capture", "capturableAmount"] |
| 4 | +description: "Capture all or part of an escrowed authorization, in one capture or across multiple fulfillment increments, before the authorization expires." |
5 | 5 | --- |
6 | 6 |
|
7 | 7 | import { PaymentsDemo } from "/snippets/PaymentsDemo.jsx" |
8 | 8 |
|
9 | | -Capture an authorization when the order is ready to settle. The operator transfers all or part of the escrowed amount to the receiver and fee receiver without collecting from the payer again. |
| 9 | +Capture an authorization when the order is ready to settle. The operator transfers all or part of the escrowed amount to the receiver and fee receiver without collecting from the payer again. Capture the full amount at once, capture less when the final total changes after checkout, or capture multiple increments as an order ships. |
10 | 10 |
|
11 | 11 | <Info> |
12 | 12 | This guide's payment flow is based on the [Commerce Payments Protocol](https://github.com/base/commerce-payments). |
@@ -59,15 +59,33 @@ Capture decreases `capturableAmount` and increases `refundableAmount` by the sam |
59 | 59 | Verify `PaymentCaptured(paymentInfoHash, amount, feeAmount, feeReceiver)` and the expected receiver transfers before marking the fulfillment increment settled. |
60 | 60 | </Check> |
61 | 61 |
|
| 62 | +## Capture a Partial Amount |
| 63 | + |
| 64 | +<PaymentsDemo flow="partial" /> |
| 65 | + |
| 66 | +Pass a smaller `amount` to the same `capture` call for every increment. The sum of successful captures cannot exceed `PaymentAuthorized.amount`, and each capture independently validates its fee bounds. The remaining reservation is tracked onchain without a custom checkout contract. |
| 67 | + |
| 68 | +For a 100 USDC authorization, a 64 USDC capture leaves 36 USDC capturable and makes 64 USDC refundable. You can capture another increment or [void the remainder](/build-on-base/accept-payments/void-an-authorization). |
| 69 | + |
| 70 | +<Check> |
| 71 | +After every capture, reconcile `PaymentCaptured.amount` with the new `capturableAmount` and `refundableAmount` before another worker advances the order. |
| 72 | +</Check> |
| 73 | + |
| 74 | +<Warning> |
| 75 | +Fee bounds are evaluated per capture and use integer division. With low-decimal tokens, fragmenting one settlement into many small captures can reduce the aggregate minimum fee. Enforce a minimum capture size offchain when that matters. |
| 76 | +</Warning> |
| 77 | + |
| 78 | +## Capture Deadline |
| 79 | + |
62 | 80 | <Warning> |
63 | 81 | At `authorizationExpiry`, capture is no longer available and the payer can reclaim the remaining balance. Use chain time rather than an application server clock when enforcing the deadline. |
64 | 82 | </Warning> |
65 | 83 |
|
66 | 84 | ## See Also |
67 | 85 |
|
68 | 86 | <CardGroup cols={2}> |
69 | | - <Card title="Capture a Partial Amount" icon="receipt" href="/build-on-base/accept-payments/capture-a-partial-amount"> |
70 | | - Settle split shipments or a reduced final total. |
| 87 | + <Card title="Void an Authorization" icon="ban" href="/build-on-base/accept-payments/void-an-authorization"> |
| 88 | + Return the unneeded remainder to the payer. |
71 | 89 | </Card> |
72 | 90 | <Card title="Refund a Payment" icon="rotate-left" href="/build-on-base/accept-payments/refund-a-payment"> |
73 | 91 | Return previously captured value to the payer. |
|
0 commit comments