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

Topic summary

A developer is trying to retrieve the Subscription ID associated with recurring app charges through Shopify’s API. While Subscription IDs are visible in Shopify’s admin interface when viewing charges, they are not included in the API response.

Current limitation:

  • The Recurring Application Charge API does not return Subscription IDs
  • No API endpoint exists to retrieve both charge and subscription data together

Suggested workaround:

  • Manually track and store the Subscription ID when the charge is first created
  • Maintain this mapping in your own database, as there’s no way to retrieve it via API later

Status: The issue remains unresolved from an API perspective. The developer has consulted the Admin REST API and Partner API documentation but found no solution for accessing this data programmatically.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

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