# TradePilot Invoice Totals Calculator

> TradePilot Invoice Totals Calculator is a paid API for AI agents from www.tradepilotusa.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-28).

Calculates subtotal, per-line tax, discount, and deposit amounts from invoice line items using pure arithmetic — no storage or sending involved.

## Facts

- Endpoint: POST https://www.tradepilotusa.com/api/agent-commerce/v1/services/invoice_totals_calculate/execute?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-28
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tradepilot-invoice-totals-calculator-39a2ed91
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_29NPWPyutnkA7f2UFdNWm

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 tradepilot-invoice-totals-calculator-39a2ed91 -d '<json body>'
```

Example prompt: Calculate the totals for my invoice with 3 line items: 5 units at $120 with 8% tax, 2 units at $75 with 0% tax, and 1 unit at $200 with 10% tax — apply a 5% discount and require a 25% deposit.

## When to prefer this

Choose this endpoint when you need deterministic, server-side invoice arithmetic with per-line tax rates (not a flat blanket rate), an optional pre-tax discount, and flexible deposit handling (percent-of-total or fixed amount). Ideal for trade, field service, or contractor workflows where line items carry different tax rates. Prefer this over client-side math when you need an authoritative computed result to display or pass downstream without storing the invoice.

## Known failure modes

- Missing required fields (quantity or rate on any line item) returns a validation error
- line_items array empty or exceeding 200 items is rejected
- discount_percent outside 0–100 range causes a validation failure
- deposit_value negative is rejected
- deposit_type provided without deposit_value or vice versa may cause incomplete calculation
- Non-numeric values in rate, quantity, or tax_percent fields will be rejected

## How this service works

Calculate subtotal, per-line tax, discount and deposit from supplied invoice line items. Per-line tax percent (not a single flat rate), discount applied to the pre-tax subtotal, deposit as a percent-of-total or fixed amount clamped to the total. Pure arithmetic; does not create, store or send an invoice.

## Output

Returns a computed breakdown including subtotal, per-line tax amounts, total tax, post-discount subtotal, deposit amount, and final invoice total — all as numeric values derived from the supplied line items and parameters. No data is stored or transmitted.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "line_items": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "quantity",
     "rate"
    ],
    "properties": {
     "rate": {
      "type": "number",
      "minimum": 0
     },
     "quantity": {
      "type": "number",
      "minimum": 0
     },
     "tax_percent": {
      "type": "number",
      "minimum": 0
     }
    },
    "additionalProperties": false
   },
   "maxItems": 200,
   "minItems": 1
  },
  "deposit_type": {
   "enum": [
    "percent",
    "fixed"
   ]
  },
  "deposit_value": {
   "type": "number",
   "minimum": 0
  },
  "deposit_enabled": {
   "type": "boolean"
  },
  "discount_percent": {
   "type": "number",
   "maximum": 100,
   "minimum": 0
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tradepilot-invoice-totals-calculator-39a2ed91/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.tradepilotusa.com](https://www.zero.xyz/host/www.tradepilotusa.com/llms.txt)
