"$12.34" or "Rp 5.000".
Always read an amount together with its
currency. Amounts live on
resources next to a currency code: a store has store.currency, an order
has order.currency. Products and inventory items inherit the store
currency.Minor units per currency
The “smallest unit” is the currency’s minor unit. Most currencies split into 100 (cents, pence, sen), but many do not.
Zero-decimal currencies (the integer is the amount — do not multiply by 100):
BIF, CLP, DJF, GNF, IDR, IQD, JPY, KMF, KRW, MGA, PYG, RWF, UGX, VND, VUV, XAF, XOF, XPF.
Three-decimal currencies: BHD, JOD, KWD, OMR, TND.
Every other currency uses 2 decimals.
Converting to and from human amounts
Letd be the number of decimals for the currency (from the table above):
Intl.NumberFormat reads the correct decimals from the currency for you:
Amount fields in the API
Every field below is an integer in the store currency’s minor units.Products & inventory items
Product variants carry the same three fields.
Orders
Nested amounts: each
discounts[].amount, each line item’s price and total_amount, line-item option prices[], and the selected service.price.