Loading...
Was this page helpful?
This documentation provides a reference to the validateShippingStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step validates shipping data when cart is completed.
It ensures that a shipping method is selected if there is an item in the cart that requires shipping. It also ensures that product's shipping profile mathes the selected shipping options. If the conditions are not met, an error is thrown.
1validateShippingStep({2 cart: {3 id: "cart_123",4 items: [5 {6 id: "item_123",7 variant: {8 id: "variant_123",9 // other item details...10 },11 }12 ],13 // other cart details...14 },15 shippingOptions: [16 {17 id: "option_123",18 shipping_profile_id: "sp_123",19 // other option details...20 }21 ]22})
ValidateShippingInput
ValidateShippingInputcart
Omit<CartWorkflowDTO, "items"> & objectshippingOptions
ShippingOptionDTO[]