- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
calculateShippingOptionsPricesStep - Medusa Core Workflows Reference
This documentation provides a reference to the calculateShippingOptionsPricesStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step calculates the prices for one or more shipping options.
Example#
1const data = calculateShippingOptionsPricesStep([{2 id: "so_123",3 provider_id: "provider_123",4 optionData: {5 // custom data relevant for the fulfillment provider6 carrier_code: "UPS",7 },8 data: {9 // custom data relevant for the fulfillment provider10 // specific to the cart using this shipping option11 },12 context: {13 from_location: {14 id: "sloc_123",15 // other location fields16 }17 }18}])
Input#
CalculateShippingOptionsPriceStepInput
CalculateShippingOptionsPriceStepInputThe data to calculate the prices for one or more shipping options.
CalculateShippingOptionsPriceStepInput
CalculateShippingOptionsPriceStepInputid
stringThe ID of the shipping option.
id
stringprovider_id
stringThe ID of the fulfillment provider.
provider_id
stringoptionData
Record<string, unknown>The data
property of the shipping option.
optionData
Record<string, unknown>data
property of the shipping option.data
Record<string, unknown>The shipping method's data
property with custom data passed from the frontend.
data
Record<string, unknown>data
property with custom data passed from the frontend.context
CartPropsForFulfillment & objectThe calculation context needed for the associated fulfillment provider to calculate the price of a shipping option.
context
CartPropsForFulfillment & objectOutput#
CalculatedShippingOptionPrice[]
CalculatedShippingOptionPrice[]
CalculatedShippingOptionPrice[]
CalculatedShippingOptionPrice[]CalculatedShippingOptionPrice
CalculatedShippingOptionPriceA calculated shipping option price.
CalculatedShippingOptionPrice
CalculatedShippingOptionPriceWas this page helpful?