|
1
|
export const metadata = { |
|
2
|
title: `Fulfillment Module Provider`, |
|
3
|
} |
|
4
|
|
|
5
|
# {metadata.title} |
|
6
|
|
|
7
|
In this guide, you’ll learn about the Fulfillment Module Provider and how it's used. |
|
8
|
|
|
9
|
<Note title="Looking for no-code docs?"> |
|
10
|
|
|
11
|
Refer to this [Medusa Admin User Guide](!user-guide!/settings/locations-and-shipping/locations#manage-fulfillment-providers) to learn how to add a fulfillment provider to a location using the dashboard. |
|
12
|
|
|
13
|
</Note> |
|
14
|
|
|
15
|
## What is a Fulfillment Module Provider? |
|
16
|
|
|
17
|
A Fulfillment Module Provider handles fulfilling items, typically using a third-party integration. |
|
18
|
|
|
19
|
Fulfillment Module Providers registered in the Fulfillment Module's [options](../module-options/page.mdx) are stored and represented by the [FulfillmentProvider data model](/references/fulfillment/models/FulfillmentProvider). |
|
20
|
|
|
21
|
 |
|
22
|
|
|
23
|
--- |
|
24
|
|
|
25
|
## Default Fulfillment Provider |
|
26
|
|
|
27
|
Medusa provides a Manual Fulfillment Provider that acts as a placeholder fulfillment provider. It doesn't process fulfillment and delegates that to the merchant. |
|
28
|
|
|
29
|
This provider is installed by default in your application and you can use it to fulfill items manually. |
|
30
|
|
|
31
|
<Note title="Tip"> |
|
32
|
|
|
33
|
The identifier of the manual fulfillment provider is `fp_manual_manual`. |
|
34
|
|
|
35
|
</Note> |
|
36
|
|
|
37
|
--- |
|
38
|
|
|
39
|
## How to Create a Custom Fulfillment Provider? |
|
40
|
|
|
41
|
A Fulfillment Module Provider is a module whose service implements the `IFulfillmentProvider` imported from `@medusajs/framework/types`. |
|
42
|
|
|
43
|
The module can have multiple fulfillment provider services, where each are registered as separate fulfillment providers. |
|
44
|
|
|
45
|
Refer to the [Create Fulfillment Module Provider](/references/fulfillment/provider) guide to learn how to create a Fulfillment Module Provider. |
|
46
|
|
|
47
|
{/* TODO add link to user guide */} |
|
48
|
|
|
49
|
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. |
|
50
|
|
|
51
|
--- |
|
52
|
|
|
53
|
## How are Fulfillment Providers Registered? |
|
54
|
|
|
55
|
### Configure Fulfillment Module's Providers |
|
56
|
|
|
57
|
The Fulfillment Module accepts a `providers` option that allows you to configure the providers registered in your application. |
|
58
|
|
|
59
|
Learn more about this option in the [Module Options](../module-options/page.mdx) guide. |
|
60
|
|
|
61
|
### Registration on Application Start |
|
62
|
|
|
63
|
When the Medusa application starts, it registers the Fulfillment Module Providers defined in the `providers` option of the Fulfillment Module. |
|
64
|
|
|
65
|
For each Fulfillment Module Provider, the Medusa application finds all fulfillment provider services defined in them to register. |
|
66
|
|
|
67
|
### FulfillmentProvider Data Model |
|
68
|
|
|
69
|
A registered fulfillment provider is represented by the [FulfillmentProvider data model](/references/fulfillment/models/FulfillmentProvider) in the Medusa application. |
|
70
|
|
|
71
|
This data model is used to reference a service in the Fulfillment Module Provider and determine whether it's installed in the application. |
|
72
|
|
|
73
|
 |
|
74
|
|
|
75
|
The `FulfillmentProvider` data model has the following properties: |
|
76
|
|
|
77
|
- `id`: The unique identifier of the fulfillment provider. The ID's format is `fp_{identifier}_{id}`, where: |
|
78
|
- `identifier` is the value of the `identifier` property in the Fulfillment Module Provider's service. |
|
79
|
- `id` is the value of the `id` property of the Fulfillment Module Provider in `medusa-config.ts`. |
|
80
|
- `is_enabled`: A boolean indicating whether the fulfillment provider is enabled. |
|
81
|
|
|
82
|
### How to Remove a Fulfillment Provider? |
|
83
|
|
|
84
|
You can remove a registered fulfillment provider from the Medusa application by removing it from the `providers` option in the Fulfillment Module's configuration. |
|
85
|
|
|
86
|
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. |