- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
validateAndReturnShippingMethodsDataStep - Medusa Core Workflows Reference
This documentation provides a reference to the validateAndReturnShippingMethodsDataStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step validates shipping options to ensure they can be applied on a cart. The step either returns the validated data or void.
Example#
1const data = validateAndReturnShippingMethodsDataStep({2 id: "sm_123",3 provider_id: "my_provider",4 option_data: {},5 method_data: {},6 context: {7 id: "cart_123",8 shipping_address: {9 id: "saddr_123",10 first_name: "Jane",11 last_name: "Smith",12 address_1: "456 Elm St",13 city: "Shelbyville",14 country_code: "us",15 postal_code: "67890",16 },17 items: [18 {19 variant: {20 id: "variant_123",21 weight: 1,22 length: 1,23 height: 1,24 width: 1,25 material: "wood",26 product: {27 id: "prod_123"28 }29 }30 }31 ],32 product: {33 id: "prod_123",34 collection_id: "pcol_123",35 categories: [],36 tags: []37 },38 from_location: {39 id: "sloc_123",40 first_name: "John",41 last_name: "Doe",42 address_1: "123 Main St",43 city: "Springfield",44 country_code: "us",45 postal_code: "12345",46 },47 }48})
Input#
ValidateShippingMethodsDataInput
ValidateShippingMethodsDataInputThe details of the shipping methods to validate.
ValidateShippingMethodsDataInput
ValidateShippingMethodsDataInputid
stringThe shipping method's ID.
id
stringprovider_id
stringThe fulfillment provider ID that associated with the shipping option
that the method was created from.
provider_id
stringoption_data
Record<string, unknown>The data
property of the shipping option that the shipping method was
created from.
option_data
Record<string, unknown>data
property of the shipping option that the shipping method was
created from.method_data
Record<string, unknown>The data
property of the shipping method.
method_data
Record<string, unknown>data
property of the shipping method.The context to validate the shipping method.
Output#
object[]
object[]Was this page helpful?