# Capture Payments

In this guide, you will find step-by-step instructions on manually capturing a previously created payment on WHITELABEL.

<Note>
**Automatic Delayed Capture**

If you prefer to have WHITELABEL automatically capture payments after a specified delay, you can configure `delayed_capture_settings` when creating the payment. Learn more in the [Cancel and Capture Flow](/docs/payment-features/Cancel-and-capture-flow) guide.
</Note>

<Warning>
**Which payments can you capture**

Only payments with **PENDING** status can be captured. Check the [Payment status](/docs/basic-concepts/payments-1) page for further details regarding the possible payment status.

If the payment is already **SUCCEEDED**, it is already captured and there is nothing left to capture. This is the case for purchases (`capture: true`) and for authorizations (`capture: false`) sent to a provider that only supports immediate capture. In that second case WHITELABEL creates the capture transaction for you and returns the payment as `SUCCEEDED` with `sub_status = CAPTURED`, so you can skip the capture call.
</Warning>

## Requirements

To capture a payment, you need to:

* Access your [API credentials](/docs/developers-credentials) on the WHITELABEL Dashboard, which consist of:
  * `public-api-key`
  * `private-secret-key`
* Have the payment identification data received after creating the payment using the [Create Payment endpoint](/reference/payments/create-payment):
  * `id`: The unique identifier of the payment, obtained from the parameter `id` after creating the payment.
  * `transaction_id`: The unique identifier of the transaction obtained from the parameter `transaction.id` after creating the payment.

<Note>
**Explore WHITELABEL Postman Collections**

WHITELABEL provides [Postman Collections](/reference/postman-collections) that you can use to replicate the use cases locally.
</Note>

<Info>
**Capture Options**

This guide covers **manual capture** using the API endpoint. For other capture options including:

* **Real-time capture** (immediate purchase)
* **Delayed capture** (automatic capture after a delay)

See the [Cancel and Capture Flow](/docs/payment-features/Cancel-and-capture-flow) guide.
</Info>

## Capture a payment

You can capture a payment only if it has the PENDING status. Use the [Capture Payment endpoint](/reference/payments/capture-authorization) to capture the payment. To identify the payment to be captured, you need to provide its `id` and the `transaction_id`. In addition, you need to inform the amount to be captured using the object `amount` on the body request:

* Complete capture: Leave the amount empty.
* Partial capture: Provide the value to be captured using the parameter `amount`.

To confirm you have successfully captured the payment, check if the parameters from the [Capture Payment](/reference/payments/capture-authorization) endpoint response contain the following values:

* `type = CAPTURE`
* `status = SUCCEEDED`
* `payment.status = SUCCEEDED`
* `payment.sub_status = CAPTURED/PARTIALLY_CAPTURED`

If the response contains the above values, the capture was successful.

### Payment already in a final state

If you call the capture endpoint on a payment that is no longer `PENDING` (for example, it was already captured, refunded, or canceled), the endpoint returns HTTP 400 with the code `INVALID_STATUS`:

```json
{
  "code": "INVALID_STATUS",
  "messages": ["Invalid transaction status."]
}
```

Map this code as "no further operations apply to this payment" and do not retry the capture. To know the current state of the payment, use the [Retrieve payment](/reference/payments/retrieve-payment-by-id) endpoint.

### Check the payment status

If, for some reason, you need to confirm the payment capture:

* Use the [Retrieve Payment by ID](/reference/retrieve-payment-by-id) or [Retrieve Payment by merchant\_order\_id](/reference/retrieve-payment-by-merchant-order-id) to get detailed information about the payment.
* Alternatively, set up webhooks to receive notifications for each event. Refer to the [Webhooks](/docs/webhooks/configure-webhooks) guide to learn how to configure webhooks in WHITELABEL.

## See also

* [Cancel Payments](/docs/direct-integration-use-cases/cancel-payments)