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 charge | Pass 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 intending $100.00 — this charges $1.00. Always verify your amount conversion before going live.
Converting in code
// 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"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
| Currency | Code | Notes |
|---|---|---|
| US Dollar | USD | Supported at MVP 0 |
| Additional currencies | — | Planned for future phases |
Amount limits
| Limit | Value |
|---|---|
| Minimum | "0.01" |
| Maximum | "99999.99" |
Amounts outside this range return 400 validation_error.