updateProductVariantsStep - Medusa Core Workflows Reference
This documentation provides a reference to the updateProductVariantsStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step updates one or more product variants.
Example#
To update product variants by their ID:
To update product variants matching a filter:
Input#
UpdateProductVariantsStepInput
UpdateProductVariantsStepInputThe details of the product variants update.
UpdateProductVariantsStepInput
UpdateProductVariantsStepInputselector
FilterableProductVariantPropsThe filters to select the product variants to update.
selector
FilterableProductVariantPropsupdate
UpdateProductVariantDTOThe data to update the product variants with.
update
UpdateProductVariantDTOproduct_variants
UpsertProductVariantDTO[]The data to create or update product variants.
product_variants
UpsertProductVariantDTO[]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?