createProductVariantsStep - Medusa Core Workflows Reference
This documentation provides a reference to the createProductVariantsStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step creates one or more product variants.
Example#
Input#
CreateProductVariantDTO[]
CreateProductVariantDTO[]
CreateProductVariantDTO[]
CreateProductVariantDTO[]title
stringThe tile of the product variant.
title
stringproduct_id
stringOptionalThe id of the product
product_id
stringOptionalsku
stringOptionalThe SKU of the product variant.
sku
stringOptionalbarcode
stringOptionalThe barcode of the product variant.
barcode
stringOptionalean
stringOptionalThe EAN of the product variant.
ean
stringOptionalupc
stringOptionalThe UPC of the product variant.
upc
stringOptionalallow_backorder
booleanOptionalWhether the product variant can be ordered when it's out of stock.
allow_backorder
booleanOptionalmanage_inventory
booleanOptionalWhether the product variant's inventory should be managed by the core system.
manage_inventory
booleanOptionalThe variant's inventory items. It's only
available if manage_inventory
is enabled.
manage_inventory
is enabled.hs_code
stringOptionalThe HS Code of the product variant.
hs_code
stringOptionalorigin_country
stringOptionalThe origin country of the product variant.
origin_country
stringOptionalmid_code
stringOptionalThe MID Code of the product variant.
mid_code
stringOptionalmaterial
stringOptionalThe material of the product variant.
material
stringOptionalweight
numberOptionalThe weight of the product variant.
weight
numberOptionallength
numberOptionalThe length of the product variant.
length
numberOptionalheight
numberOptionalThe height of the product variant.
height
numberOptionalwidth
numberOptionalThe width of the product variant.
width
numberOptionaloptions
Record<string, string>OptionalThe options of the variant. Each key is an option's title, and value
is an option's value. If an option with the specified title doesn't exist,
a new one is created.
options
Record<string, string>OptionalHolds custom data in key-value pairs.
Output#
ProductVariantDTO[]
ProductVariantDTO[]
ProductVariantDTO[]
ProductVariantDTO[]id
stringThe ID of the product variant.
id
stringtitle
stringThe tile of the product variant.
title
stringsku
null | stringThe SKU of the product variant.
sku
null | stringbarcode
null | stringThe barcode of the product variant.
barcode
null | stringean
null | stringThe EAN of the product variant.
ean
null | stringupc
null | stringThe UPC of the product variant.
upc
null | stringallow_backorder
booleanWhether the product variant can be ordered when it's out of stock.
allow_backorder
booleanmanage_inventory
booleanWhether the product variant's inventory should be managed by the core system.
manage_inventory
booleanrequires_shipping
booleanWhether the product variant's requires shipping.
requires_shipping
booleanhs_code
null | stringThe HS Code of the product variant.
hs_code
null | stringorigin_country
null | stringThe origin country of the product variant.
origin_country
null | stringmid_code
null | stringThe MID Code of the product variant.
mid_code
null | stringmaterial
null | stringThe material of the product variant.
material
null | stringweight
null | numberThe weight of the product variant.
weight
null | numberlength
null | numberThe length of the product variant.
length
null | numberheight
null | numberThe height of the product variant.
height
null | numberwidth
null | numberThe width of the product variant.
width
null | numberThe associated product options.
metadata
null | Record<string, unknown>Holds custom data in key-value pairs.
metadata
null | Record<string, unknown>product_id
null | stringThe associated product id.
product_id
null | stringcreated_at
string | DateWhen the product variant was created.
created_at
string | Dateupdated_at
string | DateWhen the product variant was updated.
updated_at
string | Datedeleted_at
string | DateWhen the product variant was deleted.
deleted_at
string | DateThe associated product.
variant_rank
null | numberOptionalhe ranking of the variant among other variants associated with the product.
variant_rank
null | numberOptionalWas this page helpful?