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#

Code
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#

ValidateProductInputStepInputValidateProductInputStepInput
The product's data to validate.
productsOmit<CreateProductWorkflowInputDTO, "sales_channels">[]
The products to validate.
shippingProfilesobject[]
The shipping profiles to validate.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break