---
title: "Cancel Subscription"
method: POST
path: "/billing/subscription/cancel"
tags: ["internal"]
---

# Cancel Subscription

`POST /billing/subscription/cancel`

## Request

- Base URL: `https://api.companydata.dk` (the document declares no server; this is the origin it was published from)
- URL: `https://api.companydata.dk/billing/subscription/cancel`
- Auth: HTTP bearer

Cancel the current subscription at the end of the paid period.

The user keeps Pro access until current_period_end. Stripe's
customer.subscription.updated webhook persists the cancel flag and sends the
confirmation email; we also write the flag locally for an immediate UI update.

## Request body

- CancelSubscriptionRequest: Request to cancel the current subscription at period end.
  - `reason` string, nullable: Optional cancellation reason for retention analytics

## Response `200`

Successful Response

- SubscriptionStateResponse: Current cancellation state after a cancel/reactivate action.
  - `cancel_at_period_end` boolean, required
  - `current_period_end` string, date-time, nullable
  - `status` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/companydata/apis/companydata-dk-api.md) · [All operations](https://skmtc.dev/companydata/apis/companydata-dk-api/llms.txt) · [OpenAPI document](https://skmtc.dev/companydata/apis/companydata-dk-api/revisions/1cc6c361ae64?raw)
