List subscriptions

Subscriptions API v2
GEThttps://api.mollie.com/v2/customers/*customerId*/subscriptions

Retrieve all subscriptions of a customer.

Parameters

Replace customerId in the endpoint URL by the customer’s ID, for example cst_8wmqcHMN4U.

fromstringoptional
Used for pagination. Offset the result set to the subscription with this ID. The subscription with this ID is included in the result set as well.
limitintegeroptional
The number of subscriptions to return (with a maximum of 250).

Access token parameters

If you are using organization access tokens or are creating an OAuth app, you have to specify which profile you are retrieving subscriptions for using the profileId parameter. Organizations can have multiple profiles for each of their websites. See Profiles API for more information.

For these authentication methods the optional testmode parameter is available as well to enable test mode.

profileIdstringrequired for access tokens
testmodebooleanoptional

Response

200 application/hal+json

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

The object containing the queried data.

Hide child parameters

subscriptionsarray
An array of subscription objects as described in Get subscription.
_linksobject

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

Show child parameters

selfURL object
The URL to the current set of subscriptions.
previousURL object
The previous set of subscriptions, if available.
nextURL object
The next set of subscriptions, if available.
documentationURL object
The URL to the subscriptions list endpoint documentation.

Example

cURLPHPPythonRubyNode.js
1
2
curl -X GET https://api.mollie.com/v2/customers/cst_8wmqcHMN4U/subscriptions \
   -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"
1
2
3
4
5
6
<?php
$mollie = new \Mollie\Api\MollieApiClient();
$mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM");

$customer = $mollie->customers->get("cst_8wmqcHMN4U");
$subscriptions = $customer->subscriptions();
1
2
3
4
5
6
from mollie.api.client import Client

mollie_client = Client()
mollie_client.set_api_key("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM")

subscriptions = mollie_client.customer_subscriptions.with_parent_id('cst_8wmqcHMN4U').list()
1
2
3
4
5
6
7
8
require 'mollie-api-ruby'

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

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

(async () => {
  const subscriptions = await mollieClient.customers_subscriptions.all({ customerId: 'cst_8wmqcHMN4U' });
})();

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
57
58
59
60
HTTP/1.1 200 OK
Content-Type: application/hal+json

{
    "count": 3,
    "_embedded": {
        "subscriptions": [
            {
                "resource": "subscription",
                "id": "sub_rVKGtNd6s3",
                "mode": "live",
                "createdAt": "2018-06-01T12:23:34+00:00",
                "status": "active",
                "amount": {
                    "value": "25.00",
                    "currency": "EUR"
                },
                "times": 4,
                "timesRemaining": 3,
                "interval": "3 months",
                "startDate": "2016-06-01",
                "nextPaymentDate": "2016-09-01",
                "description": "Quarterly payment",
                "method": null,
                "webhookUrl": "https://webshop.example.org/subscriptions/webhook",
                "_links": {
                    "self": {
                        "href": "https://api.mollie.com/v2/customers/cst_stTC2WHAuS/subscriptions/sub_rVKGtNd6s3",
                        "type": "application/hal+json"
                    },
                    "profile": {
                        "href": "https://api.mollie.com/v2/profiles/pfl_URR55HPMGx",
                        "type": "application/hal+json"
                    },
                    "customer": {
                        "href": "https://api.mollie.com/v2/customers/cst_stTC2WHAuS",
                        "type": "application/hal+json"
                    }
                }
            },
            { },
            { }
        ]
    },
    "_links": {
        "self": {
            "href": "https://api.mollie.com/v2/customers/cst_stTC2WHAuS/subscriptions",
            "type": "application/hal+json"
        },
        "previous": null,
        "next": {
            "href": "https://api.mollie.com/v2/customers/cst_stTC2WHAuS/subscriptions?from=sub_mnfbwhMfvo",
            "type": "application/hal+json"
        },
        "documentation": {
            "href": "https://docs.mollie.com/reference/v2/subscriptions-api/list-subscriptions",
            "type": "text/html"
        }
    }
}