Magento 2 module
Webhook module for Magento 2
A Magento 2 module that pushes product, category, customer, order and invoice events to external webhook endpoints.
View on GitHubWhat it is
Beehexa_Webhook pushes Magento events to external webhook endpoints, so another system learns about a change as soon as it happens in the store.
The outgoing payload is built by a message builder. It carries the entity type, the entity ID and the event name (new, update or delete). To avoid sending the same event twice in one request, the module keeps a registry keyed by customer email for customers and by entity ID for everything else.
What it does
- Product: save and delete.
- Category: save and delete.
- Customer: save and delete.
- Order: create and update.
- Invoice: save.
- Endpoint providers: default, hexasync and slack.
- Requests are signed with a token you set, stored encrypted.
- Writes a log to var/log/beehexa_webhook.log.
Requirements
- PHP 7.0, 8.0 or 8.1
- magento/framework 102 or newer
- beehexa/webhook-php and beehexacorp/magento-base, which Composer installs for you
Install
Composer
composer require beehexacorp/module-webhook
php bin/magento module:enable Beehexa_Webhook
php bin/magento setup:upgrade
php bin/magento cache:flush
Configure and use
In the Magento admin, go to Stores > Configuration > Beehexa > Webhook Integration. The fields are:
- Enable: turns the webhook integration on or off. It is off by default.
- Endpoint provider: default, hexasync or slack. The default is hexasync.
- Hook endpoint: the URL that receives the events.
- API token: the secret used to sign requests, stored encrypted.
Good to know
- If the provider or the endpoint is not set, the module throws an exception when it publishes.
- To test it: enable the module, enter the provider, endpoint and token, save the configuration, update a product or an order, then check your receiver and the log file.
Related
Adapt to what you know, customize every flow, extend as you grow. Start with HexaSync