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 anIErrorobject, never tofalse. An error object is truthy, so checkresult === truerather thanif (result). Witherrors.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: booleanReturns true if the subscription was cancelled.
example: true