{"uid":"cap_c4LgLtf1aO-mN_wJAFprT","slug":"x402toll-margin-markup-calculator-4e790d28","name":"x402toll Margin & Markup Calculator","description":"Margin, markup, and profit from cost — give cost plus any one of price, target margin %, or markup %, and it solves the rest.","url":"https://x402toll.com/v1/commerce/margin","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"cost":{"type":"number"},"price":{"type":"number"},"marginPct":{"type":"number"},"markupPct":{"type":"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_3XAtwQk_IZF6wtZ_g_yXs","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":"Given a cost and one of price, target margin %, or markup %, computes the remaining pricing metrics including margin, markup, and profit.","exampleAgentPrompt":"My product costs me $24 to make and I'm selling it for $40 — can you calculate the profit margin, markup percentage, and profit I'm making on each unit?","exampleUseCases":null,"resultDescription":"Returns the full set of pricing metrics: margin percentage, markup percentage, profit amount, and price — solving for whichever values were not provided given cost and one other input.","failureModes":["Missing cost field — returns error as cost is always required","No second parameter provided (price, marginPct, or markupPct) — system cannot solve without at least one additional input","Contradictory inputs (e.g. both price and marginPct provided but they conflict) — may return unexpected or overspecified results","Invalid numeric types passed — validation error","Margin or markup values outside logical bounds (e.g. margin >= 100%) — may produce infinite or nonsensical results"],"whenToPreferThis":"Use this endpoint when you need to quickly compute pricing metrics for a product given cost and any one of price, target margin, or markup — especially useful for retail pricing, e-commerce, and business planning where you know cost and need to derive consistent margin and markup figures without building your own formula.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:55:22.896Z","isFirstParty":false}