> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mercurjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# confirmProductsWorkflow

> Approve proposed products and publish them to the catalog.

Approves products awaiting review: validates every product is in `proposed` status, sets them to `published`, and records a confirmed `STATUS_CHANGE` audit action per product. Triggered by `POST /admin/products/:id/confirm`. Emits `product.published` with one `{ id, internal_note }` entry per product.

## Usage

```ts theme={null}
import { confirmProductsWorkflow } from "@mercurjs/core/workflows"

await confirmProductsWorkflow(container).run({
  input: {
    product_ids: ["prod_01H..."],
    actor_id: "user_01H...",
    internal_note: "Approved after review",
  },
})
```

## Input

<ParamField body="product_ids" type="string[]" required>
  Ids of the products to publish. Every product must currently be in `proposed` status.
</ParamField>

<ParamField body="actor_id" type="string">
  Actor id recorded on the audit trail entry.
</ParamField>

<ParamField body="internal_note" type="string">
  Operator-only note stored on the audit change and included in the emitted event.
</ParamField>

## Result

<ResponseField name="result" type="void">
  Returns nothing; the products are updated in place.
</ResponseField>

## Hooks

<ResponseField name="productsConfirmed" type="hook">
  Runs after publishing with `{ product_ids, internal_note }`.
</ResponseField>
