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 & { [k: string]: unknown; from_location?: StockLocationDTO | undefined; } & CalculatedRMAShippingContextThe calculation context needed for the associated fulfillment provider to calculate the price of a shipping option.
context
CartPropsForFulfillment & { [k: string]: unknown; from_location?: StockLocationDTO | undefined; } & CalculatedRMAShippingContextOutput#
CalculatedShippingOptionPrice[]
CalculatedShippingOptionPrice[]
CalculatedShippingOptionPrice[]
CalculatedShippingOptionPrice[]calculated_amount
numberThe calculated price.
calculated_amount
numberis_calculated_price_tax_inclusive
booleanWhether 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.
is_calculated_price_tax_inclusive
booleanWas this page helpful?