Monetary values are encoded combining the currency and amount, using the smallest unit of currency to ensure accuracy and prevent floating-point issues.

MoneySchema Definition

The MoneySchema includes:
  • amount: Integer representing the value in the smallest currency unit (e.g., pence for GBP).
  • currency: ISO 4217 currency code indicating the currency type.
{
  "exampleMoney": {
    "amount": 1050,
    "currency": "GBP"
  }
}

Supported Currencies

Supports any currency with an ISO 4217 code.

Base Units for Currency

Transactions use the smallest currency unit to avoid rounding errors, e.g., 1050 in GBP represents £10.50.

A monetary value with currency.

amount
integer
required

Price in lowest denomination of currency (e.g. cents)

Required range: -9007199254740991 <= x <= 9007199254740991
Example:

1050

currency
enum<string>
required

ISO 4217 currency code

Available options:
AED,
AFN,
ALL,
AMD,
ANG,
AOA,
ARS,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
BMD,
BND,
BOB,
BOV,
BRL,
BSD,
BTN,
BWP,
BYN,
BZD,
CAD,
CDF,
CHE,
CHF,
CHW,
CLF,
CLP,
CNY,
COP,
COU,
CRC,
CUC,
CUP,
CVE,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
ERN,
ETB,
EUR,
FJD,
FKP,
GBP,
GEL,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
INR,
IQD,
IRR,
ISK,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KPW,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LYD,
MAD,
MDL,
MGA,
MKD,
MMK,
MNT,
MOP,
MRU,
MUR,
MVR,
MWK,
MXN,
MXV,
MYR,
MZN,
NAD,
NGN,
NIO,
NOK,
NPR,
NZD,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SDG,
SEK,
SGD,
SHP,
SLL,
SOS,
SRD,
SSP,
STN,
SVC,
SYP,
SZL,
THB,
TJS,
TMT,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
USD,
USN,
UYI,
UYU,
UYW,
UZS,
VES,
VND,
VUV,
WST,
XAF,
XAG,
XAU,
XBA,
XBB,
XBC,
XBD,
XCD,
XDR,
XOF,
XPD,
XPF,
XPT,
XSU,
XTS,
XUA,
XXX,
YER,
ZAR,
ZMW,
ZWL
Example:

"GBP"