Happening now | Office Hours: Customizing Your Theme With Moeed | Ask your questions now!

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

Solved

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

theDude71
Shopify Partner
2 0 1

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?

Accepted Solution (1)

SealSubs-Roan
Astronaut
938 70 90

This is an accepted solution.

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.

Roan
Please let me know if it works by marking it as a solution!
Seal Subscriptions App, a subscription app for Shopify, with glowing user testimonials and a free plan.

View solution in original post

Reply 1 (1)

SealSubs-Roan
Astronaut
938 70 90

This is an accepted solution.

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.

Roan
Please let me know if it works by marking it as a solution!
Seal Subscriptions App, a subscription app for Shopify, with glowing user testimonials and a free plan.