ConceptsMoney invariants

Money invariants

Three rules hold everywhere money is represented or moved in RUO Pro.

Integer cents, everywhere

All monetary amounts are integer cents. Conversion to/from a decimal currency representation happens only at the edges (a payment processor’s API, a display string) — never inside the amounts the API returns or accepts.

Deterministic idempotency

Idempotency keys are deterministic, derived from the business event — never a random value. A retried write (a webhook redelivery, a network retry, an operator double-click) with the same key replays the original outcome instead of double-posting. This applies everywhere money moves: store-credit grants and spends, affiliate commissions, and checkout’s payment-intent creation. See Idempotency for the full contract.

Fail-closed on the way in

A debit that would overdraw an account (for example a store-credit spend) is rejected before any charge or record is made — not caught and reversed after the fact. A refund settles its order before any reversal work runs, and a reversed amount can’t be resurrected by a late redelivery — the “late redelivery resurrects a reversed commission” race is closed, not just guarded against in application code.