Cash rounding to the smallest payable coin (CHF, CAD, SEK, AUD or a caller rule)

$0.005 USDC per call · Business, finance and compliance · POST /api/v1/cash-rounding · Id cash-rounding

Rounds up to 100 final cash totals to the smallest payable increment, for an agent computing what a customer actually pays in cash or the change owed. Built-in rules exist only for currencies with an official source: CHF 0.05 (Münzverordnung SR 941.101), CAD 0.05 (Government of Canada), SEK 1 (Lag 1970:1029), AUD 0.05 (Consumer Protection WA); any other currency needs a caller increment. Rounds the total only, never line items; card and electronic payments pass through unrounded where the source says so. A sub-cent tie the source does not settle returns unknown with both candidate amounts. Not a tax or invoice calculator.

What you get

Cash rounding rules differ by country and apply to the total, not the lines; a wrong tie or increment misstates change. 100 totals per $0.005.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/cash-rounding. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/cash-rounding \
  -H 'content-type: application/json' \
  -d '{"items":[{"amount":"10.02","currency":"CHF"},{"amount":"10.03","currency":"CAD"},{"amount":"10.025","currency":"CHF"},{"amount":"49.50","currency":"SEK"}]}'

Input

FieldTypeRequiredDescription
itemsarray<object>; max 100 itemsyes

Example request body

{
  "items": [
    {
      "amount": "10.02",
      "currency": "CHF"
    },
    {
      "amount": "10.03",
      "currency": "CAD"
    },
    {
      "amount": "10.025",
      "currency": "CHF"
    },
    {
      "amount": "49.50",
      "currency": "SEK"
    }
  ]
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
itemsarray<object>no
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the money-math-kit package.

Machine-readable