Money and currency
Amounts are integers in the smallest unit
Every amount in the API is an integer in the smallest currency unit
(cents): 2500 with currency: "EUR" is €25.00. Prices, totals, member
prices, donations, ledger entries and statements all follow this.
One exception: the optional amount on the two refund endpoints,
POST /sales/{saleId}/refund (host side) and
POST /events/{idOrSlug}/sales/me/refund (buyer side), is in major units:
15 means 15.00. Omit it for a full refund.
Currency is always explicit
Every amount travels with a currency. Totals are grouped by currency and
never summed across currencies: a community selling in two currencies has
two numbers, not one blended one. See the finance totals in
Report on finances.
Whose money a figure is
On ledger entries, sum net, not gross. On a commission entry gross is
the full sale, which is the selling member's money; the community keeps only
its commission. A fully refunded sale reports net: 0. Details in the
Finance area of the reference.
Formatting
The client exports helpers so you never do float arithmetic on prices:
import { formatMoney, toCents } from "@cobuntu/embed";
formatMoney(2500, "EUR", "pt-PT"); // "25,00 €"
toCents(12.5); // 1250Checkout and quotes price on the server: send product and tier ids, never prices.