# x402toll Margin & Markup Calculator

> x402toll Margin & Markup Calculator is a paid API for AI agents from x402toll.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Given a cost and one of price, target margin %, or markup %, computes the remaining pricing metrics including margin, markup, and profit.

## Facts

- Endpoint: POST https://x402toll.com/v1/commerce/margin
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402toll-margin-markup-calculator-4e790d28
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_c4LgLtf1aO-mN_wJAFprT

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402toll-margin-markup-calculator-4e790d28 -d '<json body>'
```

Example prompt: 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?

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Margin, markup, and profit from cost — give cost plus any one of price, target margin %, or markup %, and it solves the rest.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "cost": {
   "type": "number"
  },
  "price": {
   "type": "number"
  },
  "marginPct": {
   "type": "number"
  },
  "markupPct": {
   "type": "number"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402toll-margin-markup-calculator-4e790d28/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402toll.com](https://www.zero.xyz/host/x402toll.com/llms.txt)
