Catalog/ecom-margin-markup

Calculators

Margin <-> markup converter API

Convert between margin and markup (markup = margin/(1−margin); margin = markup/(1+markup)) and, given cost, derive price and profit per unit. Deterministic pricing conversion agents commonly confuse. Answers 'convert margin to markup','what markup gives a 40% margin','price from cost and markup'.

Price$0.01per request
MethodPOST
Route/v1/calc/ecom-margin-markup
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
ecommarginmarkuppricingconversionprofitretailcalc
API URLhttps://x402.hexl.dev/v1/calc/ecom-margin-markup
Integration docs
Example request
{
  "marginPercent": 40,
  "cost": 60
}
Example response
{
  "formula": "markup = margin / (1 − margin); margin = markup / (1 + markup)",
  "marginPercent": 40,
  "markupPercent": 66.67,
  "cost": 60,
  "price": 100,
  "profitPerUnit": 40
}
Input schema
{
  "type": "object",
  "required": [],
  "properties": {
    "marginPercent": {
      "type": "number",
      "description": "0-100 (supply exactly one of margin/markup)",
      "examples": [
        40
      ]
    },
    "markupPercent": {
      "type": "number",
      "description": "Supply exactly one of margin/markup",
      "examples": [
        66.67
      ]
    },
    "cost": {
      "type": "number",
      "description": "Optional, to derive price/profit",
      "examples": [
        60
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}