- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
validateProductInputStep - Medusa Core Workflows Reference
This documentation provides a reference to the validateProductInputStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step validates that all provided products have options. If a product is missing options or a shipping profile, an error is thrown.
Example#
1const data = validateProductInputStep({2 products: [3 {4 title: "Shirt",5 options: [6 {7 title: "Size",8 values: ["S", "M", "L"]9 }10 ],11 variants: [12 {13 title: "Small Shirt",14 sku: "SMALLSHIRT",15 options: {16 Size: "S"17 },18 prices: [19 {20 amount: 10,21 currency_code: "usd"22 }23 ],24 manage_inventory: true,25 },26 ]27 }28 ]29})
Input#
ValidateProductInputStepInput
ValidateProductInputStepInputThe product's data to validate.
ValidateProductInputStepInput
ValidateProductInputStepInputproducts
Omit<CreateProductWorkflowInputDTO, "sales_channels">[]The products to validate.
products
Omit<CreateProductWorkflowInputDTO, "sales_channels">[]shippingProfiles
object[]The shipping profiles to validate.
shippingProfiles
object[]Was this page helpful?