Links between Fulfillment Module and Other Modules

This document showcases the module links defined between the Fulfillment Module and other Commerce Modules.

Summary#

The Fulfillment Module has the following links to other modules:

First Data Model

Second Data Model

Type

Description

ShippingMethod in Cart Module

ShippingOption

Read-only - has one

Learn more

OrderShippingMethod in Order Module

ShippingOption

Read-only - has one

Learn more

Order in Order Module

Fulfillment

Stored - one-to-many

Learn more

Return in Order Module

Fulfillment

Stored - one-to-many

Learn more

PriceSet in Pricing Module

ShippingOption

Stored - many-to-one

Learn more

Product in Product Module

ShippingProfile

Stored - many-to-one

Learn more

StockLocation in Stock Location Module

FulfillmentProvider

Stored - one-to-many

Learn more

StockLocation in Stock Location Module

FulfillmentSet

Stored - one-to-many

Learn more


Cart Module#

Medusa defines a read-only link between the ShippingMethod data model of the Cart Module and the ShippingOption data model. This means you can retrieve the details of a shipping method's shipping option, but you don't manage the links in a pivot table in the database. The shipping option of a shipping method is determined by the shipping_option_id property of the ShippingMethod data model.

This link allows you to retrieve the shipping option that a shipping method was created from.

Note: This read-only link was added in Medusa v2.10.0

Retrieve with Query#

To retrieve the shipping option of a shipping method with Query, pass shipping_option.* in fields:


Order Module#

The Order Module provides order-management functionalities.

Medusa defines a link between the Fulfillment and Order data models. A fulfillment is created for an orders' items.

A diagram showcasing an example of how data models from the Fulfillment and Order modules are linked

A fulfillment is also created for a return's items. So, Medusa defines a link between the Fulfillment and Return data models.

A diagram showcasing an example of how data models from the Fulfillment and Order modules are linked

Retrieve with Query

To retrieve the order of a fulfillment with Query, pass order.* in fields:

Note: To retrieve the return, pass return.* in fields.

To manage the order of a cart, use Link:

Medusa defines a read-only link between the OrderShippingMethod data model of the Order Module and the ShippingOption data model. This means you can retrieve the details of an order shipping method's shipping option, but you don't manage the links in a pivot table in the database. The shipping option of an order shipping method is determined by the shipping_option_id property of the OrderShippingMethod data model.

This link allows you to retrieve the shipping option that an order's shipping method was created from.

Note: This link is available since Medusa v2.21.1.

Retrieve with Query

To retrieve the shipping option of an order shipping method with Query, pass shipping_option.* in fields:


Pricing Module#

The Pricing Module provides features to store, manage, and retrieve the best prices in a specified context.

Medusa defines a link between the PriceSet and ShippingOption data models. A shipping option's price is stored as a price set.

A diagram showcasing an example of how data models from the Pricing and Fulfillment modules are linked

Retrieve with Query#

To retrieve the price set of a shipping option with Query, pass price_set.* in fields:

To manage the price set of a shipping option, use Link:


Product Module#

Medusa defines a link between the ShippingProfile data model and the Product data model of the Product Module. Each product must belong to a shipping profile.

Note: This link is introduced in Medusa v2.5.0.

Retrieve with Query#

To retrieve the products of a shipping profile with Query, pass products.* in fields:

To manage the shipping profile of a product, use Link:


Stock Location Module#

The Stock Location Module provides features to manage stock locations in a store.

Medusa defines a link between the FulfillmentSet and StockLocation data models. A fulfillment set can be conditioned to a specific stock location.

A diagram showcasing an example of how data models from the Fulfillment and Stock Location modules are linked

Medusa also defines a link between the FulfillmentProvider and StockLocation data models to indicate the providers that can be used in a location.

A diagram showcasing an example of how data models from the Fulfillment and Stock Location modules are linked

Retrieve with Query#

To retrieve the stock location of a fulfillment set with Query, pass location.* in fields:

Note: To retrieve the stock location of a fulfillment provider, pass locations.* in fields.

To manage the stock location of a fulfillment set, use Link:

Was this page helpful?
Ask Bloom
For assistance in your development, use Claude Code Plugins or Docs MCP server in Cursor, VSCode, etc...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
⇧↵