Amounts & Currency
How Cresora represents monetary amounts and which currencies are supported.
String with 2 decimal places (e.g., "100.00")
Send amounts to the Cresora API as strings with exactly 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" |
The most common integration mistake is passing 10000 intending $100.00. Do not count on a 400 to catch it: a whole number may be read as a dollar amount, which would charge $10,000.00. Always send a string with exactly two decimals, such as "100.00".
Amounts you read back
Not every response uses that format. A read with GET /transactions/{transactionId}, or a
list with GET /transactions, returns each amount as an integer number of cents: 10000 is
$100.00. The exception is the level3_data that a read echoes back: its amounts stay decimal
strings, as on a write. A webhook's data carries
amounts as JSON numbers in dollars, and trailing zeros can be dropped: $100.00 may arrive as
100.0, and an amount of $10,000,000.00 or more may arrive in exponent notation, for example
1.0E7, which is still a JSON number: read it with a JSON parser and a decimal type, not with a
pattern. The response to POST /transactions gives each amount as a decimal string in dollars,
the same form you send, not integer cents. Convert an amount you read as integer cents before
you compare it with one you sent, and before you send it back: 10000 read
from a transaction is "100.00" in a request (see Converting in code).
Converting in code
// integer cents (a GET /transactions/{transactionId} read) → request string, no float math
const toAmount = (cents) =>
`${Math.trunc(cents / 100)}.${String(cents % 100).padStart(2, "0")}`;
const amountString = toAmount(10000); // "100.00"
// dollars as a JSON number (a webhook's data) → integer cents; round, never truncate
const toCents = (dollars) => Math.round(dollars * 100); // 19.99 → 1999
// display string
const display = parseFloat(amountString).toLocaleString("en-US", {
style: "currency",
currency: "USD",
}); // "$100.00"from decimal import Decimal, ROUND_HALF_UP
# integer cents (a GET /transactions/{transactionId} read) → request string
amount_string = str((Decimal(10000) / 100).quantize(Decimal("0.01"), rounding=ROUND_HALF_UP)) # "100.00"
# a webhook's data: json.loads(body, parse_float=Decimal) keeps dollar amounts exact
# display
display = f"${float(amount_string):.2f}" # "$100.00"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" — an amount must be positive (the exceptions are hosted-page sessions: a save_card session takes "0.00" or no amount at all, and a save_card_with_initial_charge session takes none, because its recurring_plan sets the charge) |
| Maximum | "9999999999.99" — storage precision is NUMERIC(12,2); a larger amount returns 400 validation_error |
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, not as a 400. On the hosted page the
session stays PENDING and last_attempt.reason classifies the failure (a declined card attempt is also, apart from rare anomalies, recorded as a FAILED transaction); on a saved-card charge through the
API the transaction reads FAILED with a decline_code. Do not clamp amounts client-side to a
guessed maximum.