Skip to main content

Overview

The Fulfillment Module manages shipping and delivery operations including shipping profiles, service zones, geographic zones, shipping options with rule-based pricing, and fulfillment tracking. It provides a flexible system for configuring complex shipping scenarios. Key Features:
  • Shipping profile management
  • Service zones with geographic coverage
  • Rule-based shipping options
  • Multi-provider fulfillment support
  • Fulfillment tracking and labeling
  • Dynamic shipping calculations
  • Fulfillment set organization

When to Use

Use the Fulfillment Module when you need to:
  • Configure shipping options for products
  • Define geographic shipping zones
  • Calculate shipping costs based on rules (weight, price, etc.)
  • Manage multiple fulfillment providers
  • Create and track fulfillments
  • Generate shipping labels
  • Handle multi-location shipping
  • Support pickup and delivery options

Data Models

ShippingProfile

Groups products with similar shipping requirements.
string
required
Unique shipping profile identifier
string
required
Profile name (e.g., “Standard Products”, “Fragile Items”)
string
required
Profile type: default, gift_card, custom

ServiceZone

Defines a shipping service area with associated shipping options.
string
required
Unique service zone identifier
string
required
Service zone name
string
required
ID of the parent fulfillment set
GeoZone[]
Geographic areas covered by this zone
ShippingOption[]
Available shipping options in this zone

GeoZone

Defines a geographic area within a service zone.
string
required
Unique geo zone identifier
string
required
Zone type: country, province, city, zip
string
required
Two-letter ISO country code
string
Province or state code
string
City name
string
Regex pattern for postal codes
string
required
ID of the parent service zone

ShippingOption

Represents a shipping method available to customers.
string
required
Unique shipping option identifier
string
required
Shipping option name (e.g., “Express Shipping”)
string
required
ID of the service zone
string
required
ID of the shipping profile
string
required
Fulfillment provider ID (e.g., “manual”, “shippo”)
string
required
ID of the shipping option type
object
Provider-specific configuration data
ShippingOptionRule[]
Rules for pricing and availability

ShippingOptionRule

Defines conditions and pricing for shipping options.
string
required
Unique rule identifier
string
required
ID of the shipping option
string
required
Rule attribute (e.g., “total”, “weight”, “quantity”)
string
required
Comparison operator: eq, ne, gt, gte, lt, lte, in
string | number
Rule value to compare against

Fulfillment

Tracks order fulfillment.
string
required
Unique fulfillment identifier
string
required
Stock location fulfilling the items
string
required
Fulfillment provider ID
string
ID of the shipping option used
object
Provider-specific fulfillment data
DateTime
When fulfillment was shipped
DateTime
When fulfillment was delivered
DateTime
When fulfillment was canceled
FulfillmentItem[]
Items in this fulfillment
FulfillmentLabel[]
Shipping labels

FulfillmentSet

Organizes fulfillment configuration.
string
required
Unique fulfillment set identifier
string
required
Fulfillment set name
string
required
Set type: pickup, shipping
ServiceZone[]
Service zones in this set

Service Interface

The Fulfillment Module service is available at @medusajs/medusa/fulfillment.

Create Shipping Profile

Create a shipping profile for products.
CreateShippingProfileDTO
required
Shipping profile data
string
required
Profile name
string
required
Profile type: default, gift_card, custom

Create Fulfillment Set

Create a fulfillment set with service zones.
CreateFulfillmentSetDTO
required
Fulfillment set data
string
required
Fulfillment set name
string
required
Set type: pickup, shipping
CreateServiceZoneDTO[]
Service zones to create

Create Service Zone

Create a service zone with geographic coverage.

Create Geo Zone

Define a geographic area.

Create Shipping Option

Create a shipping method with rules.
CreateShippingOptionDTO
required
Shipping option data
string
required
Shipping option name
string
required
ID of the service zone
string
required
ID of the shipping profile
string
required
Fulfillment provider ID
CreateShippingOptionRuleDTO[]
Pricing and availability rules

List Shipping Options for Context

Find available shipping options for an address.
FilterableShippingOptionForContextProps
required
Context filters
object
Shipping address to match against geo zones
object
Values for rule evaluation (total, weight, quantity, etc.)

Create Fulfillment

Create a fulfillment for order items.
CreateFulfillmentDTO
required
Fulfillment data
string
required
Stock location ID
string
required
Fulfillment provider ID
CreateFulfillmentItemDTO[]
required
Items to fulfill
string
ID of the shipping option
object
Provider-specific data

Create Shipping Labels

Generate shipping labels for fulfillment.

Update Fulfillment

Update fulfillment status.

Cancel Fulfillment

Cancel an active fulfillment.

Integration Examples

With Cart Module

Add shipping method to cart.

With Stock Location Module

Multi-location fulfillment.

With Order Module

Create fulfillments for orders.

Fulfillment Providers

Medusa supports multiple fulfillment providers:

Manual Provider

Built-in provider for manual fulfillment processes.

Shippo

Best Practices

  1. Shipping Profiles: Group products with similar shipping requirements (fragile, oversized, standard) into profiles.
  2. Service Zones: Structure zones hierarchically - start with broad zones (country), then narrow (province, city, ZIP).
  3. Rule-Based Pricing: Use rules to implement complex pricing:
    • Free shipping over certain total
    • Weight-based pricing
    • Quantity discounts
  4. Geo Zone Expressions: Use postal_expression with regex for flexible postal code matching (e.g., ^94 for San Francisco area).
  5. Multi-Location: Configure fulfillment sets per location for complex inventory scenarios.
  6. Provider Data: Store provider-specific configuration in the data field for flexibility.