Getting Started with Medusa Webhooks

Getting Started with Medusa Webhooks

Automate Your Workflows Like Happy Hippo Bakery

Medusa webhooks empower you to automate critical parts of your e-commerce workflow, enhancing efficiency and customer engagement. At Lambda Curry, we’ve developed a flexible Webhooks Plugin specifically for Medusa e-commerce stores. Today, we’ll guide you through setting up webhooks, using Happy Hippo Bakery’s real-world automation example as a practical reference.

Why Webhooks?

Webhooks are essential tools for real-time integrations. They let your Medusa store communicate seamlessly with external services, instantly triggering actions based on store events like orders, product updates, and customer activities.

Let’s look at a practical example of how Happy Hippo Bakery streamlined their operations with automated scheduling using webhooks.

Case Study: Happy Hippo Bakery’s Automated Email Scheduling

Previously, Jackie, the owner of Happy Hippo Bakery, handled each order’s scheduling notifications manually—a process prone to errors and consuming valuable time.

By integrating our Webhooks Plugin with the automation platform Make.com and Mailchimp, the bakery automated the entire scheduling notification process. Here’s how:

Workflow Breakdown:

Webhook Trigger Setup: A webhook in the MarketHaus (powered by Medusa) settings is triggered automatically when a customer places an order.

  • Integration with Mailchimp: The webhook triggers a Make.com workflow, adding labels to Mailchimp subscribers based on the chosen shipping method. This automates the sending of personalized, targeted email campaigns. Automated Scheduling Emails: Customers opting for local pickup or delivery receive immediate automated emails with direct links to schedule their appointments, greatly enhancing their user experience and freeing Jackie’s time for other business priorities.

Results:

  • Reduced manual labor: Automated processes replaced manual scheduling tasks.
  • Improved accuracy: Real-time automation eliminated manual errors.
  • Enhanced customer satisfaction: Customers benefited from prompt, personalized, and streamlined communication.

Implementing Our Webhooks Plugin

Ready to replicate this success in your own Medusa store? Here’s a straightforward guide:

Step 1: Installation

Install our Webhooks Plugin via npm or yarn:

npm install @lambdacurry/medusa-webhooks
# or
yarn add @lambdacurry/medusa-webhooks

Step 2: Configure Webhooks

Manage your webhook subscriptions via Medusa’s admin interface. Easily add new webhooks specifying event types and target URLs, and you’re ready to automate your workflows.

Step 3: Example Webhook Subscriber

Here’s a quick snippet showing how to set up a webhook subscriber:

import {
  SubscriberArgs,
  SubscriberConfig,
} from "@medusajs/framework/subscribers";
import { fullWebhooksSubscriptionsWorkflow } from "@lambdacurry/medusa-webhooks/workflows";

export const config: SubscriberConfig = {
  event: ["order.created"],
  context: { subscriberId: "new-order-webhook" },
};

export default async function handleOrderCreated({
  event: { name, data },
  container,
}: SubscriberArgs<{ id: string }>): Promise<void> {
  const query = container.resolve("query");
  const logger = container.resolve("logger");

  const { data: orderResult } = await query.graph({
    entity: "order",
    fields: ["*"],
    filters: { id: data.id },
  });

  const order = orderResult[0];

  if (!order) {
    logger.error("Order not found");
    return;
  }

  await fullWebhooksSubscriptionsWorkflow(container).run({
    input: {
      eventName: name,
      eventData: order,
    },
  });
}

Ready to Automate?

Our Webhooks Plugin simplifies integrating Medusa events with your preferred tools. Leverage real-time, automated workflows to enhance your operational efficiency and customer engagement—just like Happy Hippo Bakery.

Explore more or contribute directly at our GitHub repository https://github.com/lambda-curry/medusa-plugins.

Mar 27, 2025.

Related Posts

Building a Better MCP Server for Medusa with OpenAPI + Dynamic Tool Filtering

Building a Better MCP Server for Medusa with OpenAPI + Dynamic Tool Filtering

At Lambda Curry, we’ve been exploring how to make e-commerce management even more powerful using AI. Specifically, we’ve been building an MCP server (Multi-Command Protocol) for [Medusa](https

read more
Introducing Medusa Product Reviews Plugin

Introducing Medusa Product Reviews Plugin

Showcasing our new @lambdacurry/medusa-product-reviews plugin for Medusa 2 Boost Conversions & Build Trust with Product Rev

read more
Medusa 2.0 Starter with Lambda Curry

Medusa 2.0 Starter with Lambda Curry

Introducing the Lambda Curry Medusa 2.0 Starter: Empowering Developers to Build Scalable E-commerce Experiences We’re thrilled to introduce the Lambda Curry [Medusa 2.0](https://medusajs.com/starter

read more
Medusa Superpowers - Unlocking E-Commerce Potential

Medusa Superpowers - Unlocking E-Commerce Potential

In today’s rapidly evolving digital environment, e-commerce platforms must maintain flexibility, scalability, and intelligence to keep businesses competitive. SaySo, the p

read more
🛒 The Future of E-Commerce? AI Workflows in Medusa 2 🤖

🛒 The Future of E-Commerce? AI Workflows in Medusa 2 🤖

E-commerce is undergoing a transformation, and AI is at the center of it. As platforms evolve, the ability to integrate AI-powered workflows directly into store management systems is becoming increasi

read more
From Prompts to Prototypes: Learning the AI Development Process

From Prompts to Prototypes: Learning the AI Development Process

  • Jake Ruesink
  • AI
  • 18 Feb, 2025

Some friends in a coding chat I'm part of were asking about how to get better at AI-driven coding. They were wondering if the issues they were facing stemmed from a skill gap, poor prompts, a lack of

read more