Docs / wallet / cancelAppSubscription

cancelAppSubscription

utilitysince 0.3.0

Client function: cancel an app subscription at period end (P0-162).

import { cancelAppSubscription } from 'flowstack-sdk'

Non-React client function. Sets the subscription to cancel at period end — access and remaining allowance continue until current_period_end (standard SaaS behavior; immediate cancel is not offered). POST /billing/app-access/subscription/cancel. React apps should prefer useAppAccess().cancelSubscription().

Signature

cancelAppSubscription(credentials, siteId, config?): Promise<ApiResponse<{ status: string; cancel_at_period_end: boolean; current_period_end: string | null }>>

Parameters

ParamTypeNotesDescription
credentialsFlowstackCredentialsrequiredThe subscriber's credentials.
siteIdstringrequiredThe app whose subscription to cancel.
configFlowstackClientConfigClient config (baseUrl, appScope, tenantId as needed).

Returns

FieldTypeDescription
Promise<ApiResponse<{ status: string; cancel_at_period_end: boolean; current_period_end: string | null }>>Confirmation with the period-end date access runs until. 404 if there is no active subscription.

Examples

Cancel at period end
await cancelAppSubscription(credentials, siteId, { appScope: siteId });

See also

subscribeToApp · useAppAccess · AppSubscriptionStatus

Source: src/api/client.ts (App Subscriptions, P0-162) · Also available in llms-full.txt and registry.json.