- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
createShippingOptionsWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the createShippingOptionsWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow creates one or more shipping options. It's used by the Create Shipping Option Admin API Route.
You can use this workflow within your own customizations or custom workflows, allowing you to create shipping options within your custom flows.
Source CodeExamples#
To calculate a shipping option with flat rate prices:
To calculate shipping option with calculated prices, set
to
and don't pass a
array:
Note: You can calculate the shipping option's price for a cart using the calculateShippingOptionsPricesWorkflow.
Steps#
Workflow Hook
Step conditioned by when
Input#
CreateShippingOptionsWorkflowInput
CreateShippingOptionsWorkflowInputThe data to create the shipping options.
CreateShippingOptionsWorkflowInput
CreateShippingOptionsWorkflowInputCreateShippingOptionsWorkflowInput
CreateShippingOptionsWorkflowInput[]The data to create the shipping options.
CreateShippingOptionsWorkflowInput
CreateShippingOptionsWorkflowInput[]Output#
CreateShippingOptionsWorkflowOutput
CreateShippingOptionsWorkflowOutput
CreateShippingOptionsWorkflowOutput
CreateShippingOptionsWorkflowOutputid
stringThe ID of the shipping option.
id
stringname
stringThe name of the shipping option.
name
stringprice_type
ShippingOptionPriceTypeThe type of the shipping option's price.
price_type
ShippingOptionPriceTypeservice_zone_id
stringThe associated service zone's ID.
service_zone_id
stringshipping_profile_id
stringThe associated shipping profile's ID.
shipping_profile_id
stringprovider_id
stringThe associated fulfillment provider's ID.
provider_id
stringshipping_option_type_id
null | stringThe associated shipping option type's ID.
shipping_option_type_id
null | stringdata
null | Record<string, unknown>The data necessary for the associated fulfillment provider to process the shipping option
and, later, its associated fulfillments.
data
null | Record<string, unknown>metadata
null | Record<string, unknown>Holds custom data in key-value pairs.
metadata
null | Record<string, unknown>service_zone
ServiceZoneDTOThe associated service zone.
service_zone
ServiceZoneDTOshipping_profile
ShippingProfileDTOThe associated shipping profile.
shipping_profile
ShippingProfileDTOfulfillment_provider
FulfillmentProviderDTOThe associated fulfillment provider.
fulfillment_provider
FulfillmentProviderDTOThe associated shipping option type.
rules
ShippingOptionRuleDTO[]The rules associated with the shipping option.
rules
ShippingOptionRuleDTO[]fulfillments
FulfillmentDTO[]The fulfillments associated with the shipping option.
fulfillments
FulfillmentDTO[]created_at
DateThe creation date of the shipping option.
created_at
Dateupdated_at
DateThe update date of the shipping option.
updated_at
Datedeleted_at
null | DateThe deletion date of the shipping option.
deleted_at
null | DateWas this page helpful?