Apply bulk price change
apply_bulk_price_changeApply a bulk price change — step 2 of 2, after preview_bulk_price_change. Send the SAME rule, scope and target and the digest the preview returned, copied verbatim and never invented. The plan is recomputed from live prices and refused with CONFLICT if it no longer matches the digest (prices moved, or the rule would compound on a retry) — preview again and show the person the new numbers. Changes real prices: a selling price reaches connected channels where the owner armed price writes; a purchase cost is never published. Returns { affected, skipped }. Needs the owner's "AI may change prices in bulk" switch (Settings → Integrations → Connect AI); without it the call is refused and you should tell the person to ask the owner. Not idempotent for percent rules — never repeat a successful apply. Confirm with the person unless they asked for the change outright. Echoes the workspace.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"digest": "<digest>",
"rule": "<rule>",
"scope": "<scope>"
},
"name": "apply_bulk_price_change"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule | Yes | HOW prices move. The target 'cost' accepts only op 'percent'. Pick the one that matches the request: a percent change, a fixed price, a markup over cost, a discount (and its end), or the old price. | |
| scope | Yes | WHICH products. Prefer a named container (category, brand, supplier, warehouse) when the person says 'all products of …' — it is read back by name in the preview. There is no free filter: a request like 'everything cheaper than 100' is not a scope; find the products first and send their ids. | |
| digest | Yes | The digest returned by preview_bulk_price_change for THIS rule, scope and target — copied verbatim, never invented. If prices moved since, the apply returns CONFLICT and you must preview again. | |
| target | No | WHICH number moves. Omit it to change the product's own selling price. Use {field:'price', currency:'EUR'} for the euro price list, {field:'cost'} for the purchase cost. |