ShopMagic Webhooks
ShopMagic Webhooks – Documentation
ShopMagic Webhooks is an extension for the ShopMagic plugin that allows you to trigger webhooks as part of your automation actions. This enables easy integration between WooCommerce and external systems or apps by sending real-time data related to orders and customers.
What are Webhooks?
A webhook is a way to transfer data from one application to another, triggered immediately when a specific event happens. In the case of ShopMagic, webhooks are triggered automatically when an event occurs in WooCommerce (such as a new order), allowing smooth integration with other systems.
New Action Type: Call Webhook
ShopMagic Webhooks introduces a new action type – Call Webhook – that allows sending data to a custom endpoint.
Fields available in the Call Webhook action:
Description
Webhook description, which you can set up only for your purpose.
Webhook URL (required)
The address to which the data will be sent. This field is required.
Payload Key-Value Pairs
You can add custom Payload Key-Value Pairs . Enter each payload on a new line using the
Key: Value
format.Request Body
The content to be sent, typically in JSON format. You can use ShopMagic placeholders to dynamically include WooCommerce data.
Example request body:
{ "order_id": "{{ order.id }}", "total": "{{ order.total }}", "email": "{{ customer.email }}" }
How Does It Work?
The extension automatically registers the new Call Webhook action when the plugin is activated. It uses ShopMagic’s filters and hooks to ensure compatibility with other features.
Inside CallWebhook.php
, the logic handles:
- Displaying the action form in the admin panel
- Parsing placeholders in the request body
- Handling errors (e.g., invalid URL or server not responding)
- Sending the data to the specified URL
Placeholders
Webhooks support all placeholders available in ShopMagic, which means you can include dynamic data such as:
{{ customer.name }}
{{ order.id }}
{{ order.total }}
and many others.
A full list of available placeholders can be found here →.
Example Automation with Webhook
Here's an example automation for sending order data to your ERP system:
- Event: New Order
- Action: Call Webhook
- URL:
https://example.com/api/order
- Request body:
- URL:
{ "id": "{{ order.id }}", "status": "{{ order.status }}", "customer_email": "{{ customer.email }}" }
Technical Notes
- Webhooks are sent as HTTP POST requests with the
Content-Type: application/json
header. - The plugin does not validate server responses but logs any errors for debugging.
- Fully compatible with the free version of ShopMagic.
- Some placeholders may require the PRO version.
FAQ
Can I send data to multiple endpoints?
Yes, simply add multiple Call Webhook actions within a single automation, each with a different URL.
Can I use webhooks to sync data with my CRM?
Absolutely! If your CRM supports REST API endpoints, you can integrate it with WooCommerce using this plugin.
Are methods other than POST supported?
Currently, only POST is supported. Support for GET, PUT, and DELETE is planned for future releases.
How to Get Started?
- Install and activate ShopMagic for WooCommerce plugin.
- Minimal version required is 4.5.0
- Install and activate the ShopMagic Webhooks plugin.
- Go to ShopMagic → Automations.
- Create a new automation and select an event.
- Choose the “Call Webhook” action.
- Configure the URL, request body, and optional headers.
- Save the automation. Done!