set_prices_by_margin
Sets every variant’s price from its own production cost to reach a target profit margin, avoiding wrong margins across size tiers. Then updates channel listings accordingly.
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]
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. |