Last updated
Last updated
You can setup webhooks by registering the route in the RouteServiceProvider
just below the route groups that pull in the routes/api
and routes/web
files:
This gives you a new endpoint in your application: shopify/webhooks
. All webhooks sent to this endpoint will trigger an event, which you can listen to in your EventServiceProvider
:
All events use the following convention:
The listener might look like this:
In terms of verifying webhooks it happens automatically. It retrieves the webhook secret from the config by default, but you can define your own SecretProvider
and replace the one in config/shopify
in case you want to retrieve it from the database or somewhere else.
Please use the webhook secret from Settings > Notifications
in Shopify admin. You have to create the webhook before it creates the secret.
Configure webhooks to notify your application, whenever a something happens in Shopify.