MedusaJS Plugins / Essentials/online-fulfillment-module

Online Fulfillment Module

June 17, 2026 · 5 min read

Online Fulfillment Module helps with devlivering online services and digital products. It provides a structured way to manage the fulfillment of online orders, ensuring that customers receive their digital products or access to online services seamlessly.

Fulfillment Strategies

Define fulfillment strategies for different types of online products or services. Strategies accept the fulfillment methods configuration (which can be done in the admin dashboard, or via API, read below), the order details and the associated line items relevant to the fulfillment. Based on the provided information, the strategy should fulfill the order accordingly.

import { FulfillmentStrategy } from "@medusajs/medusa-essentials"

export const GameKeyFulfillmentStrategy: FulfillmentStrategy = async ({
  method,
  order,
  lineItem,
  context
}) => {
    // Handle the fulfillment logic for delivering a game key to the customer
    // either directly here or via a Workflow
    const gameId = method.configuration.gameId;

    deliverGameKeyWorkflow(context.scope).run({
        input: {
            gameId,
            quantity: lineItem.quantity
        }
    });
}

The above example assumes a configuration for every product variant that requires a game key, where the gameId is stored. The fulfillment strategy then uses this configuration to deliver the appropriate game key to the customer. You can also use the product variant's data to determine the fulfillment method, instead of relying on the configuration.

export const GameKeyFulfillmentStrategy: FulfillmentStrategy = async ({
  method,
  order,
  lineItem,
  context
}) => {
    // Handle the fulfillment logic for delivering a game key to the customer
    // either directly here or via a Workflow
    const gameId = lineItem.variant.metadata.gameId;

    deliverGameKeyWorkflow(context.scope).run({
        input: {
            gameId,
            quantity: lineItem.quantity
        }
    });
}

Included Strategies

Booking Strategy

The Booking Strategy handles the fulfillment of bookings via the Booking Module. When using Booking Strategy, you need to set the line item metadata to tell the strategy which time slot to book.

const bookingStrategyLineItemMetadata = {
    time_slot_id: "bk_slot_*****************",
    start_time: "2024-12-31T23:00:00.000Z",
    end_time: "2025-01-01T00:00:00.000Z",
}

Benefit Strategy

The Benefit Strategy handles the fulfillment of benefits via the Benefits Module. All aspects are configurable using the method configuration via the provided admin interface.

Fulfillment Methods

Fulfillment methods are configurations linked to specific product variants that define how the fulfillment of an online product or service should be handled. They include the strategy to be used for fulfillment and any necessary configuration details required by that strategy.

Fulfillment methods can be created and managed through the Medusa Admin dashboard or via API.

Configuration Widgets

To allow for easy configuration of fulfillment methods in the admin dashboard, you can create custom widgets that correspond to the specific needs of your fulfillment strategies. For example, if you have a strategy that delivers game keys, you might create a widget that allows the admin to select a game from a list and input any necessary details.

Multiple Strategies

You can use multiple fulfillment strategies within a single fulfillment method configuration to provide flexibility in how orders are fulfilled.