Creating Webhook Subscriptions using fmEcommerce Link
We added support for creating webhook subscriptions using the Shopify API in v1.5.11 of fmEcommerce Link (Shopify Edition). This is an alternative to using the Shopify store admin > Notifications screen to create these.
One advantage to creating a webhook within the fmEcommerce Link file relates to the warning emails that Shopify sends when there have been 19 consecutive failures for a webhook. Shopify sends an email to the app's emergency developer email address alerting them that the subscription will be deleted. This warning email is sent only when the webhook is created by an app from the Shopify App Store or by a private app such as fmEcommerce Link (Shopify Edition). The email is not sent for webhooks set up in the Webhooks section of the Notifications screen
To create a new webhook subscription via the Shopify API using v1.5.11 or later of fmEcommerce Link (Shopify Edition):
- navigate to the Webhooks Form layout and create a new record
- select a Topic from the drop down list (e.g. orders/create). N.B. we supply PHP files for the following topics: orders/create, orders/updated and orders/cancelled
- the format should be left as JSON unless you are implementing your own custom webhook that uses XML instead of JSON
- enter the URL for the webhook in the Address field
- click the Push to Shopify - Current Record button to create a new webhook subscription in Shopify.
- If this was successfully the Shopify IP for the webhook subscription will be stored in the Shopify ID field, otherwise you will get an error with details on why your upload request failed.
Here's a screenshot showing a webhook subscription that was successfully uploaded to Shopify:
You can also updating the webhook from Shopify by clicking the Update Webhook from Shopify button, as well as delete the webhook in Shopify by clicking the Delete Webhook in Shopify button. To download all webhook subscriptions created via the Shopify API (not using the Shopify Admin screen) go to the Setup page and click the Import All Webhooks button:
Please see our Webhooks Guide for further information on setting up the supplied PHP files for the FileMaker Data API or the PHP API.