cancelAppSubscription
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
| Param | Type | Notes | Description |
|---|---|---|---|
credentials | FlowstackCredentials | required | The subscriber's credentials. |
siteId | string | required | The app whose subscription to cancel. |
config | FlowstackClientConfig | — | Client config (baseUrl, appScope, tenantId as needed). |
Returns
| Field | Type | Description |
|---|---|---|
| — | 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.