Skip to main content
Cancels an active subscription, either immediately or at the end of the billing period.

Mutation

mutation CancelSubscription($input: SubscriptionCancellationInput!) {
  cancelSubscription(input: $input) {
    subscriptionId
    status
    cancellationDate
    endDate
  }
}

Parameters

input
SubscriptionCancellationInput
required
Input for canceling a subscription

Cancellation Strategies

StrategyBehavior
IMMEDIATECancel immediately, entitlements revoked
END_OF_BILLING_PERIODCancel at period end, entitlements continue until then

Cancel Reasons

ReasonDescription
CUSTOMER_REQUESTCustomer requested cancellation
PAYMENT_FAILUREPayment could not be collected
UPGRADECanceling to upgrade
DOWNGRADECanceling to downgrade
OTHEROther reason

Return Type

Returns the canceled CustomerSubscription object with:
FieldTypeDescription
subscriptionIdStringSubscription ID
statusSubscriptionStatusNew status (CANCELED)
cancellationDateDateTimeWhen cancellation was requested
endDateDateTimeWhen subscription ends

Examples

Immediate Cancellation

{
  "input": {
    "subscriptionId": "sub-789",
    "cancellationStrategy": "IMMEDIATE",
    "cancelReason": "CUSTOMER_REQUEST"
  }
}

Cancel at Period End

{
  "input": {
    "subscriptionId": "sub-789",
    "cancellationStrategy": "END_OF_BILLING_PERIOD"
  }
}

Common Use Cases

Cancel when customer explicitly requests cancellation.
Cancel after failed payment recovery attempts.
Cancel as part of account deletion process.