> **Description:** Capture a reserved payment by transferring the reserved amount from customer to merchant account.

# Capture payment

Capture is the process of moving funds from the customer's account to the merchant's account.
Depending on your bank, this can take a few days.

You can capture:

- The full amount at once (full capture), or
- Portions of the total in several steps (partial capture)

## Authorization

All ePayment API requests must include a valid Bearer token in the `Authorization` header.
See [Authorization](https://developer.vippsmobilepay.com/docs/APIs/epayment-api/api-guide/concepts.md#authorization) for how to obtain one.

## Creating a capture request

### Full capture

Capture the payment using
[`POST:/epayment/v1/payments/{reference}/capture`][capture-payment-endpoint].
The `Idempotency-Key` header is required.

Specify the amount to capture in the `modificationAmount` parameter of the request body.
For example:

```json
curl -X POST https://apitest.vipps.no/epayment/v1/payments/UNIQUE-PAYMENT-REFERENCE/capture \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H "Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY" \
-H "Merchant-Serial-Number: YOUR-MSN" \
-H "Idempotency-Key: YOUR-IDEMPOTENCY-KEY" \
-H "Vipps-System-Name: acme" \
-H "Vipps-System-Version: 3.1.2" \
-H "Vipps-System-Plugin-Name: acme-webshop" \
-H "Vipps-System-Plugin-Version: 4.5.6" \
-d '{
  "modificationAmount": {
    "currency": "NOK",
    "value": 49900
  }
}'
```

If successful, the API returns a summary of payment status.
For example:

```json
{
   "aggregate":{
      "authorizedAmount":{
         "currency":"NOK",
         "value":49900
      },
      "cancelledAmount":{
         "currency":"NOK",
         "value":0
      },
      "capturedAmount":{
         "currency":"NOK",
         "value":49900
      },
      "refundedAmount":{
         "currency":"NOK",
         "value":0
      }
   }
}
```

**Check capture success**

Capture immediately before shipping or releasing the product. Always verify the response body to confirm the full amount was captured before proceeding.
Check the response from the Capture request to ensure that the full amount was captured.

This shows that the customer authorized 499 NOK and you have captured 499 NOK.

**Webhooks**
Register for the webhook event `epayments.payment.captured.v1`
to be notified when the capture is complete.
For setup and event details, see [webhooks](https://developer.vippsmobilepay.com/docs/APIs/epayment-api/api-guide/webhooks.md).

### Partial capture

**Finnish and Danish sales units**

Partial capture through the ePayment API must be enabled for Finnish and Danish sales units.
If you need partial capture for your Finnish or Danish sales unit, inquire during onboarding or
[contact customer service](https://help.vippsmobilepay.com/).

Partial capture lets you capture part of the reserved amount instead of the full total. You can make multiple captures until the authorized amount is fully used, or you can cancel the remaining amount.

This is useful when products are delivered at different times, or if the final amount isn't known in advance.

You should [cancel](https://developer.vippsmobilepay.com/docs/APIs/epayment-api/api-guide/operations/cancel.md) any unused reserved amount as soon as possible to release funds back to the customer.

#### Creating a partial capture request

This is exactly the same as the regular capture request example above, except that you specify
a lower amount value.
Specify the amount you want to capture in the
[`POST:/epayment/v1/payments/{reference}/capture`][capture-payment-endpoint]
request.

An example of a partial capture request body (capturing 100 NOK of the 499 NOK reserved):

```json
{
   "modificationAmount":{
      "currency":"NOK",
      "value":10000
   }
}
```

Once the capture is completed the `aggregate` will be updated to reflect this, for example:

```json
{
   "aggregate":{
      "authorizedAmount":{
         "currency":"NOK",
         "value":49900
      },
      "cancelledAmount":{
         "currency":"NOK",
         "value":0
      },
      "capturedAmount":{
         "currency":"NOK",
         "value":10000
      },
      "refundedAmount":{
         "currency":"NOK",
         "value":0
      }
   }
}
```

Use the ePayment cancel endpoint:
[`POST:/epayment/v1/payments/{reference}/cancel`](https://developer.vippsmobilepay.com/redocusaurus/epayment-swagger-id.yaml)
to release any remaining funds.

For example, this request cancels the entire payment.
*Note: Once cancelled, the payment cannot be captured.*

```bash
curl -X POST https://apitest.vipps.no/epayment/v1/payments/UNIQUE-PAYMENT-REFERENCE/cancel \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H "Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY" \
-H "Merchant-Serial-Number: YOUR-MSN" \
-H "Vipps-System-Name: acme" \
-H "Vipps-System-Version: 3.1.2" \
-H "Vipps-System-Plugin-Name: acme-webshop" \
-H "Vipps-System-Plugin-Version: 4.5.6" \
```

The response will summarize the payment's status.
In this example, 499 NOK was authorized, 100 NOK was captured, and 399 NOK was cancelled:

```json
{
   "aggregate":{
      "authorizedAmount":{
         "currency":"NOK",
         "value":49900
      },
      "cancelledAmount":{
         "currency":"NOK",
         "value":39900
      },
      "capturedAmount":{
         "currency":"NOK",
         "value":10000
      },
      "refundedAmount":{
         "currency":"NOK",
         "value":0
      }
   }
}
```

Related pages:

- [Flows: Electric vehicle charging](https://developer.vippsmobilepay.com/docs/recommended-flows/ev-charging/README.md)
- [ePayment API: Cancel after a partial capture](https://developer.vippsmobilepay.com/docs/APIs/epayment-api/api-guide/operations/cancel.md#cancel-after-a-partial-capture)

## Payment capture deadlines

Although you cannot capture before the product or service is provided, as per the
[capture regulations](https://developer.vippsmobilepay.com/docs/knowledge-base/reserve-and-capture.md#capture-regulations), you should capture funds as soon as legally possible.

If payments are not captured within the below time limits, they will be automatically cancelled.

In Norway, the time limit for capturing payments is 180 days. Be aware: [Credit card payment deadlines may vary](https://developer.vippsmobilepay.com/docs/knowledge-base/reserve-and-capture.md#credit-card-payment-deadlines-may-vary).

 In Denmark and Finland, the time limit for capturing payments is 14 days.
If you require more time, contact your KAM or [customer service](https://help.vippsmobilepay.com/).

For more details, see [General info: Payment capture deadlines](https://developer.vippsmobilepay.com/docs/knowledge-base/reserve-and-capture.md#capture-deadlines).

[capture-payment-endpoint]: https://developer.vippsmobilepay.com/redocusaurus/epayment-swagger-id.yaml

> **Full site overview:** For every page in this documentation, read [https://developer.vippsmobilepay.com/llms.txt](https://developer.vippsmobilepay.com/llms.txt).
