# x402toll Order Total Calculator

> x402toll Order Total 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).

Computes the final order total from subtotal, optional discount (percent or amount), tax rate, and shipping, with configurable tax-on-shipping behavior.

## Facts

- Endpoint: POST https://x402toll.com/v1/commerce/order-total
- 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-order-total-calculator-e116406e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_eEnli4iMZcbeP3Rwbxka9

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-order-total-calculator-e116406e -d '<json body>'
```

Example prompt: Calculate the final order total for a cart with a $120.00 subtotal, a 15% discount, 8.5% tax rate, and $9.99 shipping — and tax should apply to shipping too.

## When to prefer this

Use this endpoint when you need a fast, deterministic order total calculation that handles discounts (percentage or flat), tax rates, and shipping in a single call — especially when you want configurable tax-on-shipping behavior. Prefer this over building custom arithmetic when accuracy and auditability of the commerce math matter.

## Known failure modes

- Missing required subtotal field returns a validation error
- Negative values for subtotal or shipping may produce unexpected results
- Both discountPct and discountAmount supplied may cause ambiguity in discount application
- Invalid types (e.g. string instead of number) return a schema validation error
- Payment not completed (x402 flow) returns 402 Payment Required

## How this service works

Order total from subtotal, discount, tax rate, and shipping — tax excludes shipping by default (toggle with taxShipping).

## Output

Returns a computed breakdown including the discounted subtotal, tax amount, shipping, and the final order total, reflecting whether shipping is included in the tax base.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "shipping": {
   "type": "number",
   "default": 0
  },
  "subtotal": {
   "type": "number"
  },
  "taxRatePct": {
   "type": "number",
   "default": 0
  },
  "discountPct": {
   "type": "number"
  },
  "taxShipping": {
   "type": "boolean",
   "default": false
  },
  "discountAmount": {
   "type": "number"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402toll-order-total-calculator-e116406e/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)
