yadivyanshu/magento2-order-webhook

Magento 2 module that sends order events to a configurable webhook endpoint. Test package for Packagist deployment pipeline.

Maintainers

Package info

github.com/yadivyanshu1/magento2-order-webhook

Type:magento2-module

pkg:composer/yadivyanshu/magento2-order-webhook

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.1 2026-04-11 09:56 UTC

This package is auto-updated.

Last update: 2026-05-11 10:12:24 UTC


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

  1. Log in to Magento admin
  2. Go to Stores → Configuration → Yadivyanshu → Order Webhook
  3. Fill in:
    • Enable Module: Yes
    • API Base URL: your webhook platform base URL (no trailing slash)
    • API Key: the bearer token your platform expects
  4. Click Save Config
  5. 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