Get subscription
Subscriptions API

GET
https://api.mollie.nl/v1/customers/customerId/subscriptions/id
Authentication: API keys OAuth access tokens

Retrieve a single subscription by its ID. Note the customer's ID is needed as well.

Parameters

Replace customerId in the endpoint URL by the customer ID, and replace id by the subscription ID. For example: /v1/customers/cst_stTC2WHAuS/subscriptions/sub_rVKGtNd6s3.

Includes

Some endpoints allow you to indicate if you want more information to be included in the API response via the include querystring parameter.

  • No includes supported for this endpoint.

Response

200
application/json; charset=utf-8
resource
string

Indicates the response contains a subscription object.

Possible values: subscription

id
string

The subscription's unique identifier, for example sub_rVKGtNd6s3.

customerId
string

The customer's unique identifier, for example cst_stTC2WHAuS.

mode
string

The mode used to create this subscription. Mode determines whether the payments are real or test payments.

Possible values: live test

createdDatetime
datetime

The subscription's date and time of creation, in ISO 8601 format.

status
string

The subscription's current status, depends on whether the customer has a pending, valid or invalid mandate.

Possible values: pending active cancelled suspended completed

amount
decimal

The constant amount that is charged with each subscription payment.

times
int | null

Total number of charges for the subscription to complete.

interval
string

Interval to wait between charges like 1 month(s) or 14 days.

Possible values: … months … weeks … days

startDate
string

The start date of the subscription in yyyy-mm-dd format.

description
string

A description unique per customer. This will be included in the payment description along with the charge date in yyyy-mm-dd format.

method
string | null

The payment method used for this subscription, either forced on creation by specifying the method parameter, or null if any of the customer's valid mandates may be used.

Possible values: creditcard directdebit null

cancelledDatetime
datetime | null

The subscription's date of cancellation, in ISO 8601 format.

links
object

An object with URLs important to the payment process.

webhookUrl
string | null

The URL Mollie will call as soon a payment status change takes place.

Example

Request code

$mollie = new Mollie_API_Client;
$mollie->setApiKey('test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM');

$subscriptions = $mollie->customers_subscriptions->withParentId("cst_stTC2WHAuS")->get("sub_rVKGtNd6s3");

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "resource": "subscription",
    "id": "sub_rVKGtNd6s3",
    "customerId": "cst_stTC2WHAuS",
    "mode": "live",
    "createdDatetime": "2016-06-01T12:23:34.0Z",
    "status": "active",
    "amount": "25.00",
    "times": 4,
    "interval": "3 months",
    "description": "Quarterly payment",
    "method": null,
    "cancelledDatetime": null,
    "links": {
        "webhookUrl": "https://webshop.example.org/payments/webhook"
    }
}