Questions and discussions about using the Shopify CLI and Shopify-built libraries.
Hi,
I created a few pricing models for my app. When the user installs the app I create a recurring application charge with a default pricing plan. But what I don't understand is - if a user decides to change the plan from Basic to Advanced(or any other that I have), how to update this on the backend?
I mean do I need to set up some sort of webhook and listen to recurring pricing updates? I can't find that in the documentation.
So basic flow:
1. User installs the app
2. Created a basic plan for the user(free)
3. Then, the user decides to change the plan to Advanced
4. Shopify should notify me about this and I need to send a new recurring application change(and the user should accept it again)? or what? or update the pricing somehow?
Can someone point to me how it should be done?
Solved! Go to the solution
This is an accepted solution.
You can listen on shop/update webhook - https://help.shopify.com/en/api/reference/events/webhook - and match the plan_name field. If the plan_name is different from plan_name the customer was on at the installation time you'll have to delete the current recurring charge and create a new one. You'll then need to direct the customer to the charge acceptance URL (you can do that when your app loads in the admin) or send the link directly to the customer for approval.
This is an accepted solution.
You can listen on shop/update webhook - https://help.shopify.com/en/api/reference/events/webhook - and match the plan_name field. If the plan_name is different from plan_name the customer was on at the installation time you'll have to delete the current recurring charge and create a new one. You'll then need to direct the customer to the charge acceptance URL (you can do that when your app loads in the admin) or send the link directly to the customer for approval.