> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# subscription_cancelled Event

> Track when a cancellation is requested (may still be active until period end).

Fires when a cancellation is requested (may still be active until period end). Use this event to trigger win-back campaigns and measure cancellation reasons.

## JavaScript

```javascript theme={null}
window._upstack('track', 'subscription_cancelled', {
  subscriptionId: 'sub_def456',
  accountId: 'acct_abc123',
  planId: 'plan_pro_monthly',
  cancelReason: 'too_expensive',
  cancelFeedback: 'Budget constraints this quarter',
  mrr: 9900,
  cancelAtPeriodEnd: true
});
```

## Properties

| Property          | Type    | Required | Description                               |
| ----------------- | ------- | -------- | ----------------------------------------- |
| subscriptionId    | string  | Yes      | Subscription identifier                   |
| accountId         | string  | Yes      | Account identifier                        |
| planId            | string  | No       | Cancelled plan                            |
| cancelReason      | string  | No       | Cancellation reason code                  |
| cancelFeedback    | string  | No       | User-provided feedback                    |
| mrr               | number  | No       | MRR being cancelled in cents              |
| cancelAtPeriodEnd | boolean | No       | If true, cancels at end of billing period |

## When to Fire

* When customer clicks cancel button
* When cancellation request is submitted
* When Stripe subscription is set to cancel at period end
