Subscriptions API

Cancel subscription

Changed on

Cancel an existing subscription. Canceling a subscription has no effect on the mandates of the customer.

delete/v2/customers/{customerId}/subscriptions/{subscriptionId}

Request

  • Base URL
    https://api.mollie.com
  • URL
    https://api.mollie.com/v2/customers/{customerId}/subscriptions/{subscriptionId}
  • Auth
    • HTTP bearer
    • or HTTP bearer
    • or OAuth 2
      Authorization code: https://my.mollie.com/oauth2/authorize
      Token URL: https://api.mollie.com/oauth2/tokens scopes: subscriptions.write

Headers

idempotency-keystring
Example:123e4567-e89b-12d3-a456-426

A unique key to ensure idempotent requests. This key should be a UUID v4 string.

Request body

testmodeboolean nullable

Most API credentials are specifically created for either live mode or test mode, in which case this parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting testmode to true.

Test entities cannot be retrieved when the endpoint is set to live mode, and vice versa.

Response

The updated subscription object with status canceled. For a complete reference of the subscription object, refer to the Get subscription endpoint documentation.

resourcestring required

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

idstring required
mode'live' | 'test' required

Whether this entity was created in live mode or in test mode.

status'pending' | 'active' | 'canceled' | 'suspended' | 'completed' required

The subscription's current status is directly related to the status of the underlying customer or mandate that is enabling the subscription.

timesinteger nullable required

Total number of payments for the subscription. Once this number of payments is reached, the subscription is considered completed.

Test mode subscriptions will get canceled automatically after 10 payments.

timesRemaininginteger nullable required

Number of payments left for the subscription.

intervalstring required

Interval to wait between payments, for example 1 month or 14 days.

The maximum interval is one year (12 months, 52 weeks, or 365 days).

Possible values: ... days, ... weeks, ... months.

startDatestring required

The start date of the subscription in YYYY-MM-DD format.

nextPaymentDatestring nullable

The date of the next scheduled payment in YYYY-MM-DD format. If the subscription has been completed or canceled, this parameter will not be returned.

descriptionstring required

The subscription's description will be used as the description of the resulting individual payments and so showing up on the bank statement of the consumer.

Please note: the description needs to be unique for the Customer in case it has multiple active subscriptions.

method'creditcard' | 'directdebit' | 'paypal' | 'null' nullable required

The payment method used for this subscription. If omitted, any of the customer's valid mandates may be used.

webhookUrlstring nullable required

We will call this URL for any payment status changes of payments resulting from this subscription.

This webhook will receive all events for the subscription's payments. This may include payment failures as well. Be sure to verify the payment's subscription ID and its status.

customerIdstring required
mandateIdstring
createdAtstring required

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

canceledAtstring nullable

The subscription's date and time of cancellation, in ISO 8601 format. This parameter is omitted if the subscription is not canceled (yet).

profileIdstring

The identifier referring to the profile this entity belongs to.

Most API credentials are linked to a single profile. In these cases the profileId can be omitted in the creation request. For organization-level credentials such as OAuth access tokens however, the profileId parameter is required.

testmodeboolean nullable

Whether to create the entity in test mode or live mode.

Most API credentials are specifically created for either live mode or test mode, in which case this parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting testmode to true.

Example response

{
  "resource": "subscription",
  "id": "sub_5B8cwPMGnU",
  "mode": "live",
  "status": "active",
  "amount": {
    "currency": "EUR",
    "value": "10.00"
  },
  "times": 6,
  "timesRemaining": 5,
  "interval": "2 days",
  "startDate": "2025-01-01",
  "nextPaymentDate": "2025-01-01",
  "description": "Subscription of streaming channel",
  "method": "paypal",
  "applicationFee": {
    "amount": {
      "currency": "EUR",
      "value": "10.00"
    },
    "description": "Platform fee"
  },
  "webhookUrl": "https://example.com/webhook",
  "customerId": "cst_5B8cwPMGnU",
  "mandateId": "mdt_5B8cwPMGnU",
  "createdAt": "2024-03-20T09:13:37+00:00",
  "canceledAt": "2025-01-01T13:10:19+00:00",
  "profileId": "pfl_5B8cwPMGnU",
  "_links": {
    "self": {
      "href": "https://...",
      "type": "application/hal+json"
    },
    "customer": {
      "href": "https://...",
      "type": "application/hal+json"
    },
    "mandate": {
      "href": "https://...",
      "type": "application/hal+json"
    },
    "profile": {
      "href": "https://...",
      "type": "application/hal+json"
    },
    "payments": {
      "href": "https://...",
      "type": "application/hal+json"
    },
    "documentation": {
      "href": "https://...",
      "type": "application/hal+json"
    }
  }
}

Changes

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      the response property ////// became required for the status

    • info

      the response property ////// became required for the status

    • info

      the response property ////// became required for the status

    • info

      the response property ////// became required for the status