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

# subscription.canceled

> Event triggered when a subscription is canceled.

> [!NOTE]
>
> `subscription.canceled` is always sent for a subscription whose first payment began renewals, and cannot be turned off for it. For any other subscription it is off by default until you enable it in Dashboard → Developer. See [Receiving Webhooks](https://docs.paywithsoap.com/api-reference/api-v1/webhooks/setup.md).

Fired when you [cancel](https://docs.paywithsoap.com/api-reference/api-v1/subscriptions/cancel.md) a subscription, or Soap cancels it. `reason` says why:

| `reason` | Meaning |
| - | - |
| Your `reason`, or null | You canceled it. |
| `payment_failed` | A renewal was never paid. See [Retries and cancellation](https://docs.paywithsoap.com/api-reference/api-v1/webhooks/subscription-renewal-failed.md#retries-and-cancellation). |
| `charge_disputed` | The customer disputed a payment of the subscription. |
| `charge_returned` | A payment of the subscription was returned. |

* End the customer's access at `subscription.ends_at`. If you canceled with paid time left, that is the end of the paid period and `subscription.status` reads `active` until then. Otherwise it is when the subscription was canceled. No other event is sent when `ends_at` passes.
* If a renewal was being charged when you canceled, `ends_at` is the time you canceled. If that charge is then paid, the customer keeps the new period: `ends_at` moves to the renewal's `period_end`, which `checkout.succeeded` carries in `subscription.renewal`, and `subscription.canceled` is not sent again.
* If a payment is disputed or returned after you canceled, while the paid period is still running, Soap ends the subscription now and sends `subscription.canceled` again, with that reason and the new `ends_at`. Once `ends_at` has passed, nothing is sent.
* This event and `subscription.renewal.failed` are sent separately and can arrive in either order. Read the subscription with [`GET /api/v1/subscriptions/{id}`](https://docs.paywithsoap.com/api-reference/api-v1/subscriptions/show) for its current state.

## Payload Structure

```typescript theme={null}
interface WebhookEvent {
  event_id: string;
  data: {
    subscription: Subscription; // the fields listed on subscription.renewed
    reason: string | null;
    created_at: string; // when the subscription was canceled
  };
  type: "subscription.canceled";
}
```

* `subscription` has the same fields as on [`subscription.renewed`](https://docs.paywithsoap.com/api-reference/api-v1/webhooks/subscription-renewed), as they were when the event was created.

## Example Response

```json theme={null}
{
  "event_id": "ev_5RtYuI8oPaSd2FgHj3KlZx4CvBnM6qWe",
  "data": {
    "subscription": {
      "id": "sub_7Hn2Kq9Wx4Lm8Pz3Rt6Vb1Ys5JdCfEaG",
      "customer": {
        "id": "cus_3Lm8Pz3Rt6Vb1Ys5JdCfE7Hn2Kq9WxaG"
      },
      "status": "active",
      "interval": "month",
      "interval_count": 1,
      "line_items": [
        {
          "product_id": "pr_8KpQmZ3xRyVnTsUcWjLaGdBh",
          "sku": "PREMIUM-MONTHLY",
          "product_name": "Premium Monthly Plan",
          "product_url": null,
          "quantity": 1,
          "price_cents": 2999,
          "total_amount_cents": 2999
        }
      ],
      "line_items_total_amount_cents": 2999,
      "current_period_end": "2027-01-18T15:02:00Z",
      "next_billing_at": null,
      "canceled_at": "2026-12-28T10:15:03Z",
      "ends_at": "2027-01-18T15:02:00Z",
      "paused_at": null,
      "created_at": "2026-11-18T15:00:41Z"
    },
    "reason": "customer asked to cancel",
    "created_at": "2026-12-28T10:15:03Z"
  },
  "type": "subscription.canceled"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.