Skip to main content
Cresora Commerce
Core Concepts

Amounts & Currency

How Cresora represents monetary amounts and which currencies are supported.

String with 2 decimal places (e.g., "100.00")

All monetary amounts in the Cresora API are expressed as strings with 2 decimal places.

Pass "100.00" for $100.00.

You want to chargePass amount
$1.00"1.00"
$9.99"9.99"
$100.00"100.00"
$1,500.00"1500.00"
⚠Warning

The most common integration mistake is passing 100 or 10000 intending $100.00. Neither charges the wrong amount — the contract requires the exact shape \d+\.\d{2} as a string, so a non-conforming amount is rejected with 400. Always format with two decimals before sending.

Converting in code

Node.js
// dollars → decimal string (safe fixed-point formatting)
const dollars = 100.00;
const amountString = dollars.toFixed(2); // "100.00"

// display string
const display = parseFloat(amountString).toLocaleString("en-US", {
  style: "currency",
  currency: "USD",
}); // "$100.00"
Python
from decimal import Decimal, ROUND_HALF_UP

# dollars → decimal string
dollars = Decimal("100.00")
amount_string = str(dollars.quantize(Decimal("0.01"), rounding=ROUND_HALF_UP))  # "100.00"

# display
display = f"${float(amount_string):.2f}"  # "$100.00"
🔒Floating point warning

Never use floating-point arithmetic (0.1 + 0.2 == 0.30000000000000004) for monetary calculations. Use a decimal library throughout.

Supported currencies

CurrencyCodeNotes
US DollarUSDSupported at MVP 0
Additional currencies—Planned for future phases

Amount limits

LimitValue
Minimum"0.01" — amounts must be positive (the one exception: a save_card hosted-page session takes "0.00" or no amount at all)
Maximumnone in the API contract — storage precision is NUMERIC(12,2), i.e. up to "9999999999.99"

A zero or negative amount on a charge returns 400 validation_error. There is no platform-wide ceiling below the storage precision: per-merchant limits are configured at the payment gateway and surface as a decline (state: FAILED + decline_code), not as a 400. Do not clamp amounts client-side to a guessed maximum.