[Guide] Handling orders from WooCommerce using webhooks

Introduction

This article describes how to process orders from WooCommerce using webhooks.

Webhooks are messages from one system to another, telling that a specific event has happened. To create an order integration from WooCommerce to Alumio using webhooks, follow the next steps.

Step 1: Create an incoming configuration

  • Navigate to “Connections” in the menu and select “Incoming”.
  • Create a new incoming configuration to setup the process of processing WooCommerce orders using webhooks.
  • Insert a name in the “name” field.
    1. For example: “WooCommerce – Orders – Handle order from webhook”
  • Under “Incoming Configuration” select the configuration created in the previous step.
  • Under “Parser”, select “JSON”.
  • Click “Add entity transformer” and select “WooCommerce - Order - Restructure to Alumio”.
    1. This transformer converts data from a WooCommerce format to the Alumio order schema.
  • Under “WooCommerce HTTP client” select the HTTP client that you created during the initial setup.
    1. This client will be used to retrieve additional information that is not included in the order data from WooCommerce.

  • Under “Map”, you can assign each of the order statuses from WooCommerce to the order statuses from your other system.

Step 2: Create a webhook

  • Navigate to “Connections” in the menu and select “Webhooks”.
  • Create a new webhook.
  • Insert a name in the “name” field.
    1. For example: “WooCommerce – Orders – Handle order webhook”
  • Under “Publisher” select “Webhook”
  • Under “Parser”, select “JSON”.

Step 3: Create a route

Next you’ll create a route to bind the incoming configuration to the outgoing configuration. In the route, you’ll need to select the incoming configuration you created in the previous steps.

On the following links, you can find more information about creating routes and outgoing configurations and publishers.

Step 4: Configure the webhook in WooCommerce

  • Navigate to “Settings” in the menu and select “Info”.
  • Copy the link next to “Base Webhook URL” and replace the “{identifier}” part with the identifier of the webhook created in the previous step.
    1. This should give you a URL like “https://your-environment.alumio.com/api/v1/webhook/woocommerce-orders-handle-order-webhook”.
  • Log in on the WooCommerce website’s admin panel.
  • Navigate to “WooCommerce” in the menu and select “Settings”
  • Go to the “Advanced” tab, followed by the “Webhooks” sub tab.
  • Click the “Add webhook” button.
  • Fill in a name.
    1. For example: “Alumio order webhook”,
  • Set the status to “Active”,
  • Under “Topic”, select one of the order events.
    1. For example: “Order updated”.
  • Under “Delivery URL”, enter the webhook URL you formed earlier in this step.
  • Click the “Save webhook” button

Additional information

This incoming configuration uses the Alumio order schema.

That’s it!

You should now be able to handle order webhooks from WooCommerce!

1 Like