Cancel subscription
Subscriptions API

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

A subscription can be cancelled any time by calling DELETE on the resource endpoint.

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

Example

Request code

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

$mollie->customers_subscriptions->withParentId("cst_stTC2WHAuS")
    ->cancel("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": "cancelled",
    "amount": "25.00",
    "times": 4,
    "interval": "3 months",
    "description": "Quarterly payment",
    "method": null,
    "cancelledDatetime": "2016-10-06T14:03:02.0Z",
    "links": {
        "webhookUrl": "https://webshop.example.org/payments/webhook"
    }
}