---
title: "Cancel a subscription"
method: POST
path: "/api/subscriptions/{id}/cancel"
tags: ["Subscriptions"]
---

# Cancel a subscription

`POST /api/subscriptions/{id}/cancel`

Cancel a subscription either immediately or at the end of the current billing period. When set to "period_end", the subscription remains active until the current period expires.

## Path parameters

- `id` string, required

## Request body

- CancelSubscriptionDto
  - `cancelAt` 'now' | 'period_end', required — When to cancel: immediately or at end of current period

## Response `200`

Subscription canceled or scheduled for cancellation

- SubscriptionResponse
  - `id` string, required
  - `externalId` string
  - `customerId` string, required
  - `planId` string, required
  - `previousPlanId` string
  - `status` 'ACTIVE' | 'PAST_DUE' | 'CANCELED' | 'TRIALING' | 'PAUSED', required
  - `currency` string, required
  - `billingTiming` 'IN_ADVANCE' | 'IN_ARREARS', required
  - `currentPeriodStart` string, required
  - `currentPeriodEnd` string, required
  - `cancelAt` string
  - `canceledAt` string
  - `trialStart` string
  - `trialEnd` string
  - `startedAt` string, required
  - `metadata` object
  - `customer` SubscriptionCustomerResponse
    - `id` string, required
    - `name` string, required
    - `email` string, required
  - `plan` SubscriptionPlanResponse
    - `id` string, required
    - `name` string, required
    - `billingInterval` 'HOURLY' | 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'QUARTERLY' | 'YEARLY', required
  - `createdAt` string, required
  - `updatedAt` string, required

## Other responses

- `400` — Subscription is already canceled
- `404` — Subscription not found

---

[API](https://skmtc.net/novabilling/apis/novabilling-api.md) · [All operations](https://skmtc.net/novabilling/apis/novabilling-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/novabilling/novabilling-api/versions/0e449a4e0dc8/schema)
