Calculators
Profit per unit, margin & markup API
Compute profit per unit (price − unitCost − fees − shipping) plus margin% and markup% with a rating bucket. Deterministic unit economics. Answers 'what is my profit per unit after fees and shipping','margin and markup on this product'.
Price$0.01per request
MethodPOST
Route/v1/calc/ecom-profit-per-unit
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
ecomprofitmarginmarkupunit-economicspricingecommercecalc
API URL
Integration docshttps://x402.hexl.dev/v1/calc/ecom-profit-per-unitExample request
{
"price": 100,
"unitCost": 40,
"fees": 15,
"shipping": 8
}Example response
{
"formula": "profit = price − unitCost − fees − shipping; margin = profit / price; markup = profit / cost",
"price": 100,
"unitCost": 40,
"fees": 15,
"shipping": 8,
"totalCost": 63,
"profitPerUnit": 37,
"marginPercent": 37,
"markupPercent": 58.73,
"rating": "thin"
}Input schema
{
"type": "object",
"required": [
"price",
"unitCost"
],
"properties": {
"price": {
"type": "number",
"examples": [
100
]
},
"unitCost": {
"type": "number",
"examples": [
40
]
},
"fees": {
"type": "number",
"examples": [
15
]
},
"shipping": {
"type": "number",
"examples": [
8
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}