Documentation Index

Fetch the complete documentation index at: https://help.frisbii.com/llms.txt

Use this file to discover all available pages before exploring further.

Cancel a Subscription

Prev Next
This content is currently unavailable in German. You are viewing the default (English) version.

Frisbii Media offers two cancellation modes: cancel at the next possible renewal date (regular cancellation), or cancel at a specific date chosen from a list of valid cancellation dates. Both are available via the public API and the Customer API.


Cancel at next renewal (regular cancellation)

This is the standard cancellation. It cancels the subscription at the next renewal date regardless of the subscription type. No refund is triggered.

// @see https://api.frisbii-media.com/#tag/Subscriptions/operation/cancelSubscriptionRegular
// @see https://customer-api.frisbii-media.com/#tag/Subscriptions/operation/cancelSubscription
$cancelledSubscription = json_decode($client->request('PUT',
    "/subscriptions/{$subscriptionId}/cancel/regular",
    [
        'headers' => ['X-plenigo-token' => eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9],
        'json'    => [],
    ]
)->getBody()->getContents(), true);

Cancel at a specific date

Some subscription types allow cancellation at intermediate dates within the current billing period, potentially triggering a partial refund. To cancel at a specific date:

1. Retrieve the list of valid cancellation dates:

// @see https://api.frisbii-media.com/#tag/Subscriptions/operation/cancelSubscriptionDates
$cancellationDates = json_decode($client->request('GET',
    "/subscriptions/{$subscriptionId}/cancel/dates",
    ['headers' => ['X-plenigo-token' => eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9]]
)->getBody()->getContents(), true)['items'] ?? [];
// Example response:
// [
//     "2024-07-20T00:00:00Z",
//     "2024-08-20T00:00:00Z",
//     ...
//     "2025-06-20T00:00:00Z"  // last date = regular cancellation date
// ]

2. Cancel at your chosen date:

// @see https://api.frisbii-media.com/#tag/Subscriptions/operation/cancelSubscriptionAt
$cancelledSubscription = json_decode($client->request('PUT',
    "/subscriptions/{$subscriptionId}/cancel/at",
    [
        'headers' => ['X-plenigo-token' => eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9],
        'json'    => ['cancellationDate' => '2025-02-20T00:00:00Z'],
    ]
)->getBody()->getContents(), true);

The cancellationDate must be one of the dates returned by /cancel/dates. Passing an arbitrary date that is not in the list will result in an error.


Understanding the cancellation dates list

The shape of the dates list tells you which type of subscription you are working with. This is useful if you want to display different cancellation UI for different subscription types.

Type 1 — Annual billing, cancellable only at year end

The list contains one date per year for up to 12 years. The first date is the regular cancellation date (end of the current annual period).

{
    "items": [
        "2024-07-20T00:00:00Z",
        "2025-07-20T00:00:00Z",
        "2026-07-20T00:00:00Z",
        ...
        "2036-07-20T00:00:00Z"
    ]
}

Type 2 — Annual billing, cancellable monthly with refund (fair consumer contract / KSchG)

The list contains one date per month within the current billing year. Earlier dates trigger a refund. The last date is the regular cancellation date (no refund).

{
    "items": [
        "2024-07-20T00:00:00Z",
        "2024-08-20T00:00:00Z",
        ...
        "2025-06-20T00:00:00Z"
    ]
}

Type 3 — Issue-based, cancellable per issue with refund (cancellationType: ISSUE_BASED)

One date per issue within the current invoice period. Earlier dates trigger a refund.

{
    "items": [
        "2024-07-01T00:00:00Z",
        "2024-07-08T00:00:00Z",
        ...
        "2024-09-16T00:00:00Z"
    ]
}

Type 4 — Issue-based, regular cancellation only (cancellationType: ISSUE_BASED_REGULAR)

Only one date is returned — the end of the current issue period.

{
    "items": [
        "2024-09-16T00:00:00Z"
    ]
}

Multi-step subscriptions

If a subscription has multiple billing steps (e.g. an intro price followed by a regular price), the /cancel/dates endpoint returns dates only up to the end of the step identified by the subscriptionId you pass. To get cancellation dates for the next step, use that step's subscriptionId.


API reference