Fulfillment Module Provider
In this guide, you’ll learn about the Fulfillment Module Provider and how it's used.
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.
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.
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.
The FulfillmentProvider
data model has the following properties:
id
: The unique identifier of the fulfillment provider. The ID's format isfp_{identifier}_{id}
, where:identifier
is the value of theidentifier
property in the Fulfillment Module Provider's service.id
is the value of theid
property of the Fulfillment Module Provider inmedusa-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.