List captures¶
Captures API v2
GET
https://api.mollie.com/v2/payments/*paymentId*/captures
Authentication:API keysOrganization access tokensApp access tokens
Retrieve all captures for a certain payment.
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. For example: /v2/payments/tr_7UhSN1zuXS/captures
.
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.
Set this to
true
to retrieve captures for a test mode payment.Response¶
200
application/hal+json
count
integer
The number of captures found in
_embedded
, which is either the requested number (with a maximum of 250) or the
default number._embedded
objectThe object containing the queried data.
captures
array
An array of capture objects as described in Get capture.
_links
objectLinks to help navigate through the lists of captures. Every URL object will contain an href
and a type
field.
self
object
The URL to the current set of captures.
previous
object
The previous set of captures, if available.
next
object
The next set of captures, if available.
documentation
object
The URL to the List payment captures endpoint documentation.
Example¶
cURLPHPPythonRubyNode.js
1 2 | curl -X GET https://api.mollie.com/v2/payments/tr_WDqYK6vllg/captures \ -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"); $captures = $payment->captures(); |
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") captures = payment.captures.list() |
1 2 3 4 5 6 7 | require 'mollie-api-ruby' Mollie::Client.configure do |config| config.api_key = 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' end captures = Mollie::Payment::Capture.all(payment_id: 'tr_WDqYK6vllg') |
1 2 3 4 | const { createMollieClient } = require('@mollie/api-client'); const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' }); const captures = mollieClient.paymentCaptures.iterate({ 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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | HTTP/1.1 200 OK Content-Type: application/hal+json { "_embedded": { "captures": [ { "resource": "capture", "id": "cpt_4qqhO89gsT", "mode": "live", "amount": { "value": "1027.99", "currency": "EUR" }, "settlementAmount": { "value": "399.00", "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" } } } ] }, "count": 1, "_links": { "documentation": { "href": "https://docs.mollie.com/reference/v2/captures-api/list-captures", "type": "text/html" }, "self": { "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg/captures?limit=50", "type": "application/hal+json" }, "previous": null, "next": null } } |