> ## 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.

# confirmProductChangeWorkflow

> Confirm pending ProductChanges and apply their staged actions to the master product.

Confirms one or more pending `ProductChange` records: validates each change exists and is confirmable, marks them `confirmed` with `confirmed_by`, then runs the internal apply engine (`applyProductChangeActionsWorkflow`) to write the staged actions onto the master product. Triggered by `POST /admin/product-changes/:id/confirm`, and internally by `autoConfirmProductChangeWorkflow`. Emits `product-change.confirmed` with one `{ id }` per change.

## Usage

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

await confirmProductChangeWorkflow(container).run({
  input: {
    ids: ["prch_01H..."],
    confirmed_by: "user_01H...",
  },
})
```

## Input

<ParamField body="ids" type="string[]" required>
  Ids of the product changes to confirm. Each must exist and be in a confirmable (`pending`) state.
</ParamField>

<ParamField body="confirmed_by" type="string">
  Actor id recorded as the confirmer on each change.
</ParamField>

<ParamField body="internal_note" type="string">
  Operator-only note stored on each confirmed change.
</ParamField>

<ParamField body="external_note" type="string">
  Vendor-facing note stored on each confirmed change.
</ParamField>

<ParamField body="additional_data" type="object">
  Arbitrary data forwarded to the `productChangeConfirmed` hook.
</ParamField>

## Result

<ResponseField name="result" type="void">
  Returns nothing; the changes are confirmed and their actions applied in place.
</ResponseField>

## Hooks

<ResponseField name="validate" type="hook">
  Runs first with `{ input }` — use it to block confirmation of specific changes.
</ResponseField>

<ResponseField name="productChangeConfirmed" type="hook">
  Runs after actions are applied with `{ ids, additional_data }`.
</ResponseField>
