Our one app has monthly recurring charges REST API in it. Now I am moving forward with adding an annual API which is only provided by GRAPHQL Create time-based subscriptions
My basic question is, Is there any API that returns the current plan of the merchant? I mean any API can provide the currently active plan so we can rely on that while checking that the merchant had paid or not?
Thanks for your response. I am aware of this API that it returns all the charge of the particular store. If I rely on the last item of data and check the status is “active” or not then it works fine, But the issue is if a user has paid for the standard plan today and on the very next day he opens up the Shopify payment page for my premium plan and cancel it or leave It unpaid the very first data returns via this API is “Cancelled” or “Pending” as that is the recent activity of this store/user.
This is how the latest status of this API is not helpful for me.
Could you please suggest a workaround for this?
Thanks a lot.
Workaround here is like this. Set up a cron job(hourly/every 30 minutes or so) that checks recurring charges status for all clients, if for some particular client, there is no active recurring charge, disable your app services for this particular client.
In your database, mark this store as disabled. The next time he tries to access your app, check the disabled status, redirect him to the subscription URL. / OR whenever this particular store admin tries to load your app, check his recurring charge status and redirect him to payment/subscription URL.
Thank you for your reply. My concern is that this API update the latest status “cancelled” if the client cancels the payment for that particular moment and show the status “pending” if the client left without being paid. But my question is the latest charge is updated as “cancelled” but suppose he has done the payment yesterday for “standard plan”, Today he just came on the payment page to see “premium plan” stuff and left without being paid.
I am using the latest status of this recurring charges API, This is how the API only returns the latest activity, Not the real status of that client’s payment.
I am sorry if this is confusing Hope you understand my concern.