Skip to main content

cancelSubscription

Cancel a subscription. 🔐 This method requires authorization.

Description​

Cancels the authenticated user's subscription to the plan with the given marker. Resolves to true when the subscription is cancelled.

With the default errors.isShell: true, a failed request resolves to an IError object, never to false. An error object is truthy, so check result === true rather than if (result). With errors.isShell: false, the method throws instead (SDK 1.0.172 and later).

.cancelSubscription(

);

Parameters schema​

Schema

body(required): ICancelSubscription
Subscription parameters.
example:

{ marker: "premium" }

body.marker(required): string
Marker of the subscription.
example: "premium"

Examples​

Minimal example​

const response = await Subscriptions.cancelSubscription({ marker: 'premium' });

Example response​

No example response is shown because the call needs a user with an active subscription. On success it resolves to true; see the response schema below.

Response schema​

Details

Schema: boolean boolean: boolean
Returns true if the subscription was cancelled.
example: true