Capture a Payment
Capture a card payment after an authorization-only flow, when its payment status is AUTHORIZED. For eligible states and status meanings, see Payment Lifecycle.
Capture is a server-side Payments API operation. You can use it after a payment created through the widget or directly through the Payments API, provided the payment is eligible for capture.
Before you startβ
- Have the
paymentIdfor the authorized payment and a merchant-scoped access token. Use Get Payment to confirm its current status isAUTHORIZED. - Use the same merchant context for the capture request. See the Capture Payment API reference for headers, authorization, and the complete request schema.
- Capture before the authorization expires. The Payment Lifecycle reference describes the authorization window.
Capture the authorized amountβ
1. Choose full or partial captureβ
For a full capture, omit the request body or send an empty JSON object. For a partial or per-allocation capture, supply paymentAllocations[] with each allocation's id and amount in integer cents. The amount must be within the authorized amount; check the capture request schema before sending it.
The capture request schema uses paymentAllocations[].amount; it does not define a top-level amount field. Check the allocation IDs and authorized amounts returned for the payment before constructing a partial capture request.
2. Send the capture requestβ
Call PATCH /v2/payments/{paymentId}/capture from your backend. For a full capture, omit the body:
Full capture request
PATCH /v2/payments/{paymentId}/capture
Authorization: Bearer <merchant-token>
X-Merchant-Id: <merchant-id>
X-Upstream-Env: <environment>
For a partial capture, send the paymentAllocations structure defined in the Capture Payment operation.
3. Check the final statusβ
The API returns 202 Accepted while capture is being processed. Track the payment through Get Payment or payment webhooks. CAPTURE_INITIALIZED is an in-progress state; verify the final COMPLETED or FAILED status before treating the capture as finished.
If capture is rejected, check the status and error response against the Capture Payment API reference and Payment Error Codes. A payment that is no longer AUTHORIZED is not eligible for capture.
Related documentationβ
- Cancel a Payment β stop an eligible payment instead of capturing it
- Payment Lifecycle β status and capture eligibility
- Payments Overview β API flow and operation list