Set prices by target margin
set_prices_by_marginSets each product variant’s price from its own cost to achieve a target profit margin, then re-syncs connected sales channels. Use per-variant pricing when costs vary by size.
Instructions
Set each variant's price to hit a target profit margin off its OWN cost: price = cost / (1 - margin). Reads per-variant production cost (populated after the fulfillment sync), applies a per-variant price, then re-syncs connected channels. Use this instead of one flat price when costs tier by size (larger sizes cost more, so a single price gives a different margin per size — and can go negative on the biggest). Requires store_uuid (cost lives on the store-products list, not product detail).
[#54cd6b]
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": {
"product_uuid": "<product_uuid>",
"store_uuid": "<store_uuid>",
"margin": "<margin>"
},
"name": "set_prices_by_margin"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| margin | Yes | Target profit margin as a fraction of the selling price, e.g. 0.15 = 15%. | |
| workspace | No | ||
| store_uuid | Yes | The store the product is in — needed to read per-variant cost and to re-sync channels. | |
| product_uuid | Yes | ||
| also_update_channels | No | Default true. |