Replace modifier

View as Markdown
## Replace modifier Replaces the modifier `:id`: it updates the `name` and **rebuilds the whole options list** — every existing option is deleted and recreated from the body. This is a full replacement (`PUT`), not a patch. ### Authentication - Merchant API key in **`x-api-key`** (alias `x-account-api-key`). - Requires **`Merchant.product.update`**. ### Path params - `id` — the modifier UUID. ### Body (application/json) Same shape as create (`CreateModifierDto`): `name` (required) and `options` (required). Each option requires `name` and `price`; `imageUrl` and `enabled` are optional. ### Behavior & side-effects - If the modifier does not exist or belongs to another store: **400 Bad Request** (`Not Found`). - `options: { deleteMany: {}, create: [...] }` — the previous options are **destroyed** and new rows (with new UUIDs) are created. Any option id you held before the call is no longer valid. Returns the updated modifier including its new options. --- **Notas:** Handler: modifierService.update. Uses the same CreateModifierDto as POST — there is no partial update. Options are wiped and recreated on every call, so option ids change.

Authentication

x-api-keystring
API Key authentication via header

Path parameters

idstringRequired
The modifier UUID. Must belong to the authenticated store.

Headers

x-application-account-idstringOptional

Scope the request to a specific store / account instead of the one resolved from the API key. Aliases: the x-account-id header, or the application_account_id / account_id query parameter.

Request

This endpoint expects an object.
namestringRequired
optionslist of objectsRequired