Hey 👋, we're trying to implement a subscription service via Shopify (payments are handled by Shopify) but we have run into some undocumented API issues. Maybe someone here has some experience with Shopify's recurring payments.
Is there a way to trigger recurring payment webhooks, just to test our endpoints?
By looking at the app_subscriptions/update documentation it's not clear from where expired status is coming from. Is it triggered when a recurring payment is initiated but not accepted within two days?
Is there a way to check (an GraphQL or REST endpoint) if the current or next cycle of recurring payment is paid? (Shopify charges the customer approx. every 30 days, so there's no guarantee if the customer has paid for the subscription or is avoiding the payment – we need to cancel the subscription on our end.)
What's the max days the customer can avoid Shopify payments?
I don't have any specific experience with recurring payments on Shopify but can provide a few pointers from general experience developing for Shopify.
> Is there a way to trigger recurring payment webhooks, just to test our endpoints?
Yes, you can use the Shopify CLI or manually by taking the actions in a test store (details).
> By looking at the app_subscriptions/update documentation it's not clear from where expired status is coming from. Is it triggered when a recurring payment is initiated but not accepted within two days?
I'm not sure what you mean by "triggered" in this context since it's a property of a RecurringApplicationCharge. Based on the docs I would expect a RecurringApplicationCharge to have that status if you created a charge on Day 1, the merchant didn't accept or decline the charge and you retrieve the charge on Day 3 or later.
As for the payment cycle questions I'm not sure I understand how that matters to your app. You should decide whether or not to cancel the subscription on your end or access to your app based on the "status" of the RecurringApplicationCharge. I would think that if status is any of "declined", "expired" or "frozen" you would consider that a lapsed subscription and stop allowing the user to use your app.
Thanks for your answer. As for the billing cycle – as known, Shopify charges the customer approx. every 30 days but we don't know how long can customer "dodge" the payment, thus we don't want to provide the service if the customer hasn't paid e.g. in more than 5 days.