# WritersLogic Invoice Arithmetic Auditor

> WritersLogic Invoice Arithmetic Auditor is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Recomputes up to 500 invoice lines in exact decimal arithmetic and flags any mismatches between calculated and stated amounts, including line totals, subtotals, tax totals, discount totals, and grand totals.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/invoice-audit?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-invoice-arithmetic-auditor-b633e090
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_q9x2Uh7MGc10mSWlTm6WC

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 writerslogic-invoice-arithmetic-auditor-b633e090 -d '<json body>'
```

Example prompt: Before I approve this invoice for payment, check the math on all the line items — make sure quantity times unit price minus discount equals each line amount, that the tax amounts match the stated 8.5% rate using per-line rounding, and that the subtotal, tax total, and grand total all add up correctly.

## When to prefer this

Use this endpoint when an AI agent needs to arithmetically verify an invoice before approving, paying, or reconciling it, and when exact decimal correctness matters. It is the right choice when you have structured invoice data with quantities, unit prices, discounts, and tax amounts and need to confirm all calculations are consistent. It does not look up tax rates, validate vendor identity, or check purchase-order terms — use other services for those concerns.

## Known failure modes

- Input contains JSON numbers instead of decimal strings — rejected because binary floats introduce imprecision
- More than 500 line items submitted — request rejected with a validation error
- Tax rate supplied without a corresponding tax amount — result marked as unknown, no tax is inferred
- Missing required fields (quantity, unitPrice, or amount) on any line — validation error returned
- Malformed decimal strings not matching the allowed pattern — schema validation error

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

A structured report listing every arithmetic mismatch found: each entry identifies the JSON path of the erroneous field, the rule that was violated (e.g. quantity × unit price − discount = line amount), the expected value and actual value both expressed in minor units, and the signed drift. Lines and totals with no mismatch are implicitly correct. Totals not provided in the input are not checked.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "lines": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "quantity",
     "unitPrice",
     "amount"
    ],
    "properties": {
     "id": {
      "type": "string",
      "maxLength": 80
     },
     "amount": {
      "type": "string",
      "pattern": "^-?\\d{1,15}(\\.\\d{1,12})?$",
      "maxLength": 30,
      "description": "Stated net line amount after the line discount."
     },
     "taxRate": {
      "type": "string",
      "pattern": "^-?\\d{1,15}(\\.\\d{1,12})?$",
      "maxLength": 30,
      "description": "Tax rate in percent, e.g. \"7.5\". With taxAmount it is checked. A non-zero rate without taxAmount cannot be checked: the result is unknown, and no tax is inferred."
     },
     "discount": {
      "type": "string",
      "pattern": "^-?\\d{1,15}(\\.\\d{1,12})?$",
      "maxLength": 30,
      "description": "Line discount as a positive amount in major units."
     },
     "quantity": {
      "type": "string",
      "pattern": "^-?\\d{1,15}(\\.\\d{1,12})?$",
      "maxLength": 30,
      "description": "Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."
     },
     "taxAmount": {
      "type": "string",
      "pattern": "^-?\\d{1,15}(\\.\\d{1,12})?$",
      "maxLength": 30,
      "description": "Tax on this line as supplied."
     },
     "unitPrice": {
      "type": "string",
      "pattern": "^-?\\d{1,15}(\\.\\d{1,12})?$",
      "maxLength": 30,
      "description": "Price per unit in major units; sub-cent precision allowed."
     }
    },
    "additionalProperties": false
   },
   "maxItems": 500,
   "minItems": 1
  },
  "stated": {
   "type": "object",
   "properties": {
    "total": {
     "type": "string",
     "pattern": "^-?\\d{1,15}(\\.\\d{1,12})?$",
     "maxLength": 30,
     "description": "Grand total; checked against subtotal + taxTotal."
    },
    "subtotal": {
     "type": "string",
     "pattern": "^-?\\d{1,15}(\\.\\d{1,12})?$",
     "maxLength": 30,
     "description": "Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."
    },
    "taxTotal": {
     "type": "string",
     "pattern": "^-?\\d{1,15}(\\.\\d{1,12})?$",
     "maxLength": 30,
     "description": "Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."
    },
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-invoice-arithmetic-auditor-b633e090/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
