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

# Cancel Subscription

> Cancels one or more subscription renewals. Each entry in `cancelRequests` identifies a Purchase Activity to cancel and the type of cancellation to apply. Internally fires the `CancelSubscription` Service Layer event.



## OpenAPI

````yaml POST /v1/subscription/cancel
openapi: 3.0.3
info:
  title: fusionCore REST API
  version: 1.0.0
  description: >-
    External integration endpoints for the fusionCore unmanaged REST API
    package. Provides HTTP access to order creation, order item management,
    renewal generation, and subscription cancellation, all running as Salesforce
    Apex REST resources.
servers:
  - url: https://{instance}.my.salesforce.com/services/apexrest
    description: Salesforce org Apex REST endpoint
    variables:
      instance:
        default: your-instance
        description: >-
          Your Salesforce org's My Domain prefix (for example, acme-dev or
          acme.sandbox).
security:
  - bearerAuth: []
tags:
  - name: Order
    description: Order creation.
  - name: Order Item
    description: Order item creation and deletion.
  - name: Order Renewal
    description: Generate renewal orders from existing purchase activities.
  - name: Subscription Cancellation
    description: Cancel subscription renewals.
paths:
  /v1/subscription/cancel:
    post:
      tags:
        - Subscription Cancellation
      summary: Cancel subscription renewals
      description: >-
        Cancels one or more subscription renewals. Each entry in
        `cancelRequests` identifies a Purchase Activity to cancel and the type
        of cancellation to apply. Internally fires the `CancelSubscription`
        Service Layer event.
      operationId: cancelSubscription
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionCancelRequest'
            example:
              cancelRequests:
                - purchaseActivityId: a0B5g00000PA1AAA
                  cancellationType: Cancel Renewal
      responses:
        '200':
          description: Cancellation request accepted and dispatched to the Service Layer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse'
              example:
                success: true
        '400':
          description: >-
            Validation error (missing `cancelRequests`, missing
            `purchaseActivityId` or `cancellationType`, or unsupported
            `cancellationType`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    SubscriptionCancelRequest:
      type: object
      required:
        - cancelRequests
      properties:
        cancelRequests:
          type: array
          description: One entry per subscription to cancel.
          items:
            type: object
            required:
              - purchaseActivityId
              - cancellationType
            properties:
              purchaseActivityId:
                type: string
                description: >-
                  Salesforce Id of the Purchase Activity whose subscription
                  should be cancelled.
              cancellationType:
                type: string
                description: >-
                  Cancellation type to apply. Must be one of the values
                  configured in
                  `FS_FCAPIPurchaseActivityConstants.CANCELLATION_TYPES` (for
                  example, `Cancel Renewal`).
                example: Cancel Renewal
          minItems: 1
    BaseResponse:
      type: object
      description: >-
        Common envelope returned by every endpoint. Concrete responses extend
        this shape with operation-specific fields.
      properties:
        success:
          type: boolean
          description: '`true` when the request completed without errors.'
        errors:
          type: array
          description: Populated with one or more error messages when `success` is `false`.
          items:
            type: string
    ErrorResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
      example:
        success: false
        errors:
          - businessUnitId is required
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Salesforce Session ID
      description: >-
        Salesforce session ID (or OAuth 2.0 access token issued by the
        Salesforce org) supplied as `Authorization: Bearer <token>`. Obtain via
        the Salesforce OAuth 2.0 flows or the SOAP login API.

````