> ## 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.

# Activate Subscription

> Use this API to activate a subscription that is in ONHOLD state. For periodic subscriptions, the next charge date is calculated for the next cycle.



## OpenAPI

````yaml post /api/v2/subscriptions/{subReferenceId}/activate
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}/activate:
    post:
      tags:
        - Subscription
      summary: Activate Subscription
      description: >-
        Use this API to activate a subscription that is in ONHOLD state. For
        periodic subscriptions, the next charge date is calculated for the next
        cycle.
      operationId: activateSubscription
      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 activated.
            example: 2646214
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nextScheduledOn:
                  type: string
                  format: date
                  description: The next scheduled date for the subscription activation.
                  example: '2021-12-17'
      responses:
        '200':
          description: Successful activation of the subscription.
          content:
            application/json:
              examples:
                Activate Subscription Success:
                  value:
                    status: OK
                    subStatus: ACTIVE
                    subscriptionResponse:
                      subReferenceId: 123456
                      subscriptionId: testabcd
                      planId: test_demo
                      customerPhone: '9876543210'
                      customerName: John Doe
                      customerEmail: abc@gmail.com
                      addedOn: '2021-02-24 11:15:10'
        '400':
          description: Bad request due to invalid parameters or subscription state.
          content:
            application/json:
              examples:
                Missing Next Scheduled Date:
                  value:
                    status: ERROR
                    subCode: '400'
                    message: nextScheduledOn is mandatory for activation.
                Invalid Subscription State:
                  value:
                    status: ERROR
                    subCode: '400'
                    message: Subscription cannot be activated due to its current state.
        '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.

````