listShippingOptionsForContextStep - Medusa Core Workflows Reference

This documentation provides a reference to the listShippingOptionsForContextStep. It belongs to the @medusajs/medusa/core-flows package.

This step retrieves shipping options that can be used in the specified context, based on the shipping options' rules.

Example#

To retrieve shipping options matching a context:

Code
1const data = listShippingOptionsForContextStep({2  context: {3    region_id: "reg_123"4  }5})

To retrieve shipping options matching a context with pagination:

Code
1const data = listShippingOptionsForContextStep({2  context: {3    region_id: "reg_123"4  },5  config: {6    skip: 0,7    take: 108  }9})

Learn more about paginating records and selecting fields in the service factory reference.

Input#

ListShippingOptionsForContextStepInputListShippingOptionsForContextStepInput
The data to retrieve the list of shipping options.
contextRecord<string, unknown>
The context of retrieving the shipping options. This context will be compared against shipping options' rules. The key of the context is a name of an attribute, and the value is the attribute's value. Shipping options that have rules matching this context are retrieved.
The fields and relations to select in the returned shipping options, along with pagination and sorting options. Learn more in the service factory reference.

Output#

ShippingOptionDTO[]ShippingOptionDTO[]
ShippingOptionDTOShippingOptionDTO
The shipping option details.
Was this page helpful?
Ask Anything
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