Fulfillment Module Provider

In this guide, you’ll learn about the Fulfillment Module Provider and how it's used.

Looking for no-code docs? Refer to this Medusa Admin User Guide to learn how to add a fulfillment provider to a location using the dashboard.

What is a Fulfillment Module Provider?#

A Fulfillment Module Provider handles fulfilling items, typically using a third-party integration.

Fulfillment Module Providers registered in the Fulfillment Module's options are stored and represented by the FulfillmentProvider data model.

Diagram showcasing the communication between Medusa, the Fulfillment Module Provider, and the third-party fulfillment provider.


Default Fulfillment Provider#

Medusa provides a Manual Fulfillment Provider that acts as a placeholder fulfillment provider. It doesn't process fulfillment and delegates that to the merchant.

This provider is installed by default in your application and you can use it to fulfill items manually.

Tip: The identifier of the manual fulfillment provider is fp_manual_manual.

How to Create a Custom Fulfillment Provider?#

A Fulfillment Module Provider is a module whose service implements the IFulfillmentProvider imported from @medusajs/framework/types.

The module can have multiple fulfillment provider services, where each are registered as separate fulfillment providers.

Refer to the Create Fulfillment Module Provider guide to learn how to create a Fulfillment Module Provider.

After you create a fulfillment provider, you can choose it as the default Fulfillment Module Provider for a stock location in the Medusa Admin dashboard.


How are Fulfillment Providers Registered?#

Configure Fulfillment Module's Providers#

The Fulfillment Module accepts a providers option that allows you to configure the providers registered in your application.

Learn more about this option in the Module Options guide.

Registration on Application Start#

When the Medusa application starts, it registers the Fulfillment Module Providers defined in the providers option of the Fulfillment Module.

For each Fulfillment Module Provider, the Medusa application finds all fulfillment provider services defined in them to register.

FulfillmentProvider Data Model#

A registered fulfillment provider is represented by the FulfillmentProvider data model in the Medusa application.

This data model is used to reference a service in the Fulfillment Module Provider and determine whether it's installed in the application.

Diagram showcasing the FulfillmentProvider data model

The FulfillmentProvider data model has the following properties:

  • id: The unique identifier of the fulfillment provider. The ID's format is fp_{identifier}_{id}, where:
    • identifier is the value of the identifier property in the Fulfillment Module Provider's service.
    • id is the value of the id property of the Fulfillment Module Provider in medusa-config.ts.
  • is_enabled: A boolean indicating whether the fulfillment provider is enabled.

How to Remove a Fulfillment Provider?#

You can remove a registered fulfillment provider from the Medusa application by removing it from the providers option in the Fulfillment Module's configuration.

Then, the next time the Medusa application starts, it will set the is_enabled property of the FulfillmentProvider's record to false. This allows you to re-enable the fulfillment provider later if needed by adding it back to the providers option.

Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break