App reviews, troubleshooting, and recommendations
I was reading through the following article: https://shopify.dev/apps/billing/subscriptions/annual
and found the following information:
"You can use the appSubscriptionCreate mutation to create an annual subscription. You can specify the details of the plan by using the appRecurringPricingDetails field on the line item's plan. Provide the name, price, interval, and returnUrl. The returnUrl is where the merchant is redirected after accepting the subscription charge. This URL needs to include the charge ID."
What is the charge ID in the returnUrl (specified in the last line above)?
Additionally, how do I use the response from the Billing API?
Should fields such as confirmationUrl and appSubscription (from the response) be used somewhere?
Hi,
When you will subscribe it, shopify will return you a chargeID that you can use further.
I just went down this rabbit hole myself.
The charge ID is the ID that is assigned to a Charge on creation. Shopify refers to these as Charges when dealing with the Admin REST API, however, they are referred to as AppSubscriptions in the GraphQL API... just because. The data you get from either API is also slightly different, but the IDs are definitely the same.
I imagine the ID is passed back on the return URL so that you can use it again in any subsequent API request which requires the ID to be passed along with it. You could fetch the resource object and then show the plan name or number of trial days left to your user for example. I'm sure there are other use-cases that aren't clearly documented.
The confirmation URL is provided so that you can redirect the user to the charge authorisation page, which upon confirmation, will then redirect to the return URL (your app).
So:
Hope that helps.
Hey,
How can we access charge id? When I use custom route in return URL, it is giving missing Authorization header error. However it's working if i give only cloudfare URL without URL.
Kindly assist
Girish | Shopify Expert
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- My Shopify Apps: App Store | Looking for a solution to a problem in your store? Send me an email
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025