Skip to main content
Validates the seller can be suspended, sets status to suspended, records the reason, and stamps rejected_at on first suspension. Triggered by POST /admin/sellers/:id/suspend. Emits seller.suspended.

Usage

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

await suspendSellerWorkflow(container).run({
  input: { seller_id: "sel_123", reason: "Policy violation" },
})

Input

seller_id
string
required
Id of the seller to suspend.
reason
string
Reason stored in status_reason.

Result

result
void
Nothing is returned.

Hooks

  • sellerSuspended — runs after suspension with { seller_id }.
suspendSellerWorkflow.hooks.sellerSuspended(async ({ seller_id }) => {
  // e.g. pause the seller's listings
})