Get payment refund¶
GET
https://api.mollie.com/v2/payments/*paymentId*/refunds/*id*
Retrieve a single payment refund by its ID. Note the payment ID is required as well.
If you do not know the original payment’s ID, you can use the List refunds.
Note
Trying to retrieve a canceled refund will result in a 404 response.
Parameters¶
Replace paymentId
in the endpoint URL by the payment’s ID, and replace id
by the refund’s ID. For example:
/v2/payments/tr_7UhSN1zuXS/refunds/re_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 get a refund made in test mode. If you omit this parameter, you can only retrieve live
mode refunds.Response¶
200
application/hal+json
resource
stringrefund
for this endpoint.id
stringre_4qqhO89gsT
.amount
amount objectThe amount refunded to your customer with this refund.
currency
stringvalue
stringsettlementId
stringoptionalstl_BkEjN2eBb
. This field
is omitted if the refund is not settled (yet).settlementAmount
amount objectoptionalThis optional field will contain the approximate amount that will be deducted from your account balance, converted
to the currency your account is settled in. It follows the same syntax as the amount
property.
For refunds, the value
key of settlementAmount
will be negative.
Any amounts not settled by Mollie will not be reflected in this amount, e.g. PayPal refunds.
Queued refunds in non-EUR currencies will not have a settlement amount until they become pending
.
Please note that this amount might be recalculated and changed when the status of the refund changes. We suggest using the List balance transactions endpoint instead to get more accurate settlement amounts for your refunds.
currency
stringvalue
stringA string containing the exact amount that was deducted for the refund from your account balance in the settlement currency. Note that this will be negative.
If the refund is queued and in a different currency than the settlement currency, the settlement amount will be
null
as the exchange rates may change until the refund is finally executed.
description
stringmetadata
mixedstatus
stringSince refunds may not be instant for certain payment methods, the refund carries a status field.
For a full overview, see Refund statuses.
lines
arrayoptionalAn array of order line objects as described in Get order.
The lines will show the quantity
, discountAmount
, vatAmount
and totalAmount
refunded. If the line was
partially refunded, these values will be different from the values in response from the Get order endpoint.
Only available if the refund was created via the Create order refund endpoint.
paymentId
stringtr_7UhSN1zuXS
. The full payment
object can be retrieved via the payment
URL in the _links
object.orderId
stringoptionalThe unique identifier of the order this refund was created for. For example: ord_8wmqcHMN4U
. Not present if the
refund was not created for an order.
The full order object can be retrieved via the order
URL in the _links
object.
createdAt
datetime_links
objectAn object with several URL objects relevant to the refund. Every URL object will contain an href
and a type
field.
self
URL objectpayment
URL objectsettlement
URL objectoptionalorder
URL objectoptionaldocumentation
URL objectMollie Connect response parameters¶
An object containing information relevant to a refund issued for a split payment. To learn more about split payments, refer to the Mollie Connect overview.
amount
amount objectsource
objectorganizationId
will indicate from which organization
the amount was refunded.Example¶
1 2 | curl -X GET https://api.mollie.com/v2/payments/tr_WDqYK6vllg/refunds/re_4qqhO89gsT \ -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" |
1 2 3 4 | <?php $mollie = new \Mollie\Api\MollieApiClient(); $mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"); $refund = $mollie->payments->get("tr_WDqYK6vllg")->getRefund("re_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") refund = payment.refunds.get("re_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 refund = Mollie::Payment::Refund.get( 're_4qqhO89gsT', payment_id: 'tr_WDqYK6vllg' ) |
1 2 3 4 5 6 | const { createMollieClient } = require('@mollie/api-client'); const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' }); const refund = await mollieClient.paymentRefunds.get('re_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 | HTTP/1.1 200 OK Content-Type: application/hal+json { "resource": "refund", "id": "re_4qqhO89gsT", "amount": { "currency": "EUR", "value": "5.95" }, "status": "pending", "createdAt": "2018-03-14T17:09:02.0Z", "description": "Order #33", "metadata": { "bookkeeping_id": 12345 }, "paymentId": "tr_WDqYK6vllg", "_links": { "self": { "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg/refunds/re_4qqhO89gsT", "type": "application/hal+json" }, "payment": { "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg", "type": "application/hal+json" }, "documentation": { "href": "https://docs.mollie.com/reference/v2/refunds-api/get-payment-refund", "type": "text/html" } } } |