App subscription cancel
The appSubscriptionCancel mutation is available in Partner API version 2026-07 and later.
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:
Anchor to Access requirementsAccess requirements
- 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.
appIdandshopIdmust use Shopify global IDs, for examplegid://shopify/App/1234andgid://shopify/Shop/5678.
Anchor to Cancellation optionsCancellation options
All cancellation option arguments are required.
| Argument | Description |
|---|---|
prorate | Whether to issue prorated credits for the unused portion of the subscription. Can't be used with skipFinalUsageCharge or deferCancellation. |
skipFinalUsageCharge | Whether to skip the final usage charge when cancelling. Only applies to usage-billed subscriptions. Can't be used with prorate. |
deferCancellation | Whether 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.
Anchor to ExampleExample
Cancel app subscription
Mutation
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
}
}
}Variables
{
"appId": "gid://shopify/App/1234",
"shopId": "gid://shopify/Shop/5678",
"prorate": false,
"skipFinalUsageCharge": false,
"deferCancellation": false
}Response
{
"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.
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.
Anchor to Error handlingError handling
The mutation returns validation and cancellation errors in userErrors.
| Condition | Behavior |
|---|---|
prorate and skipFinalUsageCharge are both true | Returns a user error: `prorate` and `skipFinalUsageCharge` cannot both be true. |
prorate and deferCancellation are both true | Returns a user error: `prorate` and `deferCancellation` cannot both be true. |
| App isn't owned by the authenticated organization | Returns a user error: App is not owned by this organization |
| App isn't a public app | Returns a user error: Only public apps can use the app subscription cancel mutation |
| Shop not found | Returns a user error: Shop not found |
| No active subscription for the app and shop | Returns a user error: No active billing contract found for this app subscription. It may already be cancelled or ended. |