Skip to main content

bulkDeleteProductVariants

Requires permission products:product:delete.

Soft-delete a set of variants by id. Never leaves a product variant-less (per-item LAST_VARIANT failure) and promotes a new default variant when the default is deleted.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation BulkDeleteProductVariants($input: ProductVariantBulkDeleteInput!) {
bulkDeleteProductVariants(input: $input) {
id
status
type
createdAt
error
failed
failures {
id
code
name
message
sku
}
}
}

Variables:

{
"input": {
"variantIds": [
"id"
]
}
}

Response:

{
"data": {
"bulkDeleteProductVariants": {
"id": "id",
"status": "COMPLETED",
"type": "PRODUCT_BULK_DELETE",
"createdAt": "2025-01-15T00:00:00Z",
"error": "string",
"failed": 0,
"failures": [
{
"id": "id",
"code": "string",
"name": "string",
"message": "string",
"sku": "string"
}
]
}
}
}
bulkDeleteProductVariants(
input: ProductVariantBulkDeleteInput!
): ProductBulkOperation!

Arguments​

bulkDeleteProductVariants.input ● ProductVariantBulkDeleteInput! non-null input​

The details of the product variant bulk delete request.

Type​

ProductBulkOperation object​

A bulk product delete and how far it has got.