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_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.
true
to retrieve a test mode capture.Response¶
200
application/hal+json
resource
stringcapture
for this endpoint.id
stringcpt_mNepDkEtco6ah3QNPUGYH
.mode
stringThe mode used to create this capture.
Possible values: live
test
amount
amount objectstatus
stringThe capture’s status.
Possible values: pending
succeeded
failed
settlementAmount
amount objectThis 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.
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
datetimemetadata
mixedoptional_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_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" } } } |