calculateShippingOptionsPricesWorkflow - Medusa Core Workflows Reference

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

This workflow calculates the prices for one or more shipping options in a cart. It's used by the Calculate Shipping Option Price Store API Route.

NoteCalculating shipping option prices may require sending requests to third-party fulfillment services. This depends on the implementation of the fulfillment provider associated with the shipping option.

You can use this workflow within your own customizations or custom workflows, allowing you to calculate the prices of shipping options within your custom flows.

Source Code

Examples#

Steps#

Input#

CalculateShippingOptionsPricesWorkflowInputCalculateShippingOptionsPricesWorkflowInput
cart_idstring
The ID of the cart to calculate the shipping options for.
shipping_optionsobject[]
The shipping options to calculate the prices for.

Output#

CalculateShippingOptionsPricesWorkflowOutputCalculateShippingOptionsPricesWorkflowOutput
calculated_amountnumber
The calculated price.
is_calculated_price_tax_inclusiveboolean
Whether the calculated price includes taxes. If enabled, Medusa will infer the taxes from the calculated price. If false, Medusa will add taxes to the calculated price.
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