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

# Cancel Subscription

> Use this API to cancel the subscription. After a successful cancellation, the subscription status will move to "CANCELLED", and the customer will no longer be charged. Subscription, once cancelled, cannot be reactivated.



## OpenAPI

````yaml post /api/v2/subscriptions/{subReferenceId}/cancel
openapi: 3.0.0
info:
  title: Cashfree Subscription API
  description: >-
    Create and manage subscriptions and collect recurring payments from
    customers easily with Cashfree Subscriptions.
  version: v2
servers:
  - url: https://sandbox.cashfree.com
    description: Sandbox server
  - url: https://api.cashfree.com
    description: Production server
security: []
externalDocs:
  url: https://docs.cashfree.com/reference/postman-collection-1
  description: This url will have the information of all the APIs.
paths:
  /api/v2/subscriptions/{subReferenceId}/cancel:
    post:
      tags:
        - Subscription
      summary: Cancel Subscription
      description: >-
        Use this API to cancel the subscription. After a successful
        cancellation, the subscription status will move to "CANCELLED", and the
        customer will no longer be charged. Subscription, once cancelled, cannot
        be reactivated.
      operationId: cancelSubscription
      parameters:
        - name: X-Client-Id
          in: header
          required: true
          schema:
            type: string
            description: Client ID provided by Cashfree.
            example: asdf1234
        - name: X-Client-Secret
          in: header
          required: true
          schema:
            type: string
            description: Client Secret provided by Cashfree.
            example: qwer9876
        - name: subReferenceId
          in: path
          required: true
          schema:
            type: integer
            description: The reference ID of the subscription to be cancelled.
            example: 2749411
      responses:
        '200':
          description: Successful cancellation of the subscription.
          content:
            application/json:
              examples:
                Cancel Subscription Success:
                  value:
                    status: OK
                    message: Subscription Cancelled
        '400':
          description: >-
            Bad request due to invalid parameters or missing required
            information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status of the API call.
                    example: ERROR
                  message:
                    type: string
                    description: Error message.
                    example: Invalid subscription reference ID
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status of the API call.
                    example: ERROR
                  message:
                    type: string
                    description: Error message.
                    example: Server encountered an unexpected condition.

````