# Cancel Plan

<Danger>
**Cascade cancellation is synchronous and immediate**

Canceling a plan cancels every subscription on it right away — there's no way to cancel the plan without also canceling its subscribers. Check `affected_subscriptions` in the response to know how many were affected.

Re-canceling an already-`CANCELED` plan is safe and re-runs the cascade — it returns `200` again, not an error. This is deliberate: it's the recovery path if a previous cascade partially failed to cancel some subscriptions, so retry a cancel call if you're unsure it fully completed. `INVALID_STATE` (`400`) is reserved for a plan status outside `ACTIVE`/`CANCELED`, which isn't currently reachable given those are the only two plan statuses.
</Danger>

**POST** `/subscriptions/plans/{plan_id}/status`

Base URL: `https://api-sandbox.whitelabel.com/v1`

The only supported status transition. Canceling a plan blocks new subscriptions AND synchronously cascade-cancels every subscription currently linked to it.

## Authorization

- public-api-key (apiKey in header)
- private-secret-key (apiKey in header)

## Header parameters

- `X-Account-Code` (string, required)
  The `account_id` found in your [WHITELABEL Dashboard](https://dashboard.whitelabel.com/developers) (UUID). Required — omitting it returns `400 BAD_REQUEST` ("Invalid x-account-code header.").

## Path parameters

- `plan_id` (string, required)
  The unique identifier of the plan.

## Body

Content type: `application/json`

- `status` ("CANCELED", required)

Example:

```json
{
  "status": "CANCELED"
}
```

## Responses

### 200

200

- `id` (string)
- `status` (string)
- `affected_subscriptions` (integer)
  The number of subscriptions that were cascade-canceled along with the plan.

Example:

```json
{
  "id": "string",
  "status": "string",
  "affected_subscriptions": 0
}
```

### 400

400. Reserved for a plan status outside ACTIVE/CANCELED — not currently reachable, since those are the plan's only two statuses today. Re-canceling an already-CANCELED plan does NOT hit this: it re-runs the cascade and returns 200.

- `code` (string)
- `messages` (string[])

Example:

```json
{
  "code": "INVALID_STATE",
  "messages": [
    "string"
  ]
}
```