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 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_4qqhO89gsT.

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_4qqhO89gsT.
modestring

The mode used to create this capture.

Possible values: live test

amountamount object
The amount captured.
settlementAmountamount object
This optional field will contain the 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.
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.
_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_4qqhO89gsT \
     -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_4qqhO89gsT");
1
2
3
4
5
6
from mollie.api.client import Client

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

capture = mollie_client.captures.with_parent_id('tr_WDqYK6vllg').get('cpt_4qqhO89gsT')
 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_4qqhO89gsT',
  payment_id: 'tr_WDqYK6vllg'
)
1
2
3
4
5
6
7
8
9
const { createMollieClient } = require('@mollie/api-client');
const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' });

(async () => {
  const capture = await mollieClient.payments_captures.get(
    'cpt_4qqhO89gsT',
    { 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
HTTP/1.1 200 OK
Content-Type: application/hal+json

{
    "resource": "capture",
    "id": "cpt_4qqhO89gsT",
    "mode": "live",
    "amount": {
        "value": "1027.99",
        "currency": "EUR"
    },
    "settlementAmount": {
        "value": "1027.99",
        "currency": "EUR"
    },
    "paymentId": "tr_WDqYK6vllg",
    "shipmentId": "shp_3wmsgCJN4U",
    "settlementId": "stl_jDk30akdN",
    "createdAt": "2018-08-02T09:29:56+00:00",
    "_links": {
        "self": {
            "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg/captures/cpt_4qqhO89gsT",
            "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"
        }
    }
}