Get capture¶
GET
https://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_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.
true
to retrieve a test mode capture.Response¶
200
application/hal+json
resource
stringcapture
for this endpoint.id
stringcpt_4qqhO89gsT
.mode
stringThe mode used to create this capture.
Possible values: live
test
amount
amount objectsettlementAmount
amount objectamount
property.paymentId
stringtr_7UhSN1zuXS
. The full payment
object can be retrieved via the payment
URL in the _links
object.shipmentId
stringoptionalshp_3wmsgCJN4U
.
The full shipment object can be retrieved via the shipment
URL in the _links
object.settlementId
stringoptionalstl_jDk30akdN
. The full
settlement object can be retrieved via the capture
URL in the _links
object.createdAt
datetime_links
objectAn object with several URL objects relevant to the capture. Every URL object will contain an href
and a type
field.
self
URL objectpayment
URL objectshipment
URL objectoptionalsettlement
URL objectoptionaldocumentation
URL objectExample¶
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 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_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 | const { createMollieClient } = require('@mollie/api-client'); const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' }); const capture = await mollieClient.paymentCaptures.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" } } } |