Payment captures
The payment capture object and the allowed CRUD operations on the related resource endpoint
A payment capture collects funds that were previously reserved by a payment authorization. The transaction is processed asynchronously — on success, the payment session transitions to paid (full capture) or partially_paid (partial capture), and the capture balance on the authorization is decremented accordingly.
Fetching a payment capture returns all the information and messages provided by the payment setting. A capture can be partially or fully refunded after it succeeds.
Capture amount
The amount_cents is optional and defaults to the full remaining capture_balance_cents on the associated authorization. A single capture cannot exceed the authorization amount. Partial captures are supported — multiple captures can be made against the same authorization until the capture_balance_cents reaches zero.
Event-driven creation
Gateway webhook events can create a payment capture automatically if one does not already exist for the authorization. This means a transaction does not need to be explicitly created via the API first — Commerce Layer will create it in response to the event, ensuring the session status and order payment status are always kept in sync regardless of whether the flow was API-initiated or event-driven.
Incoming events are matched to an existing capture by the gateway's own reference for that operation. A reference already seen updates the capture it belongs to, while a reference not seen before creates a new one.
If a capture event arrives and the corresponding payment authorization is missing, behavior depends on the gateway:
Adyen — the missing authorization is synthesized from the event itself, reusing the
originalReferenceAdyen supplies, so the capture can still be created and the session kept in sync.Braintree — capture events do not cascade. A capture is only created if a
succeededpayment authorization already exists for the session. Otherwise, the event is silently dropped.Checkout.com — the missing authorization is synthesized, reusing the event's real payment ID — stable across the whole payment lifecycle — as an accurate token. The amount, though, is still approximated, reusing the capture's own amount instead of the full original authorization amount.
PayPal — the missing authorization is synthesized, but the
PAYMENT.CAPTURE.COMPLETEDevent carries no separate authorization reference, so it reuses the capture event's own resource ID and amount as an approximation.Stripe — the missing authorization is synthesized from the event itself, reusing the real charge ID and its actual authorized amount, so the capture can still be created and the session kept in sync.
External (custom gateways) — the webhook payload must explicitly include the
reference_transaction_tokenfor the authorization. If it's missing, the event is rejected with a422 Unprocessable Entityresponse.
Auto-capture
If the related payment setting has auto_capture enabled, a capture is created automatically upon a successful authorization, recorded as already succeeded and bypassing the payment gateway interaction. The auto flag in the response data indicates the capture was triggered automatically.
Refund balance
A capture tracks a refund_balance_cents attribute representing the amount still available to refund (capture amount minus already refunded amounts).
Last updated