createProductsStep - Medusa Core Workflows Reference
This documentation provides a reference to the createProductsStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step creates one or more products.
Example#
Input#
CreateProductDTO[]
CreateProductDTO[]
CreateProductDTO[]
CreateProductDTO[]title
stringThe title of the product.
title
stringid
stringOptionalOptionally pass an ID when creating a product.
id
stringOptionalsubtitle
stringOptionalThe subttle of the product.
subtitle
stringOptionaldescription
stringOptionalThe description of the product.
description
stringOptionalis_giftcard
booleanOptionalWhether the product is a gift card.
is_giftcard
booleanOptionaldiscountable
booleanOptionalWhether the product can be discounted.
discountable
booleanOptionalthumbnail
stringOptionalThe URL of the product's thumbnail.
thumbnail
stringOptionalhandle
stringOptionalThe handle of the product. The handle can be used to create slug URL paths.
If not supplied, the value of the handle
attribute of the product is set to the slug version of the title
attribute.
handle
stringOptionalhandle
attribute of the product is set to the slug version of the title
attribute.The status of the product.
The associated images to created or updated.
external_id
stringOptionalThe id of the product in an external system
external_id
stringOptionaltype_id
stringOptionalThe product type id to associate with the product.
type_id
stringOptionalcollection_id
stringOptionalThe product collection to associate with the product.
collection_id
stringOptionaltag_ids
string[]OptionalThe tags to be associated with the product.
tag_ids
string[]Optionalcategory_ids
string[]OptionalThe product categories to associate with the product.
category_ids
string[]OptionalThe product options to be created and associated with the product.
The product variants to be created and associated with the product.
width
numberOptionalThe width of the product.
width
numberOptionalheight
numberOptionalThe height of the product.
height
numberOptionallength
numberOptionalThe length of the product.
length
numberOptionalweight
numberOptionalThe weight of the product.
weight
numberOptionalorigin_country
stringOptionalThe origin country of the product.
origin_country
stringOptionalhs_code
stringOptionalThe HS Code of the product.
hs_code
stringOptionalmaterial
stringOptionalThe material of the product.
material
stringOptionalmid_code
stringOptionalThe MID Code of the product.
mid_code
stringOptionalHolds custom data in key-value pairs.
Output#
ProductDTO[]
ProductDTO[]
ProductDTO[]
ProductDTO[]id
stringThe ID of the product.
id
stringtitle
stringThe title of the product.
title
stringhandle
stringThe handle of the product. The handle can be used to create slug URL paths.
handle
stringsubtitle
null | stringThe subttle of the product.
subtitle
null | stringdescription
null | stringThe description of the product.
description
null | stringis_giftcard
booleanWhether the product is a gift card.
is_giftcard
booleanstatus
ProductStatusThe status of the product.
status
ProductStatusthumbnail
null | stringThe URL of the product's thumbnail.
thumbnail
null | stringwidth
null | numberThe width of the product.
width
null | numberweight
null | numberThe weight of the product.
weight
null | numberlength
null | numberThe length of the product.
length
null | numberheight
null | numberThe height of the product.
height
null | numberorigin_country
null | stringThe origin country of the product.
origin_country
null | stringhs_code
null | stringThe HS Code of the product.
hs_code
null | stringmid_code
null | stringThe MID Code of the product.
mid_code
null | stringmaterial
null | stringThe material of the product.
material
null | stringThe associated product collection.
collection_id
null | stringThe associated product collection id.
collection_id
null | stringThe associated product type.
type_id
null | stringThe associated product type id.
type_id
null | stringThe associated product tags.
The associated product variants.
The associated product options.
The associated product images.
external_id
null | stringThe ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain
a reference to the ID in the integrated service.
external_id
null | stringcreated_at
string | DateWhen the product was created.
created_at
string | Dateupdated_at
string | DateWhen the product was updated.
updated_at
string | Datedeleted_at
string | DateWhen the product was deleted.
deleted_at
string | DateThe associated product categories.
discountable
booleanOptionalWhether the product can be discounted.
discountable
booleanOptionalHolds custom data in key-value pairs.
Was this page helpful?