Lowest price for a target margin
price_for_marginLowest whole-cent price that keeps a target profit margin on a selling platform after its fees, for a given cost per item. status is "ok", "not_possible" or "not_practical". With "ok" it returns price_usd, the fee breakdown at that price, profit_usd and the achieved margin. target_margin is a FRACTION of the price (0.30 = 30%). Rates are dated and sourced; read 'assumptions' and 'verify' before quoting. US sellers only. Read-only; sells nothing.
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": {
"platform": "<platform>",
"cost": "<cost>",
"target_margin": "<target_margin>"
},
"name": "price_for_margin"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cost | Yes | Your cost per item sold in USD (materials, labour, packaging you pay). 0 for a digital download with no per-sale cost. | |
| region | No | Buyer location relative to a US seller. "us" (default) = domestic. "international" is only modelled with processor "paypal" (adds PayPal's 1.50% international fee, so 4.99% + $0.49); other combinations return an error rather than a guess. | |
| platform | Yes | Platform and plan id from list_platforms, e.g. "etsy", "payhip-free", "gumroad-direct", "ko-fi-shop". | |
| processor | No | Card processor for platforms where the seller adds their own (Payhip plans, Ko-fi Shop). "stripe" = 2.9% + $0.30 (default). "paypal" = PayPal Checkout or Guest Checkout, 3.49% + $0.49. Ignored, with a note, for platforms that charge their own processing (Etsy, Shopify, Gumroad, Notion, Square). | |
| target_margin | Yes | Target profit margin as a FRACTION of the price: profit / price. 0.30 means 30%. Must be at least 0 and under 1. A value like 30 is rejected as a percent. Margins below 0.0001 are treated as 0. Within 0.01 of the platform's maximum (1 minus its percentage fees) the answer is status "not_practical". | |
| buyer_tax_rate | No | Buyer's sales tax as a FRACTION, e.g. 0.07 for 7%. Default 0. Tax is never profit; it only raises card processing on platforms that charge processing on the tax-inclusive total (see each platform's tax_base). | |
| processor_rate | No | Advanced override: your own card processor percentage as a FRACTION (0.029 = 2.9%). Only for platforms where the seller adds their own processor. Replaces the preset's rate. | |
| price_floor_usd | No | Lowest price to suggest, in USD. Default 1.00 (Marginrule's assumption, not a platform rule). 0 turns the floor off. | |
| processor_fixed_usd | No | Advanced override: your card processor's fixed fee per sale in USD, e.g. 0.30. Replaces the preset's fixed fee. |