List payment refunds

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

Retrieve refunds.

  • If the payment-specific endpoint is used, only refunds for that specific payment are returned.
  • When using the top level endpoint v2/refunds with an API key, only refunds for the corresponding website profile and mode are returned.
  • When using the top level endpoint with OAuth, you can specify the profile and mode with the profileId and testmode parameters respectively. If you omit profileId, you will get all refunds for the organization.

The results are paginated. See pagination for more information.

Parameters

When using the payment-specific endpoint, replace paymentId in the endpoint URL by the payment’s ID, for example tr_7UhSN1zuXS.

from

string
optional
Offset the result set to the refund with this ID. The refund with this ID is included in the result set as well.

limit

integer
optional
The number of refunds to return (with a maximum of 250).

Access token parameters

If you are using organization access tokens or are creating an OAuth app, the following query string parameters are also available. With the profileId parameter, you can specify which profile you want to look at when listing refunds. If you omit the profileId parameter, you will get all refunds on the organization.

profileId

string
optional
The website profile’s unique identifier, for example pfl_3RkSN1zuPE.

testmode

boolean
optional
Set this to true to only retrieve refunds made in test mode. By default, only live payments are returned.

Response

200 application/hal+json

count

integer
The number of refunds found in _embedded, which is either the requested number (with a maximum of 250) or the default number.

_embedded

object

The object containing the queried data.

refunds

array
An array of refund objects as described in Get payment refund.

_links

object

Links to help navigate through the lists of refunds. Every URL object will contain an href and a type field.

self

object
The URL to the current set of refunds.

previous

object
The previous set of refunds, if available.

next

object
The next set of refunds, if available.

documentation

object
The URL to the List payment refunds endpoint documentation.

Example

cURLPHPPythonRubyNode.js
1
2
curl -X GET https://api.mollie.com/v2/payments/tr_7UhSN1zuXS/refunds \
   -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"
1
2
3
4
<?php
$mollie = new \Mollie\Api\MollieApiClient();
$mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM");
$refunds = $mollie->payments->get("tr_WDqYK6vllg")->refunds();
1
2
3
4
5
from mollie.api.client import Client

mollie_client = Client()
mollie_client.set_api_key('test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM')
refunds = mollie_client.payments.get('tr_WDqYK6vllg').refunds
1
2
3
4
5
6
7
require 'mollie-api-ruby'

Mollie::Client.configure do |config|
  config.api_key = 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM'
end

refunds = Mollie::Payment.get('tr_7UhSN1zuXS').refunds
1
2
3
4
5
6
const { createMollieClient } = require('@mollie/api-client');
const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' });

(async () => {
  const refunds = await mollieClient.payments_refunds.page({ 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
HTTP/1.1 200 OK
Content-Type: application/hal+json

{
    "count": 5,
    "_embedded": {
        "refunds": [
            {
                "resource": "refund",
                "id": "re_4qqhO89gsT",
                "amount": {
                    "currency": "EUR",
                    "value": "5.95"
                },
                "status": "pending",
                "createdAt": "2018-03-14T17:09:02.0Z",
                "description": "Order",
                "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"
                    }
                }
            },
            { },
            { }
        ]
    },
    "_links": {
        "self": {
            "href": "https://api.mollie.com/v2/payments/tr_7UhSN1zuXS/refunds?limit=5",
            "type": "application/hal+json"
        },
        "previous": null,
        "next": {
            "href": "https://api.mollie.com/v2/payments/tr_7UhSN1zuXS/refunds?from=re_APBiGPH2vV&limit=5",
            "type": "application/hal+json"
        },
        "documentation": {
            "href": "https://docs.mollie.com/reference/v2/refunds-api/list-refunds",
            "type": "text/html"
        }
    }
}