# Pricing Math: Markup-Margin Converter

> Pricing Math: Markup-Margin Converter is a paid API for AI agents from pricing-math.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Converts between markup percentage and margin percentage, and calculates selling price from cost plus one of markup, margin, or price.

## Facts

- Endpoint: GET https://pricing-math.x402tookit.com/markup-margin?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pricing-math-markup-margin-converter-c032fd61
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xp9kfa89BVRy3pyjDvAe4

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 pricing-math-markup-margin-converter-c032fd61
```

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

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Convert markup to margin and back, and get the selling price, from a cost plus one of markup, margin or price.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
       ]
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pricing-math-markup-margin-converter-c032fd61/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pricing-math.x402tookit.com](https://www.zero.xyz/host/pricing-math.x402tookit.com/llms.txt)
