Get capture

Captures API v2
GEThttps://api.mollie.com/v2/payments/*paymentId*/captures/*id*

Retrieve a single capture by its ID. Note the original payment’s ID is needed as well.

Captures are used for payments that have the authorize-then-capture flow. The only payment methods at the moment that have this flow are Klarna Pay now, Klarna Pay later and Klarna Slice it.

Parameters

Replace paymentId in the endpoint URL by the payment’s ID, and replace id by the capture’s ID. For example: /v2/payments/tr_7UhSN1zuXS/captures/cpt_mNepDkEtco6ah3QNPUGYH.

Access token parameters

If you are using organization access tokens or are creating an OAuth app, you can enable test mode through the testmode query string parameter.

testmodebooleanoptional

Response

200 application/hal+json

resourcestring
Indicates the response contains a capture object. Will always contain capture for this endpoint.
idstring
The capture’s unique identifier, for example cpt_mNepDkEtco6ah3QNPUGYH.
modestring

The mode used to create this capture.

Possible values: live test

amountamount object
The amount captured.
statusstring

The capture’s status.

Possible values: pending succeeded failed

settlementAmountamount object

This optional field will contain the approximate amount that will be settled to your account, converted to the currency your account is settled in. It follows the same syntax as the amount property.

Please note that this amount might be recalculated and changed when the status of the capture changes. We suggest using the List balance transactions endpoint instead to get more accurate settlement amounts for your captures.

paymentIdstring
The unique identifier of the payment this capture was created for, for example: tr_7UhSN1zuXS. The full payment object can be retrieved via the payment URL in the _links object.
shipmentIdstringoptional
The unique identifier of the shipment that triggered the creation of this capture, for example: shp_3wmsgCJN4U. The full shipment object can be retrieved via the shipment URL in the _links object.
settlementIdstringoptional
The unique identifier of the settlement this capture was settled with, for example: stl_jDk30akdN. The full settlement object can be retrieved via the capture URL in the _links object.
createdAtdatetime
The capture’s date and time of creation, in ISO 8601 format.
metadatamixedoptional
The optional metadata you provided upon capture creation. Metadata can for example be used to link an bookkeeping ID to a capture.
_linksobject

An object with several URL objects relevant to the capture. Every URL object will contain an href and a type field.

Show child parameters

selfURL object
The API resource URL of the capture itself.
paymentURL object
The API resource URL of the payment the capture belongs to.
shipmentURL objectoptional
The API resource URL of the shipment that triggered the capture to be created.
settlementURL objectoptional
The API resource URL of the settlement this capture has been settled with. Not present if not yet settled.
documentationURL object
The URL to the capture retrieval endpoint documentation.

Example

cURLPHPPythonRubyNode.js
1
2
 curl -X GET https://api.mollie.com/v2/payments/tr_WDqYK6vllg/captures/cpt_mNepDkEtco6ah3QNPUGYH \
     -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"
1
2
3
4
5
6
<?php
$mollie = new \Mollie\Api\MollieApiClient();
$mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM");

$payment = $mollie->payments->get("tr_WDqYK6vllg");
$capture = $payment->getCapture("cpt_mNepDkEtco6ah3QNPUGYH");
1
2
3
4
5
6
7
from mollie.api.client import Client

mollie_client = Client()
mollie_client.set_api_key("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM")

payment = mollie_client.payments.get("tr_WDqYK6vllg")
capture = payment.captures.get("cpt_mNepDkEtco6ah3QNPUGYH")
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
require 'mollie-api-ruby'

Mollie::Client.configure do |config|
  config.api_key = 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM'
end

capture = Mollie::Payment::Capture.get(
  'cpt_mNepDkEtco6ah3QNPUGYH',
  payment_id: 'tr_WDqYK6vllg'
)
1
2
3
4
5
6
const { createMollieClient } = require('@mollie/api-client');
const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' });

const capture = await mollieClient.paymentCaptures.get('cpt_mNepDkEtco6ah3QNPUGYH', {
  paymentId: 'tr_WDqYK6vllg'
});

Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
HTTP/1.1 200 OK
Content-Type: application/hal+json

{
    "resource": "capture",
    "id": "cpt_mNepDkEtco6ah3QNPUGYH",
    "mode": "live",
    "amount": {
        "value": "1027.99",
        "currency": "EUR"
    },
    "status": "succeeded",
    "settlementAmount": {
        "value": "1027.99",
        "currency": "EUR"
    },
    "paymentId": "tr_WDqYK6vllg",
    "shipmentId": "shp_3wmsgCJN4U",
    "settlementId": "stl_jDk30akdN",
    "createdAt": "2018-08-02T09:29:56+00:00",
    "metadata": {
        "bookkeeping_id": 12345
    },
    "_links": {
        "self": {
            "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg/captures/cpt_mNepDkEtco6ah3QNPUGYH",
            "type": "application/hal+json"
        },
        "payment": {
            "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg",
            "type": "application/hal+json"
        },
        "shipment": {
            "href": "https://api.mollie.com/v2/orders/ord_8wmqcHMN4U/shipments/shp_3wmsgCJN4U",
            "type": "application/hal+json"
        },
        "settlement": {
            "href": "https://api.mollie.com/v2/settlements/stl_jDk30akdN",
            "type": "application/hal+json"
        },
        "documentation": {
            "href": "https://docs.mollie.com/reference/v2/captures-api/get-capture",
            "type": "text/html"
        }
    }
}