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

# Cancel subscription schedule

> Use when cancelling a scheduled change (e.g. customer changed mind). Identify by schedule ID in path or by subscription ID + schedule type in body.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/subscriptions/schedules/{schedule_id}/cancel
openapi: 3.0.1
info:
  title: Flexprice API
  description: Flexprice API Service
  contact:
    name: API Support
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1.0'
servers:
  - url: https://us.api.flexprice.io/v1
    description: US Region
  - url: https://api.cloud.flexprice.io/v1
    description: India Region
security: []
paths:
  /v1/subscriptions/schedules/{schedule_id}/cancel:
    post:
      tags:
        - Subscriptions
      summary: Cancel subscription schedule
      description: >-
        Use when cancelling a scheduled change (e.g. customer changed mind).
        Identify by schedule ID in path or by subscription ID + schedule type in
        body.
      operationId: cancelSubscriptionSchedule
      parameters:
        - name: schedule_id
          in: path
          description: Schedule ID (optional if using request body)
          required: true
          schema:
            type: string
      requestBody:
        description: Cancel request (optional if using path parameter)
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelScheduleRequest'
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelScheduleResponse'
components:
  schemas:
    CancelScheduleRequest:
      type: object
      properties:
        schedule_id:
          type: string
          description: >-
            schedule_id is the ID of the schedule to cancel (optional if
            subscription_id and schedule_type are provided)
        schedule_type:
          $ref: '#/components/schemas/types.SubscriptionScheduleChangeType'
        subscription_id:
          type: string
          description: >-
            subscription_id is the ID of the subscription (required if
            schedule_id is not provided)
      description: Request to cancel a subscription schedule (supports two modes)
    CancelScheduleResponse:
      type: object
      properties:
        message:
          type: string
          description: message is a confirmation message
        status:
          $ref: '#/components/schemas/types.ScheduleStatus'
      description: Confirmation of schedule cancellation
    types.SubscriptionScheduleChangeType:
      type: string
      enum:
        - plan_change
        - cancellation
      x-enum-varnames:
        - SubscriptionScheduleChangeTypePlanChange
        - SubscriptionScheduleChangeTypeCancellation
      x-speakeasy-name-override: SubscriptionScheduleChangeType
    types.ScheduleStatus:
      type: string
      enum:
        - pending
        - executing
        - executed
        - cancelled
        - failed
      x-enum-varnames:
        - ScheduleStatusPending
        - ScheduleStatusExecuting
        - ScheduleStatusExecuted
        - ScheduleStatusCancelled
        - ScheduleStatusFailed
      x-speakeasy-name-override: ScheduleStatus

````