Commerce
Currency minor-unit format API
Converts between a decimal major amount and the integer minor-unit representation (cents, satoshis, wei) used by payment rails and on-chain transfers, with correct per-currency exponents (NO FX). Answers 'How many cents is $12.34?', 'What is 1500 minor units in JPY?'.
Price$0.01per request
MethodPOST
Route/v1/commerce/currency-minor-units
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
commercecurrencyminor-unitscentssubunitsformattingpaymentson-chain
API URL
Integration docshttps://x402.hexl.dev/v1/commerce/currency-minor-unitsExample request
{
"currency": "USD",
"amount": 12.34
}Example response
{
"currency": "USD",
"exponent": 2,
"direction": "major->minor",
"majorAmount": 12.34,
"minorUnits": 1234,
"formatted": "12.34 USD",
"interpretation": "1234 minor units = 12.34 USD (10^2 subunits/major)."
}Input schema
{
"type": "object",
"required": [
"currency"
],
"properties": {
"currency": {
"type": "string",
"examples": [
"USD"
]
},
"amount": {
"type": "number",
"examples": [
12.34
]
},
"minorUnits": {
"type": "integer",
"examples": [
1500
]
},
"exponentOverride": {
"type": "integer",
"examples": [
2
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}