Managed pricing: planHandle is null

We recently started using the “planHandle” of the subscription object to detect the store’s active plan when using managed pricing. However, we’ve found that some subscriptions have “planHandle“ as “null”.

Here’s the query:


query Subscriptions {
    currentAppInstallation {
        activeSubscriptions {
            id
            currentPeriodEnd
            name
             lineItems {
                    plan {
                        pricingDetails {
                            ... on AppRecurringPricing {
                                price {
                                    amount
                                    currencyCode

                                }

                                planHandle
                                interval
                            }
                            
                        }
                    }
                }
        }    
    }
}

And the result:

{
    "data": {
        "currentAppInstallation": {
            "activeSubscriptions": [
                {
                    "id": "gid://shopify/AppSubscription/XXXX",
                    "currentPeriodEnd": "2026-04-16T14:26:19Z",
                    "name": "Basic",
                    "lineItems": [
                        {
                            "plan": {
                                "pricingDetails": {
                                    "price": {
                                        "amount": "9.0",
                                        "currencyCode": "USD"
                                    },
                                    "planHandle": null,
                                    "interval": "EVERY_30_DAYS"
                                }
                            }
                        }
                    ]
                }
            ]
        }
    },
}

Since the beginning the app was using the managed pricing so this subscription should have the “planHandle“ as “basic“.

According to the planHandle changelog:

All existing plans have been updated with a planHandle value based on their plan name.

but it doesn’t seem like the subscription received a plan handle.

Is there a way to update “planHandle“ field to have a non-null value and according to the plan name?

Thanks.

Hey @Dmitri_Pavlutin, the planHandle does look to be nullable, however as you’ve shared the changelog mentions it should have been updated. I’ll look in to this and report back what I find.

@Dmitri_Pavlutin As far as I know, only subscriptions created through managed pricing have planHandle. Maybe this subscription was created with the Billing API prior to switching to Managed Pricing?

@muchisx The app always used managed pricing.

Hey @Dmitri_Pavlutin, I dug into this and found the root cause. The planHandle field returns null when the original pricing plan tied to a subscription has been deleted.

For context, when we rolled out planHandle, all existing plans were updated. However, that update needed the plan to still exist to associate the handle. If a plan was deleted before that happened, any subscriptions created under it have no plan to reference, so planHandle stays null. New subscriptions created under an active plan will have the field populated correctly so this only affects legacy charges tied to a plan that no longer exists.

Thank you @KyleG-Shopify . That might be the issue. Using the subscription name slug if the original plan didn’t exist can be a good workaround to avoid creating null planHandle.