# WritersLogic Cash Rounding

> WritersLogic Cash Rounding 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).

Rounds up to 100 final cash totals to the smallest legally payable increment for a given currency, returning the rounded amount or change owed

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/cash-rounding?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-cash-rounding-1d546fdc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Pm6W0yrFNSfdc4JlCDdU-

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-cash-rounding-1d546fdc -d '<json body>'
```

Example prompt: The customer's total is 47.83 CHF — what should they actually pay in cash, rounded to the smallest legal Swiss franc increment?

## When to prefer this

Use this endpoint when you need legally defensible cash rounding for CHF, CAD, SEK, or AUD (using official government sources), or when you need to apply a custom cash-rounding increment for any other currency. Prefer it over generic rounding libraries because it encodes authoritative national rules, distinguishes cash vs electronic tender, handles tie-breaking modes, and processes up to 100 totals in a single call. Do not use it for rounding individual line items, tax calculations, or invoice generation.

## Known failure modes

- Currency not in built-in rules and no caller increment provided — returns an error requiring an explicit increment
- Amount string uses invalid format (e.g. JSON number instead of decimal string) — rejected with schema validation error
- More than 100 items submitted — request rejected
- Increment value of zero or negative submitted — rejected
- Unknown currency code (non-ISO 4217) — error response

## How this service works

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

## Output

For each submitted item, the endpoint returns the rounded payable amount for cash transactions (or the unrounded pass-through for electronic/card), the increment used, the rounding rule applied, and — if the amount falls on an exact tie that the authoritative source does not resolve — an 'unknown' status along with both candidate amounts.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "items": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "amount"
    ],
    "properties": {
     "amount": {
      "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."
     },
     "tender": {
      "enum": [
       "cash",
       "electronic"
      ],
      "type": "string",
      "description": "Default cash."
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$",
      "description": "ISO 4217 alphabetic code, upper case."
     },
     "rounding": {
      "enum": [
       "half-up",
       "half-down",
       "half-even",
       "up",
       "down",
       "ceiling",
       "floor"
      ],
      "type": "string",
      "description": "Tie mode only: an exact tie between two payable amounts under a caller increment or a built-in rule that states no tie rule. Any other amount rounds to the nearest payable amount, and a tie rule the cited source states (SEK) wins. half-up: ties away from zero. half-down: ties toward zero. half-even: ties to the even neighbour. up: away from zero. down: toward zero. ceiling: toward +infinity. floor: toward -infinity."
     },
     "increment": {
      "type": "string",
      "pattern": "^-?\\d{1,15}(\\.\\d{1,12})?$",
      "maxLength": 30,
      "description": "Caller rule: smallest payable amount in major units, e.g. \"0.05\". Overrides the built-in rule."
     }
    },
    "additionalProperties": false
   },
   "maxItems": 100,
   "minItems": 1
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-cash-rounding-1d546fdc/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)
