product Variants Bulk Update
Requires access scope. Also: The user must have a permission to update product variants.
Updates multiple product variants for a single product in one operation. You can run this mutation directly or as part of a bulk operation for large-scale catalog updates.
Use the mutation to efficiently modify product variants—such as different sizes,
colors, or materials—associated with an existing product. The mutation is helpful if you need to update a
product's variants in bulk, such as importing from an external system.
The mutation supports:
- Updating variants with custom options and values
- Associating media (for example, images, videos, and 3D models) with the product or its variants
- Handling complex product configurations
By default, stores have a limit of 100 product variants for each product. You can create a development store and enable the Extended Variants developer preview to update a maximum of 2,048 product variants in a single operation.
After creating variants, you can make additional changes using the
mutation,
which is used to perform multiple operations on products, such as creating or modifying product options and variants.
You can also specifically manage product options through related mutations:
Learn more about the product model and adding product data.
Arguments
- Anchor to allowPartialUpdatesallow•Boolean
Partial Updates Default:false When partial updates are allowed, valid variant changes may be persisted even if some of the variants updated have invalid data and cannot be persisted. When partial updates are not allowed, any error will prevent all variants from updating.
- Anchor to mediamedia•[Create
Media Input!] List of new media to be added to the product.
- Anchor to productIdproduct•ID!
Id required The ID of the product associated with the variants to update.
- Anchor to variantsvariants•[Product
Variants Bulk Input!]! required An array of product variants to update.
- Anchor to productproduct•Product
The updated product object.
- Anchor to productVariantsproduct•[Product
Variants Variant!] The updated variants.
- Anchor to userErrorsuser•[Product
Errors Variants Bulk Update User Error!]! non-null The list of errors that occurred from executing the mutation.