Sign in
.md

Monetary values

When submitting orders to a Guper API, all monetary values — item prices, taxes, discounts, totals, shipping — must be expressed as integers in the smallest unit of the currency (cents for BRL, USD, and similar). Decimal points are never sent across the wire.

Format

Display value Sent as
R$ 52.20 5220
R$ 3.75 375
R$ 1,000.00 100000
{
  "itemPrice": 5220,
  "tax":        375,
  "total":     5595
}

Converting for display

To render values for the user, divide the integer by 100:

const cents   = 5220;
const display = (cents / 100).toFixed(2); // "52.20"

Why integers?

Floating-point math introduces rounding errors that compound across totals and discounts. Sending values as integers eliminates those errors entirely and keeps every system in the chain in agreement on the same number.