kit.subscriptions.cancel()| Field | Type | Required | Description |
|---|---|---|---|
subscriptionId | string | Yes | The subscription to cancel. |
atPeriodEnd | boolean | No, defaults to false | If true, the subscription keeps running until the current period ends, then cancels (cancel_at_period_end). If false, it is cancelled immediately. |
cancellationReason | string | No | Stored as a comment on Stripe's cancellation details. |
status stays 'active' and canceledAtUtc stays null when cancelling at period end, only cancelAtPeriodEnd flips to true. If atPeriodEnd is false instead, status becomes 'canceled' immediately and canceledAtUtc is set.| Exception | When |
|---|---|
StripeOperationError | The subscription ID does not exist, or is already cancelled. |
storage adapter is configured, the record is persisted via saveSubscription() immediately.atPeriodEnd cancellation before the period actually ends, use resume().