As the subject says, I need to be able to trigger a webhook when a subscription order is paid, failed or updated every month (or other interval). It looks like there’s no native way to do subscription orders so I’d have to use one of the subscription services mentioned in the shop, is there any way to do this via API or webhook?
Essentially, we want to be able to turn off a service that lives outside of Shopify if someone fails to pay their monthly bill. Any ideas?
Hello there
Yes, you can use webhooks to trigger an action when a subscription order is paid, failed, or updated. You can set up a webhook in your app or service to listen for the recurring_application_charge/paid
, recurring_application_charge/failed
, or recurring_application_charge/updated
event, depending on which event you want to trigger your webhook.
Here’s how you can set up a webhook for a recurring application charge:
-
Create a webhook in your app or service that listens for the recurring_application_charge/paid
, recurring_application_charge/failed
, or recurring_application_charge/updated
event.
-
In your Shopify partner dashboard, go to the “Apps” section and select your app.
-
Click on “Webhooks” in the left sidebar, and then click on the “Create webhook” button.
-
In the “Event” field, select the event you want to trigger your webhook (recurring_application_charge/paid
, recurring_application_charge/failed
, or recurring_application_charge/updated
).
-
In the “URL” field, enter the URL for your webhook.
-
Click on the “Save webhook” button.
Once you’ve set up the webhook, your app or service will receive a notification whenever a subscription order is paid, failed, or updated. You can then use the information in the webhook payload to turn off the service for customers who have failed to pay their monthly bill.