---
title: "Schedule or undo cancellation of the current paid subscription"
method: POST
path: "/billing/subscription-cancellation"
tags: ["Billing"]
---

# Schedule or undo cancellation of the current paid subscription

`POST /billing/subscription-cancellation`

## Request

- Base URL: `https://api.flashdata.dev/v2`
- URL: `https://api.flashdata.dev/v2/billing/subscription-cancellation`
- Auth: API key in cookie `__Host-fd_session` and API key in header `X-CSRF-Token`

Setting cancelAtPeriodEnd to true schedules cancellation at the current billing period end; false keeps the subscription. Entitlements update after a verified Stripe subscription event. This endpoint never cancels immediately or issues a refund.

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `cancelAtPeriodEnd` boolean, required

## Response `202`

Cancellation update submitted to Stripe

- SubscriptionCancellationChange
  - `id` string, required
  - `cancelAtPeriodEnd` boolean, required
  - `status` 'submitted', required

## Other responses

- `401`: Authentication required or invalid
- `403`: Authenticated but not permitted, or CSRF validation failed
- `404`: Resource not found or not owned by the caller
- `409`: Resource state or idempotency conflict
- `422`: Request validation failed
- `502`: An upstream provider failed
- `503`: The billing catalog or provider is not configured or is temporarily unavailable

---

[API](https://skmtc.dev/flashdata/apis/flashdata-customer-api.md) · [All operations](https://skmtc.dev/flashdata/apis/flashdata-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flashdata/apis/flashdata-customer-api/revisions/109179fe9313?raw)
