Skip to main content
Deletes the given offers and emits offer.deleted with each offer’s id and product_id. Triggered by DELETE /vendor/offers/:id, DELETE /admin/offers/:id, and the offer batch routes.

Usage

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

await deleteOffersWorkflow(container).run({
  input: { ids: ["offer_123"] },
})

Input

ids
string[]
required
IDs of the offers to delete.
additional_data
object
Custom data passed through to the workflow hooks.

Result

result
void
No return value; the offers are deleted.

Hooks

  • offersDeleted — runs after deletion with { ids, additional_data }.
deleteOffersWorkflow.hooks.offersDeleted(async ({ ids, additional_data }) => {
  // react to deleted offers
})