how to get the subscription id related to an app recurring charge?

We have a Shopify app that clients pay recurring charges for. In Shopify when looking at those charges, they are associated with a Subscription id, but when trying to get the charge information via API, the Subscription Id is not available.

How can we get both the charge data and the subscription it’s associated with?

We have been looking at these documentation pages, but didn’t find it:

https://shopify.dev/docs/api/admin-rest/2025-04/resources/recurringapplicationcharge

https://shopify.dev/docs/api/partner/latest/objects/AppSubscriptionSale

Is it not possible?

Currently Shopify Billing API response for the recurring application charges doesn’t directly contains Subscription ID in some way. When you first create that subscription you will have to go and track down the Subscription ID on your end, as there is no way via the API to call it later when linking any charges to a subscription you will need to save it yourself. There is not an API endpoint for both charge and subscription data as of now. You should log this when you create the charge to keep the connection.

1 Like