yadivyanshu / magento2-order-webhook
Magento 2 module that sends order events to a configurable webhook endpoint. Test package for Packagist deployment pipeline.
Package info
github.com/yadivyanshu1/magento2-order-webhook
Type:magento2-module
pkg:composer/yadivyanshu/magento2-order-webhook
Requires
- php: >=8.1
- magento/framework: >=103.0
- magento/module-backend: >=102.0
- magento/module-config: >=101.0
- magento/module-sales: >=103.0
- magento/module-store: >=101.0
README
A Magento 2 module that sends order events to a configurable HTTPS webhook endpoint with Bearer token authentication. Useful for piping order data into external automation platforms (WhatsApp, Slack, email, CRM, etc.).
Status: Test package for Packagist deployment pipeline validation. Not intended for production use yet.
Features
- Fires on
sales_order_place_after(order created) - Payload includes order, customer, items, billing/shipping addresses
- Admin config UI (Stores → Configuration → Yadivyanshu → Order Webhook)
- API key stored encrypted in Magento config
- Handshake verification on save — visual "Connected / Failed / Not Connected" status
- Never blocks checkout on webhook failure (errors are logged, not thrown)
Requirements
- Magento 2.4.4+
- PHP 8.1+
Installation
composer require yadivyanshu/magento2-order-webhook bin/magento module:enable Yadivyanshu_OrderWebhook bin/magento setup:upgrade bin/magento cache:flush
Configuration
- Log in to Magento admin
- Go to Stores → Configuration → Yadivyanshu → Order Webhook
- Fill in:
- Enable Module: Yes
- API Base URL: your webhook platform base URL (no trailing slash)
- API Key: the bearer token your platform expects
- Click Save Config
- Confirm the status badge turns green (Connected ✓)
API Contract
The module expects your backend to expose two endpoints:
POST {base_url}/public/magento/verify-store
Called on admin config save. Request:
{
"platform": "magento",
"store_url": "https://example.com/",
"store_code": "default",
"store_name": "Main Website Store",
"store_id": 1
}
Return 2xx to mark the connection as verified.
POST {base_url}/public/magento/webhooks/order
Called on every order placed. Includes full order payload. Return 2xx to acknowledge.
Both endpoints receive Authorization: Bearer <api_key> header.
License
MIT