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

# Cancel subscription

> Cancels an subscription.
You can provide a reason for cancellation in the request body. If no reason is provided, a default reason will be used: "User requested cancellation".
If a subscription has been deleted or already canceled, a corresponding error will be returned. Supported PSPs:  - Stripe - Paddle - Solidgate - Paypal - FunnelFox Billing




## OpenAPI

````yaml /swagger/openapi.json post /subscriptions/{id}/cancel
openapi: 3.0.0
info:
  title: Public API
  version: 1.0.0
servers:
  - url: https://api.funnelfox.io/public/v1
security: []
paths:
  /subscriptions/{id}/cancel:
    post:
      summary: Cancel subscription
      description: >
        Cancels an subscription.

        You can provide a reason for cancellation in the request body. If no
        reason is provided, a default reason will be used: "User requested
        cancellation".

        If a subscription has been deleted or already canceled, a corresponding
        error will be returned. Supported PSPs:  - Stripe - Paddle - Solidgate -
        Paypal - FunnelFox Billing
      operationId: SubscriptionCancel
      parameters:
        - in: header
          name: Fox-Secret
          required: true
          description: Project Secret Key
          schema:
            type: string
            example: secret_
        - in: path
          name: id
          required: true
          description: Subscription ID
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
                  description: Cancellation reason
      responses:
        '200':
          description: subscription cancelled successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - psp_id
                  - status
                  - profile
                  - funnel
                  - funnel_version
                  - billing_interval
                  - billing_interval_count
                  - price
                  - currency
                  - price_usd
                  - payment_provider
                  - created_at
                  - updated_at
                  - period_starts_at
                  - renews
                  - sandbox
                  - session
                properties:
                  id:
                    type: string
                    x-go-name: ID
                  psp_id:
                    type: string
                    x-go-name: PSPID
                  status:
                    type: string
                    enum:
                      - created
                      - trialing
                      - active
                      - paused
                      - cancelled
                      - expired
                      - unpaid
                  profile:
                    type: object
                    required:
                      - id
                      - created_at
                    properties:
                      id:
                        type: string
                        x-go-name: ID
                      email:
                        type: string
                      created_at:
                        type: string
                        format: date-time
                      preview:
                        type: boolean
                  funnel:
                    type: object
                    required:
                      - id
                      - title
                      - alias
                      - type
                    properties:
                      id:
                        type: string
                        x-go-name: ID
                      title:
                        type: string
                      alias:
                        type: string
                        description: Alias/slug for the funnel
                      type:
                        type: string
                        enum:
                          - default
                          - cancellation
                          - retargeting
                  funnel_version:
                    type: integer
                  funnel_locale:
                    type: string
                  experiment:
                    type: object
                    required:
                      - id
                      - title
                      - alias
                      - enabled
                    properties:
                      id:
                        type: string
                        x-go-name: ID
                      title:
                        type: string
                      alias:
                        type: string
                      enabled:
                        type: boolean
                  session:
                    type: object
                    required:
                      - id
                      - created_at
                    properties:
                      id:
                        type: string
                        x-go-name: ID
                      created_at:
                        type: string
                        format: date-time
                      locale:
                        type: string
                      user_agent:
                        type: string
                  product_id:
                    type: string
                    x-go-name: ProductID
                  product:
                    type: object
                    required:
                      - id
                      - name
                      - status
                    properties:
                      id:
                        type: string
                        x-go-name: ID
                      name:
                        type: string
                      status:
                        type: string
                        enum:
                          - active
                          - archived
                  price:
                    type: integer
                    description: Monetary amount in cents (e.g., $1.00 = 100 cents)
                    example: 100
                  currency:
                    type: string
                  price_usd:
                    x-go-name: PriceUSD
                    type: integer
                    description: Monetary amount in cents (e.g., $1.00 = 100 cents)
                    example: 100
                  billing_interval:
                    type: string
                    enum:
                      - day
                      - week
                      - month
                      - year
                  billing_interval_count:
                    type: integer
                  trial_offer:
                    type: string
                    enum:
                      - free
                      - paid
                  trial_transaction_id:
                    type: string
                    x-go-name: TrialTransactionID
                  payment_provider:
                    type: string
                    enum:
                      - stripe
                      - paddle
                      - paypal
                      - braintree
                      - solidgate
                  renews:
                    type: boolean
                  sandbox:
                    type: boolean
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
                  period_starts_at:
                    type: string
                    format: date-time
                  period_ends_at:
                    type: string
                    format: date-time
                  paused_at:
                    type: string
                    format: date-time
                  cancelled_at:
                    type: string
                    format: date-time
                  cancellation_reason:
                    type: string
                  renewed_at:
                    type: string
                    format: date-time
                  upgrades_to:
                    type: string
                  custom_entitlement:
                    type: string
        '400':
          description: Request error
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '404':
          description: Subscription not found
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string

````