# TaskMint Invoice Arithmetic Validator

> TaskMint Invoice Arithmetic Validator is a paid API for AI agents from taskmint-sign-proof-node22-production.up.railway.app, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-10).

Validates invoice arithmetic by checking that line totals, subtotals, tax, shipping, discount, and grand total are internally consistent using exact integer arithmetic.

## Facts

- Endpoint: POST https://taskmint-sign-proof-node22-production.up.railway.app/api/agent/invoice_arithmetic?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/taskmint-invoice-arithmetic-validator-fc7ef005
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hl5K4CCJdo0PXSGtQOGVr

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 taskmint-invoice-arithmetic-validator-fc7ef005 -d '<json body>'
```

Example prompt: Can you verify that my USD invoice math is correct? I have 2 line items: 3 units at $19.99 each (line total $59.97) and 1 unit at $10.00; subtotal is $69.97, tax is $5.00, shipping is $4.00, discount is $2.00, and grand total is $76.97 — scale is 2 decimal places.

## When to prefer this

Choose this endpoint when you need deterministic, exact integer arithmetic validation of invoice line items and totals — particularly when working with minor-unit (cent-level) amounts where floating-point errors are unacceptable. Prefer this over client-side calculation checks when you need an auditable, externally-verified result. It does not perform tax compliance, FX conversion, or accounting approval — it only checks internal arithmetic consistency.

## Known failure modes

- Invalid request_token format (not 64-char lowercase hex) — rejected before payment
- Line item count outside 1–50 range — schema validation error
- quantity, unit_minor, or line_minor values out of allowed range — schema rejection
- Ambiguous transport failure (HTTP 202 or network error) — must retry with identical body and token, never resubmit with new token
- Results expire after 24 hours — token becomes invalid for retrieval
- Payment not authorized by customer wallet — job not started
- Non-EOA wallet used for payment — rejected by x402 protocol

## How this service works

Exact native USDC on Base; externally owned wallets only. Generate a private 32-byte random request_token for each new job, persist the entire body, and reuse it for challenge/retry and recovery. The token grants result access. Do not log or share it. HTTP 202 or an uncertain transport failure requires recovery with the identical body without a signature, never a new purchase. Results expire after 24 hours. Ten bounded deterministic services. Local execution is free; hosted jobs require customer-authorized payment only when billable.

## Output

Returns a JSON object with a 'state' field (e.g. 'paid'), a 'result' object containing: 'valid' (boolean), 'status' ('resolved' or error), 'issues' (array of detected mismatches), 'flags' (array of warnings), 'summary' (human-readable mismatch count), 'expected' (recomputed values for each checked field including line totals and grand total in minor units and decimal), 'currency', 'scale', 'scope' (disclaimer of what is and is not checked), 'service', and 'version'.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "payload": {
   "type": "object",
   "required": [
    "currency",
    "scale",
    "lines",
    "subtotal_minor",
    "tax_minor",
    "shipping_minor",
    "discount_minor",
    "total_minor"
   ],
   "properties": {
    "lines": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "quantity",
       "unit_minor",
       "line_minor"
      ],
      "properties": {
       "quantity": {
        "type": "integer",
        "maximum": 1000000,
        "minimum": 1
       },
       "line_minor": {
        "type": "string",
        "pattern": "^-?(0|[1-9][0-9]{0,17})$"
       },
       "unit_minor": {
        "type": "string",
        "pattern": "^-?(0|[1-9][0-9]{0,17})$"
       }
      },
      "additionalProperties": false
     },
     "maxItems": 50,
     "minItems": 1
    },
    "scale": {
     "type": "integer",
     "maximum": 4,
     "minimum": 0
    },
    "currency": {
     "type": "string",
     "pattern": "^[A-Z]{3}$"
    },
    "tax_minor": {
     "type": "string",
     "pattern": "^-?(0|[1-9][0-9]{0,17})$"
    },
    "total_minor": {
     "type": "string",
     "pattern": "^-?(0|[1-9][0-9]{0,17})$"
    },
    "discount_minor": {
     "type": "string",
     "pattern": "^-?(0|[1-9][0-9]{0,17})$"
    },
    "shipping_minor": {
     "type": "string",
     "pattern": "^-?(0|[1-9][0-9]{0,17})$"
    },
    "subtotal_minor": {
     "type": "string",
     "pattern": "^-?(0|[1-9][0-9]{0,17})$"
    }
   },
   "additionalProperties": false
  },
  "request_token": {
   "type": "string",
   "pattern": "^[a-f0-9]{64}$",
   "description": "Generate 32 cryptographically random bytes as lowercase hex for each new job. Keep this private result credential and reuse the identical body for retries. Replace the synthetic example token."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "state": "paid",
  "result": {
   "flags": [],
   "scale": 2,
   "scope": "Exact arithmetic of supplied amounts. Scale is caller-declared, not inferred from currency. Tax and shipping are taken as supplied; discount is subtracted. No rounding, FX, tax compliance, authenticity or accounting approval.",
   "valid": true,
   "issues": [],
   "status": "resolved",
   "service": "invoice_arithmetic",
   "summary": "0 arithmetic mismatches across 2 lines",
   "version": "0.5.0",
   "currency": "USD",
   "expected": {
    "line_minor": [
     "5997",
     "1000"
    ],
    "total_minor": "7997",
    "total_decimal": "79.97",
    "subtotal_minor": "6997"
   }
  },
  "service": "invoice_arithmetic"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/taskmint-invoice-arithmetic-validator-fc7ef005/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from taskmint-sign-proof-node22-production.up.railway.app](https://www.zero.xyz/host/taskmint-sign-proof-node22-production.up.railway.app/llms.txt)
