Concepts

Money, dates and IDs

How amounts, currencies, dates and record IDs are written.

Amounts are cents, written as strings

Every amount is a whole number of the currency's smallest unit, written as a string: "1250" is $12.50 in Canadian dollars. Strings keep large amounts exact in every language, where floating-point numbers can't. Fields that hold amounts end in Minor, such as amountMinor and taxMinor.

JSON
{ "amountMinor": "113000", "currency": "CAD" }

Convert at the edges of your app, never in between:

JavaScript
const cents = BigInt("113000");
const dollars = new Intl.NumberFormat("en-CA", { style: "currency", currency: "CAD" }).format(Number(cents) / 100);

Currencies

Amounts always travel with a three-letter currency code, such as CAD, USD or EUR. Oatmilk never adds amounts in different currencies together: reports and totals come back per currency.

Dates and times

  • Dates are YYYY-MM-DD, such as 2026-09-30. A date range with from and to includes both days.
  • Times are ISO 8601 in UTC, such as 2026-09-30T14:00:00Z.
  • Webhook timestamps (created) are Unix seconds.

IDs

Record IDs are UUIDs, such as 7f0f6c1e-1c1f-4b5e-9c8d-2f5e8e3c1a10. Treat them as opaque text: don't parse them or build them yourself. Company IDs start with org_ and people's IDs with user_.