Skip to main content
Deletes attribute values by id. When the deleted values belong to a single variant-axis multi_select attribute with a mirror ProductOption, the option’s value list is rewritten to the attribute’s remaining value names. Triggered by DELETE /admin/product-attributes/:id/values/:value_id; also run internally by the batch update engine. Emits product-attribute-value.deleted.

Usage

import { deleteProductAttributeValuesWorkflow } from "@mercurjs/core/workflows"

await deleteProductAttributeValuesWorkflow(container).run({
  input: { ids: ["pattrval_123", "pattrval_456"] },
})

Input

ids
string[]
required
Ids of the attribute values to delete.
additional_data
object
Custom data passed through to the hooks.

Result

result
void
No return value.

Hooks

  • validate — runs before deletion with { input }.
  • productAttributeValuesDeleted — runs after deletion with { ids, additional_data }.