Documentation

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.
Action Call Webhook

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:

  1. Event: New Order
  2. Action: Call Webhook
    • URL: https://example.com/api/order
    • Request body:

{
"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?#

  1. Install and activate ShopMagic for WooCommerce plugin.
    • Minimal version required is 4.5.0
  2. Install and activate the ShopMagic Webhooks plugin.
  3. Go to ShopMagic → Automations.
  4. Create a new automation and select an event.
  5. Choose the “Call Webhook” action.
  6. Configure the URL, request body, and optional headers.
  7. Save the automation. Done!
Not the solution you are looking for?

Please check other articles or open a support ticket.

Cookies preferences

Others

Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.

Necessary

Necessary
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.

Advertisement

Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.

Analytics

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.

Functional

Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.

Performance

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.