Skip to content

Money and quantities

Money and quantities are always plain integers or fixed-decimal numbers on the OLET API, never floating point dollars. Read a value the way this page describes it and your totals will match what shows up in the back office.

Most amounts are integer cents. A value of 1999 means $19.99. This applies to a product’s retail_price, a sale’s total and paid_total, a stock unit_cost, and the other totals on a sale.

A sale line’s list_price, unit_price and unit_discount are different: they are integers with 4 decimal places, so 12345 means 1.2345. This extra precision exists because a unit price can be set below one cent per unit on some products.

Rates, such as a tax rate or a discount percentage, are integer basis points, where 1 basis point is 1/100 of a percent. So 250 basis points is 2.5%. A supplier’s default_markup is a rate too.

SaleDiscount.value changes shape depending on value_type: it is cents when value_type is fixed, and basis points when value_type is percent.

Terminal window
curl https://api.oletapp.com/your-store/v1/sales \
-H "Authorization: Bearer olet_live_YOUR_API_KEY"
const sales = await response.json() // { data: [...], next_cursor, has_more }
const dollars = sales.data[0].paid_total / 100

Quantities are plain JSON numbers with up to 3 decimal places, for example 2.5 or 0.125 units. Sending a value with more than 3 decimal places is rejected as a validation error rather than being silently rounded, so round on your side before sending a request.

See pagination and polling for how list endpoints page through these values, or the full API reference for every field’s exact shape.