{"uid":"cap_xp9kfa89BVRy3pyjDvAe4","slug":"pricing-math-markup-margin-converter-c032fd61","name":"Pricing Math: Markup-Margin Converter","description":"Convert markup to margin and back, and get the selling price, from a cost plus one of markup, margin or price.","url":"https://pricing-math.x402tookit.com/markup-margin?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["cost"],"properties":{"cost":{"type":"number","description":"Unit cost"},"price":{"type":"number","description":"Selling price"},"marginPct":{"type":"number","description":"Gross margin on price, percent (below 100)"},"markupPct":{"type":"number","description":"Markup on cost, percent. Give exactly one of markupPct, marginPct, price"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"cost":{"type":["null","number"]},"price":{"type":["null","number"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"marginPct":{"type":["null","number"]},"markupPct":{"type":["null","number"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"profitPerUnit":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_KWH7uK7B_UVZdqG_bpaan","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts between markup percentage and margin percentage, and calculates selling price from cost plus one of markup, margin, or price.","exampleAgentPrompt":"My unit cost is $45 and I want a 35% gross margin — what should my selling price be, and what's the equivalent markup percentage?","exampleUseCases":[{"title":"Retailer setting price from cost and margin","prompt":"I buy widgets at $12.50 each and need a 40% gross margin on the selling price — what should I charge, and what markup percent does that work out to?"},{"title":"Converting markup to margin for financial reporting","prompt":"Our pricing team uses a 60% markup on cost, but our finance team wants the gross margin percentage instead — can you convert 60% markup to its equivalent margin?"},{"title":"Reverse-engineering margin from known cost and price","prompt":"I know my cost is $80 and I'm selling at $120 — what's my gross margin percentage and what markup am I applying?"}],"resultDescription":"Returns a structured object with cost, selling price, markup percentage, margin percentage, and profit per unit. Also includes a summary string and optional disclaimer or degraded flag.","failureModes":["Missing required 'cost' parameter returns a validation error","Supplying more than one of markupPct, marginPct, or price causes ambiguity — only one should be provided","marginPct >= 100 is mathematically invalid and will be rejected","Non-numeric values for cost or percentage fields result in schema validation errors","Payment failure (402) if x402 USDC payment is not included or insufficient"],"whenToPreferThis":"Use this endpoint when you need to programmatically convert between retail markup and gross margin, or derive a selling price from cost and a target margin or markup. Prefer it over manual formulas when building pricing tools, retail agents, or financial calculators that need reliable, schema-validated results with all three pricing metrics returned together.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:12:39.692Z","isFirstParty":false,"canonicalSlug":"pricing-math-markup-margin-converter-c032fd61"}