Fulfillment Providers
Fulfillment providers handle shipping, delivery, and order fulfillment operations. They calculate shipping prices, validate fulfillment data, create shipments, and manage returns.Available Fulfillment Providers
Manual Fulfillment Provider
The manual fulfillment provider (@medusajs/medusa/fulfillment-manual) is a simple provider for self-managed fulfillment where you handle shipping logistics yourself.
Features:
- No external shipping integrations
- Manual fulfillment process
- Supports both regular fulfillment and returns
- Does not calculate shipping prices
Installation
The manual fulfillment provider is included in the core Medusa package:Configuration
Configure the fulfillment provider in yourmedusa-config.ts:
Fulfillment Provider Interface
All fulfillment providers extendAbstractFulfillmentProviderService and implement the following methods:
getFulfillmentOptions(): Promise<FulfillmentOption[]>
Returns available fulfillment options.
validateFulfillmentData(optionData, data, context): Promise<any>
Validates fulfillment data before creating a fulfillment.
Parameters:
optionData- Configuration data for the fulfillment optiondata- Fulfillment data to validatecontext- Additional context including cart/order data
validateOption(data): Promise<boolean>
Validates a fulfillment option configuration.
canCalculate(): Promise<boolean>
Indicates whether the provider can calculate shipping prices.
calculatePrice(optionData, data, context): Promise<CalculatedShippingOptionPrice>
Calculates shipping price (not supported by manual provider).
Parameters:
optionData- Shipping option configurationdata- Calculation data (items, destination, etc.)context- Additional context
createFulfillment(): Promise<CreateFulfillmentResult>
Creates a fulfillment (shipment).
data- Provider-specific fulfillment datalabels- Shipping labels (if applicable)
cancelFulfillment(): Promise<any>
Cancels an existing fulfillment.
createReturnFulfillment(): Promise<CreateFulfillmentResult>
Creates a return fulfillment.
Using the Fulfillment Module
Access fulfillment providers through the Fulfillment Module:Fulfillment Workflows
Use fulfillment workflows from@medusajs/core-flows:
Creating Custom Fulfillment Providers
Create a custom fulfillment provider by extendingAbstractFulfillmentProviderService:
packages/modules/providers/fulfillment-custom/src/services/custom-fulfillment.ts
packages/modules/providers/fulfillment-custom/src/index.ts
medusa-config.ts
Reference
- Source:
packages/modules/providers/fulfillment-manual/src/services/manual-fulfillment.ts - Base class:
packages/core/utils/src/fulfillment/abstract-fulfillment-provider.ts - Types:
packages/core/types/src/fulfillment/provider.ts
Next Steps
Payment Providers
Configure payment processing
Notification Providers
Send shipping confirmation emails