amount string required Canonical decimal amount string (no exponent, separators or leading zeroes). It must already fit the currency's minor-unit precision; no rounding occurs.
Exact ISO 4217 major/minor-unit conversion and weighted allocation using decimal strings and integer arithmetic — no floats, rounding or FX rates.
Authoritative reference data or standards computation
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
amount
required
| string | allowed: 1 – 72 example: 123.45 | Canonical decimal amount string (no exponent, separators or leading zeroes). It must already fit the currency's minor-unit precision; no rounding occurs. |
currency
required
| string | allowed: 3 – 3 example: DKK | Active ISO 4217 currency code, case-insensitive. XDR is rejected because ISO defines no minor unit for it. |
amount string required Canonical decimal amount string (no exponent, separators or leading zeroes). It must already fit the currency's minor-unit precision; no rounding occurs.
currency string required Active ISO 4217 currency code, case-insensitive. XDR is rejected because ISO defines no minor unit for it.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
fields | list | example: currency,decimalDigits | Return only these fields (comma-separated). Mutually exclusive with 'exclude'. |
exclude | list | example: minorUnits | Return all fields except these (comma-separated). |
pretty | boolean | default: false example: true | Pretty-print the JSON response. |
unwrap | boolean | default: false example: true | Drop the envelope: return the raw array/object without data/meta wrapper. |
fields list Return only these fields (comma-separated). Mutually exclusive with 'exclude'.
exclude list Return all fields except these (comma-separated).
pretty boolean Pretty-print the JSON response.
unwrap boolean Drop the envelope: return the raw array/object without data/meta wrapper.
| Field | Type | Description | Example |
|---|---|---|---|
currency | string | Canonical uppercase ISO 4217 code. | DKK |
decimalDigits | integer | ISO 4217 minor-unit exponent used for the exact conversion. | 2 |
amount | string | Canonical fixed-scale major-unit amount. | 123.45 |
minorUnits | string (integer) | Exact signed integer minor-unit value. | 12345 |
currency string Canonical uppercase ISO 4217 code.
example: DKK
decimalDigits integer ISO 4217 minor-unit exponent used for the exact conversion.
example: 2
amount string Canonical fixed-scale major-unit amount.
example: 123.45
minorUnits string (integer) Exact signed integer minor-unit value.
example: 12345
/api/money/to-minor?amount=123.45¤cy=DKK {
"data": {
"currency": "DKK",
"decimalDigits": 2,
"amount": "123.45",
"minorUnits": "12345"
},
"meta": {
"endpoint": "money",
"route": "/to-minor",
"params": {
"amount": "123.45",
"currency": "DKK"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} /api/money/to-minor?amount=2500¤cy=JPY {
"data": {
"currency": "JPY",
"decimalDigits": 0,
"amount": "2500",
"minorUnits": "2500"
},
"meta": {
"endpoint": "money",
"route": "/to-minor",
"params": {
"amount": "2500",
"currency": "JPY"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} /api/money/to-minor?amount=-12.345¤cy=KWD {
"data": {
"currency": "KWD",
"decimalDigits": 3,
"amount": "-12.345",
"minorUnits": "-12345"
},
"meta": {
"endpoint": "money",
"route": "/to-minor",
"params": {
"amount": "-12.345",
"currency": "KWD"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} | Parameter | Type | Default & allowed | Description |
|---|---|---|---|
minor
required
| string | allowed: 1 – 72 example: 12345 | Canonical signed integer minor-unit string without decimal point, exponent or leading zeroes. |
currency
required
| string | allowed: 3 – 3 example: DKK | Active ISO 4217 currency code, case-insensitive. XDR is rejected because ISO defines no minor unit for it. |
minor string required Canonical signed integer minor-unit string without decimal point, exponent or leading zeroes.
currency string required Active ISO 4217 currency code, case-insensitive. XDR is rejected because ISO defines no minor unit for it.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
fields | list | example: currency,decimalDigits | Return only these fields (comma-separated). Mutually exclusive with 'exclude'. |
exclude | list | example: amount | Return all fields except these (comma-separated). |
pretty | boolean | default: false example: true | Pretty-print the JSON response. |
unwrap | boolean | default: false example: true | Drop the envelope: return the raw array/object without data/meta wrapper. |
fields list Return only these fields (comma-separated). Mutually exclusive with 'exclude'.
exclude list Return all fields except these (comma-separated).
pretty boolean Pretty-print the JSON response.
unwrap boolean Drop the envelope: return the raw array/object without data/meta wrapper.
| Field | Type | Description | Example |
|---|---|---|---|
currency | string | Canonical uppercase ISO 4217 code. | DKK |
decimalDigits | integer | ISO 4217 minor-unit exponent used for the exact conversion. | 2 |
minorUnits | string (integer) | Canonical signed integer minor-unit value. | 12345 |
amount | string | Exact fixed-scale major-unit amount. | 123.45 |
currency string Canonical uppercase ISO 4217 code.
example: DKK
decimalDigits integer ISO 4217 minor-unit exponent used for the exact conversion.
example: 2
minorUnits string (integer) Canonical signed integer minor-unit value.
example: 12345
amount string Exact fixed-scale major-unit amount.
example: 123.45
/api/money/from-minor?minor=12345¤cy=DKK {
"data": {
"currency": "DKK",
"decimalDigits": 2,
"minorUnits": "12345",
"amount": "123.45"
},
"meta": {
"endpoint": "money",
"route": "/from-minor",
"params": {
"minor": "12345",
"currency": "DKK"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} /api/money/from-minor?minor=2500¤cy=JPY {
"data": {
"currency": "JPY",
"decimalDigits": 0,
"minorUnits": "2500",
"amount": "2500"
},
"meta": {
"endpoint": "money",
"route": "/from-minor",
"params": {
"minor": "2500",
"currency": "JPY"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} /api/money/from-minor?minor=-1¤cy=KWD {
"data": {
"currency": "KWD",
"decimalDigits": 3,
"minorUnits": "-1",
"amount": "-0.001"
},
"meta": {
"endpoint": "money",
"route": "/from-minor",
"params": {
"minor": "-1",
"currency": "KWD"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} | Parameter | Type | Default & allowed | Description |
|---|---|---|---|
amount
required
| string | allowed: 1 – 72 example: 123.45 | Canonical decimal amount string (no exponent, separators or leading zeroes). It must already fit the currency's minor-unit precision; no rounding occurs. |
currency
required
| string | allowed: 3 – 3 example: DKK | Active ISO 4217 currency code, case-insensitive. XDR is rejected because ISO defines no minor unit for it. |
weights
required
| string | allowed: 1 – 199 example: 1,1,1 | Comma-separated positive integer weights (1–20 entries, each at most 999999999). |
amount string required Canonical decimal amount string (no exponent, separators or leading zeroes). It must already fit the currency's minor-unit precision; no rounding occurs.
currency string required Active ISO 4217 currency code, case-insensitive. XDR is rejected because ISO defines no minor unit for it.
weights string required Comma-separated positive integer weights (1–20 entries, each at most 999999999).
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
fields | list | example: currency,decimalDigits | Return only these fields (comma-separated). Mutually exclusive with 'exclude'. |
exclude | list | example: allocations | Return all fields except these (comma-separated). |
pretty | boolean | default: false example: true | Pretty-print the JSON response. |
unwrap | boolean | default: false example: true | Drop the envelope: return the raw array/object without data/meta wrapper. |
fields list Return only these fields (comma-separated). Mutually exclusive with 'exclude'.
exclude list Return all fields except these (comma-separated).
pretty boolean Pretty-print the JSON response.
unwrap boolean Drop the envelope: return the raw array/object without data/meta wrapper.
| Field | Type | Description | Example |
|---|---|---|---|
currency | string | Canonical uppercase ISO 4217 code. | DKK |
decimalDigits | integer | ISO 4217 minor-unit exponent used for the exact conversion. | 2 |
amount | string | Canonical amount that was allocated. | 10.00 |
minorUnits | string (integer) | Exact total in minor units. | 1000 |
totalWeight | string (integer) | Sum of all normalized positive weights. | 3 |
allocations | object[] | Input-order shares with index, weight, exact minorUnits and fixed-scale amount; their sum equals the input exactly. | [{"index":0,"weight":"1","minorUnits":"334","amount":"3.34"},{"index":1,"weight":"1","minorUnits":"333","amount":"3.33"},{"index":2,"weight":"1","minorUnits":"333","amount":"3.33"}] |
currency string Canonical uppercase ISO 4217 code.
example: DKK
decimalDigits integer ISO 4217 minor-unit exponent used for the exact conversion.
example: 2
amount string Canonical amount that was allocated.
example: 10.00
minorUnits string (integer) Exact total in minor units.
example: 1000
totalWeight string (integer) Sum of all normalized positive weights.
example: 3
allocations object[] Input-order shares with index, weight, exact minorUnits and fixed-scale amount; their sum equals the input exactly.
example: [{"index":0,"weight":"1","minorUnits":"334","amount":"3.34"},{"index":1,"weight":"1","minorUnits":"333","amount":"3.33"},{"index":2,"weight":"1","minorUnits":"333","amount":"3.33"}]
/api/money/allocate?amount=10.00¤cy=USD&weights=1,1,1 {
"data": {
"currency": "USD",
"decimalDigits": 2,
"amount": "10.00",
"minorUnits": "1000",
"totalWeight": "3",
"allocations": [
{
"index": 0,
"weight": "1",
"minorUnits": "334",
"amount": "3.34"
},
{
"index": 1,
"weight": "1",
"minorUnits": "333",
"amount": "3.33"
},
{
"index": 2,
"weight": "1",
"minorUnits": "333",
"amount": "3.33"
}
]
},
"meta": {
"endpoint": "money",
"route": "/allocate",
"params": {
"amount": "10.00",
"currency": "USD",
"weights": "1,1,1"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} /api/money/allocate?amount=999.95¤cy=DKK&weights=3,2,1 {
"data": {
"currency": "DKK",
"decimalDigits": 2,
"amount": "999.95",
"minorUnits": "99995",
"totalWeight": "6",
"allocations": [
{
"index": 0,
"weight": "3",
"minorUnits": "49997",
"amount": "499.97"
},
{
"index": 1,
"weight": "2",
"minorUnits": "33332",
"amount": "333.32"
},
{
"index": 2,
"weight": "1",
"minorUnits": "16666",
"amount": "166.66"
}
]
},
"meta": {
"endpoint": "money",
"route": "/allocate",
"params": {
"amount": "999.95",
"currency": "DKK",
"weights": "3,2,1"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} /api/money/allocate?amount=-0.05¤cy=EUR&weights=1,1 {
"data": {
"currency": "EUR",
"decimalDigits": 2,
"amount": "-0.05",
"minorUnits": "-5",
"totalWeight": "2",
"allocations": [
{
"index": 0,
"weight": "1",
"minorUnits": "-3",
"amount": "-0.03"
},
{
"index": 1,
"weight": "1",
"minorUnits": "-2",
"amount": "-0.02"
}
]
},
"meta": {
"endpoint": "money",
"route": "/allocate",
"params": {
"amount": "-0.05",
"currency": "EUR",
"weights": "1,1"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} Exact money arithmetic for the operations that should never pass through binary floating point. The endpoint reuses the platform's active ISO 4217 table and performs every calculation with decimal strings and integer arithmetic.
/to-minor converts a major-unit string such as 123.45 DKK to 12345. The input must be exactly representable at the currency's ISO minor-unit precision. Excess non-zero decimals are a 400; the API never rounds./from-minor converts an integer minor-unit string back to a fixed-scale amount (12345 USD → 123.45; 123 JPY → 123)./allocate splits an exact amount by 1–20 positive integer weights. It uses largest-remainder allocation with input order as the deterministic tie-breaker, so every returned minor unit sums exactly to the original — including negative amounts.Amounts are strings on input and output, so values are not constrained by JavaScript's safe-integer range. Scientific notation, grouping separators, leading zeroes and whitespace are rejected instead of guessed. XDR is deliberately unsupported: ISO 4217 defines no minor unit for the Special Drawing Right. This is currency-unit arithmetic only, not exchange-rate conversion, tax advice or localized display formatting.
No. /to-minor rejects any non-zero precision beyond the currency's ISO 4217 minor unit, so no hidden rounding can change the amount.
Yes. /allocate works in integer minor units and distributes remainders deterministically, so the allocations always sum exactly to the input.
No. It converts major and minor units within one currency and performs exact allocation; it never supplies or invents FX rates.
Every active ISO 4217 currency — code, name, symbol, minor-unit decimals and the countries using it. Search the list or look up one code, with honest 404s.
Fake account transactions with realistic merchants, weighted statuses and currency-correct amounts — filter by type, status, amount range and date window.
Exact fake invoices with line items, ISO currency precision, tax, collectible balances and status-consistent issue, due and payment dates.
Internally consistent fake orders with exact line-item totals, currency precision, lifecycle dates, payment state and generic tracking fixtures.
Deterministic unit conversion across 14 categories — length, mass, pressure, energy, power, force, angle, time and more — with exact standard factors.