Skip to main content

App subscription cancel

API version

The appSubscriptionCancel mutation is available in Partner API version 2026-07 and later.

Use appSubscriptionCancel to cancel a Shopify App Pricing subscription for a specific shop. The mutation cancels the active subscription between a public app and a shop, and returns the cancelled subscription details.

appSubscriptionCancel is a root mutation on the Partner API and takes required appId, shopId, and cancellation option arguments:

appSubscriptionCancel(
appId: ID!
shopId: ID!
prorate: Boolean!
skipFinalUsageCharge: Boolean!
deferCancellation: Boolean!
): AppSubscriptionCancelPayload

  • The API client must have the View financials permission. See Create a Partner API client.
  • The app must be a public app owned by the authenticated partner organization. Custom and private apps aren't supported.
  • The shop must have an active Shopify App Pricing subscription for the app.
  • appId and shopId must use Shopify global IDs, for example gid://shopify/App/1234 and gid://shopify/Shop/5678.

Anchor to Cancellation optionsCancellation options

All cancellation option arguments are required.

ArgumentDescription
prorateWhether to issue prorated credits for the unused portion of the subscription. Can't be used with skipFinalUsageCharge or deferCancellation.
skipFinalUsageChargeWhether to skip the final usage charge when cancelling. Only applies to usage-billed subscriptions. Can't be used with prorate.
deferCancellationWhether to defer cancellation until the end of the current billing cycle. Can't be used with prorate.

For immediate cancellation without proration or skipping usage charges, pass false for all three options. For cancellation at the end of the current billing cycle, pass deferCancellation: true, prorate: false, and skipFinalUsageCharge: false.


Cancel app subscription

mutation CancelAppSubscription(
$appId: ID!
$shopId: ID!
$prorate: Boolean!
$skipFinalUsageCharge: Boolean!
$deferCancellation: Boolean!
) {
appSubscriptionCancel(
appId: $appId
shopId: $shopId
prorate: $prorate
skipFinalUsageCharge: $skipFinalUsageCharge
deferCancellation: $deferCancellation
) {
appSubscription {
cancelledAt
legacySubscriptionId
billingPeriod
cancelAtEndOfCycle
app {
id
name
apiKey
}
shop {
id
myshopifyDomain
}
items {
handle
description
price {
__typename
currency
... on FlatRatePrice {
amount
}
... on TieredPrice {
tiersMode
tiers {
upTo
amountPerUnit
amount
}
}
}
}
}
userErrors {
field
message
}
}
}
{
"appId": "gid://shopify/App/1234",
"shopId": "gid://shopify/Shop/5678",
"prorate": false,
"skipFinalUsageCharge": false,
"deferCancellation": false
}
{
"data": {
"appSubscriptionCancel": {
"appSubscription": {
"cancelledAt": "2026-05-01T12:00:00Z",
"legacySubscriptionId": null,
"billingPeriod": "EVERY_30_DAYS",
"cancelAtEndOfCycle": false,
"app": {
"id": "gid://shopify/App/1234",
"name": "Example app",
"apiKey": "example-api-key"
},
"shop": {
"id": "gid://shopify/Shop/5678",
"myshopifyDomain": "example.myshopify.com"
},
"items": [
{
"handle": "pro_plan",
"description": "Pro plan",
"price": {
"__typename": "FlatRatePrice",
"currency": "USD",
"amount": "29.00"
}
}
]
},
"userErrors": []
}
}
}

Anchor to Deferred cancellationsDeferred cancellations

When deferCancellation is true, the subscription is scheduled to cancel at the end of the current billing cycle. In this case, cancelledAt is null and cancelAtEndOfCycle is true in the response.

{
"appSubscription": {
"cancelledAt": null,
"cancelAtEndOfCycle": true
},
"userErrors": []
}

Anchor to Legacy subscription IDsLegacy subscription IDs

legacySubscriptionId returns the GraphQL Admin API AppSubscription GID for subscriptions that were created using the Billing API and migrated to Shopify App Pricing. For subscriptions created natively in Shopify App Pricing, this field is null.

You don't need to provide a legacy subscription ID to cancel a subscription. Use appId and shopId to identify the subscription to cancel.


The mutation returns validation and cancellation errors in userErrors.

ConditionBehavior
prorate and skipFinalUsageCharge are both trueReturns a user error: `prorate` and `skipFinalUsageCharge` cannot both be true.
prorate and deferCancellation are both trueReturns a user error: `prorate` and `deferCancellation` cannot both be true.
App isn't owned by the authenticated organizationReturns a user error: App is not owned by this organization
App isn't a public appReturns a user error: Only public apps can use the app subscription cancel mutation
Shop not foundReturns a user error: Shop not found
No active subscription for the app and shopReturns a user error: No active billing contract found for this app subscription. It may already be cancelled or ended.

Was this page helpful?