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

# Cancel a subscription

> Cancels an active subscription for a customer.

<Info>Click the base URL in the API playground and select the **Sandbox** host for test data or the **Production** host for live data. Use credentials from the same environment.</Info>


## OpenAPI

````yaml /api-reference/openapi.json post /subscriptions/{subscriptionId}/cancel/
openapi: 3.0.0
info:
  title: kelviq API
  version: 1.0.0
  description: >-
    API for interacting with kelviq services, derived from Python SDK
    documentation.
servers:
  - url: https://sandboxapi.kelviq.com/api/v1
    description: Sandbox — Test payments
  - url: https://api.kelviq.com/api/v1
    description: Production — Live payments
security:
  - bearerAuth: []
tags:
  - name: Products
    description: Catalog products.
  - name: Product Settings
    description: Per-product settings (currency, VPN/Tor/proxy, product URL).
  - name: Product Files
    description: Product images and downloadable assets.
  - name: Features
    description: Catalog features that can be granted as plan entitlements.
  - name: Plans
    description: Catalog plans (CRUD, publish, versions, prices).
  - name: Plan Entitlements
    description: Feature entitlements attached to a plan.
  - name: Plan Files
    description: Files attached to plans, and signed download links.
  - name: Media
    description: Generate presigned S3 upload URLs for product/plan images and files.
  - name: Partner
    description: Partner integration APIs (organization provisioning, lookup).
  - name: Charges
    description: >-
      One-time payments charged immediately against a customer's default payment
      method.
  - name: Refunds
    description: Full and partial refunds for paid orders.
  - name: Payment Methods
    description: Saved customer payment methods (cards, etc.).
paths:
  /subscriptions/{subscriptionId}/cancel/:
    post:
      tags:
        - Subscriptions
      summary: Cancel a subscription
      description: Cancels an active subscription for a customer.
      operationId: cancelSubscription
      parameters:
        - name: subscriptionId
          in: path
          required: true
          description: >-
            The unique identifier of the subscription to be cancelled. Example
            UUID from docs: 78058918-9746-4280-9b9b-1bd5115eec6e
          example: 78058918-9746-4280-9b9b-1bd5115eec6e
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelSubscriptionRequest'
      responses:
        '200':
          description: Subscription cancellation processed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelSubscriptionResponse'
              example:
                message: Subscription cancellation processed successfully.
components:
  schemas:
    CancelSubscriptionRequest:
      type: object
      required:
        - cancellationType
      properties:
        cancellationType:
          type: string
          enum:
            - IMMEDIATE
            - CURRENT_PERIOD_ENDS
            - SPECIFIC_DATE
          description: Type of cancellation to perform.
          example: IMMEDIATE
        cancellationDate:
          type: string
          format: date
          nullable: true
          description: 'Required if cancellationType is ''SPECIFIC_DATE''. Format: yyyy-MM-dd.'
          example: '2025-12-31'
    CancelSubscriptionResponse:
      type: object
      properties:
        message:
          type: string
          example: Subscription cancellation processed successfully.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        The Server API Key obtained from the kelviq application. Pass as a
        Bearer token in the Authorization header. Example: 'Authorization:
        Bearer __YOUR_API_KEY__'

````