Skip to main content

deleteProductVariant

Requires permission products:product:delete.

Deletes a variant. The last remaining variant of a product cannot be deleted. Requires permission to delete products.

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 DeleteProductVariant($id: ID!) {
deleteProductVariant(id: $id) {
id
QRCode
name
createdAt
attributes
barcode
baseUOM {
id
code
colorCode
name
pluralName
createdAt
}
}
}

Variables:

{
"id": "id"
}

Response:

{
"data": {
"deleteProductVariant": {
"id": "id",
"QRCode": "string",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"attributes": {},
"barcode": "string",
"baseUOM": {
"id": "id",
"code": "string",
"colorCode": "string",
"name": "string",
"pluralName": "string",
"createdAt": "2025-01-15T00:00:00Z"
}
}
}
}
deleteProductVariant(
id: ID!
): ProductVariant!

Arguments​

deleteProductVariant.id ● ID! non-null scalar​

The ID of the variant.

Type​

ProductVariant object​

A sellable version of a product, with its own SKU, price, units of measure and stock.