Shopify billing api subs cancellation

isn’t there a way to receive billing subs cancellation updates exactly when cancellation happens i.e. when billing period ends? for non-prorated subs cancellations? Also, after prorate:false cancellation the subs disappears from the activeSubscription gql query

Hey again @Jaspreet_Singh - great questions here as always!

For getting notified about subscription status changes, you can subscribe to the APP_SUBSCRIPTIONS_UPDATE webhook topic, which fires when a subscription status changes. The docs on that are here: Combine time and usage-based subscriptions

The challenge though with non-prorated cancellations (prorate: false) is that the subscription status moves to CANCELLED immediately when the cancellation happens, not at the end of the billing period. So the webhook fires right away at cancellation time rather than when the paid period actually ends.

On the activeSubscriptions behaviour you’re seeing, that’s expected but I definitely get that it’s not ideal. Once the status flips to CANCELLED, it drops out of activeSubscriptions. One thing worth knowing is that you can use allSubscriptions on currentAppInstallation instead, which will still return cancelled subscriptions:

currentPeriodEnd returns null for non-active subscriptions, so if you need to know when the billing period actually ends after a non-prorated cancellation, you’d need to be caching that value beforehand. More on the AppSubscription object and its fields here: AppSubscription - GraphQL Admin

Just to better understand your use case, could you share a bit more about what you’re trying to do? Specifically:

  1. Are you trying to continue providing access to app features until the billing period ends and need a way to know when to cut off access?
  2. Is this something you’re triggering via appSubscriptionCancel yourself, or is this happening when merchants uninstall?

That would help me understand if there’s a better pattern for what you’re trying to accomplish, or if this is something I should log as a feature request. Hope to hear from you soon!

Thank you, @Alan_G .

  1. Yes
  2. This happens when we cancel via billing.cancel()