Get payment refund

Refunds API v2
GEThttps://api.mollie.com/v2/payments/*paymentId*/refunds/*id*

Retrieve a single refund by its ID. Note the original payment’s ID is needed as well.

If you do not know the original payment’s ID, you can use the List payment refunds endpoint.

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.

Mollie Connect/OAuth parameters

If you’re creating an app with Mollie Connect/OAuth, the testmode query string parameter is also available.

testmode

boolean
optional
Set this to 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

string
Indicates the response contains a refund object. Will always contain refund for this endpoint.

id

string
The refund’s unique identifier, for example re_4qqhO89gsT.

amount

amount object

The amount refunded to your customer with this refund.

currency

string
An ISO 4217 currency code. The currencies supported depend on the payment methods that are enabled on your account.

value

string
A string containing the exact amount that was refunded in the given currency.

settlementAmount

amount object
optional

This optional field will contain the 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.

Note that 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.

currency

string
The settlement currency, an ISO 4217 currency code.

value

string

A 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

string
The description of the refund that may be shown to your customer, depending on the payment method used.

metadata

mixed
The optional metadata you provided upon refund creation. Metadata can for example be used to link an bookkeeping ID to a refund.

status

string

Since refunds may be delayed for certain payment methods, the refund carries a status field.

Possible values:

  • queued The refund will be processed once you have enough balance. You can still cancel this refund.
  • pending The refund will be processed soon (usually the next business day). You can still cancel this refund.
  • processing The refund is being processed. Cancellation is no longer possible.
  • refunded The refund has been paid out to your customer.
  • failed The refund has failed during processing.

lines

array
optional

An 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 API.

Only available if the refund was created via the Create Order Refund API.

paymentId

string
The unique identifier of the payment this refund was created for. For example: tr_7UhSN1zuXS. The full payment object can be retrieved via the payment URL in the _links object.

orderId

string
optional

The 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
The date and time the refund was issued, in ISO 8601 format.

_links

object

An object with several URL objects relevant to the refund. Every URL object will contain an href and a type field.

self

URL object
The API resource URL of the refund itself.

payment

URL object
The API resource URL of the payment the refund belongs to.

settlement

URL object
optional
The API resource URL of the settlement this payment has been settled with. Not present if not yet settled.

order

URL object
optional
The API resource URL of the order the refund belongs to. Not present if the refund does not belong to an order.

documentation

URL object
The URL to the refund retrieval endpoint documentation.

Example

cURLPHPPythonRubyNode.js
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 = mollie_client.payment_refunds.on(payment).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
We don't have a Node.js code example for this API call yet.

If you have some time to spare, feel free to open a pull request at:
https://github.com/mollie/api-documentation

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-refund",
            "type": "text/html"
        }
    }
}