Skip to content
Fourohtwo

agents.writerslogic.com/api/v1/minor-units

Converts up to 200 money amounts between decimal strings and integer minor units (cents, yen, fils) using the ISO 4217 exponent from the SIX Group list, for an agent about to send an amount to a payment API. Returns the exponent, the integer minor amount and the canonical decimal string; JPY is 0, KWD and BHD are 3, CLF is 4. An amount with more fraction digits than the currency allows fails with

BaseUnchecked
POSThttps://agents.writerslogic.com/api/v1/minor-units

UptimeNot checked yet

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://agents.writerslogic.com/api/v1/minor-units", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"items":[{"amount":"1500","currency":"JPY"},{"minor":12345,"currency":"KWD"},{"amount":"19.999","currency":"USD"}]}),
});
console.log(await res.json());

Example input

{
  "items": [
    {
      "amount": "1500",
      "currency": "JPY"
    },
    {
      "minor": 12345,
      "currency": "KWD"
    },
    {
      "amount": "19.999",
      "currency": "USD"
    }
  ]
}