- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
groupProductsForBatchStep - Medusa Core Workflows Reference
This documentation provides a reference to the groupProductsForBatchStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step groups products to be created or updated.
Example#
1const data = groupProductsForBatchStep([2 {3 id: "prod_123",4 title: "Shirt",5 options: [6 {7 title: "Size",8 values: ["S", "M", "L"]9 }10 ]11 },12 {13 title: "Pants",14 options: [15 {16 title: "Color",17 values: ["Red", "Blue"]18 }19 ],20 variants: [21 {22 title: "Red Pants",23 options: {24 Color: "Red"25 },26 prices: [27 {28 amount: 10,29 currency_code: "usd"30 }31 ]32 }33 ]34 }35])
Input#
GroupProductsForBatchStepInput
GroupProductsForBatchStepInputThe products to group.
GroupProductsForBatchStepInput
GroupProductsForBatchStepInputtitle
stringThe product's title.
title
stringoptions
AdminCreateProductOption[]The product's options.
options
AdminCreateProductOption[]subtitle
stringOptionalThe product's subtitle.
subtitle
stringOptionaldescription
stringOptionalThe product's description.
description
stringOptionalis_giftcard
booleanOptionalWhether the product is a gift card.
is_giftcard
booleanOptionaldiscountable
booleanOptionalWhether discounts can be applied on the product.
discountable
booleanOptionalimages
object[]OptionalThe product's images.
images
object[]Optionalthumbnail
stringOptionalThe product's thumbnail URL.
thumbnail
stringOptionalhandle
stringOptionalThe product's handle.
handle
stringOptionalThe product's status.
type_id
stringOptionalThe ID of the product's type.
type_id
stringOptionalexternal_id
stringOptionalThe ID of the product in an external or third-party system.
external_id
stringOptionalcollection_id
stringOptionalThe ID of the product's collection.
collection_id
stringOptionalcategories
object[]OptionalThe product's categories.
categories
object[]Optionaltags
object[]OptionalThe product's tags.
tags
object[]OptionalThe product's variants.
sales_channels
object[]OptionalThe sales channels that the product is available in.
sales_channels
object[]Optionalweight
numberOptionalThe product's weight.
weight
numberOptionallength
numberOptionalThe product's length.
length
numberOptionalheight
numberOptionalThe product's height.
height
numberOptionalwidth
numberOptionalThe product's width.
width
numberOptionalhs_code
stringOptionalThe product's HS code.
hs_code
stringOptionalmid_code
stringOptionalThe product's MID code.
mid_code
stringOptionalorigin_country
stringOptionalThe product's origin country.
origin_country
stringOptionalmaterial
stringOptionalThe product's material.
material
stringOptionalmetadata
Record<string, unknown>OptionalKey-value pairs of custom data.
metadata
Record<string, unknown>Optionalid
stringOptionalThe ID of the product to update.
id
stringOptionalOutput#
GroupProductsForBatchStepOutput
GroupProductsForBatchStepOutput
GroupProductsForBatchStepOutput
GroupProductsForBatchStepOutputcreate
AdminCreateProduct[]The products to create.
create
AdminCreateProduct[]update
AdminUpdateProduct & object[]The products to update.
update
AdminUpdateProduct & object[]Was this page helpful?