Skip to main content

Currencies API

The Currencies API provides access to predefined currency master data with ISO 4217 codes, symbols, and decimal precision for use in UI dropdowns and currency selection.

Base Path

/api/v1/currencies
All endpoints require authentication with a valid session token.

List Currencies

Retrieve a list of available currencies for UI dropdowns.
GET /api/v1/currencies
curl -X GET "https://your-instance.accountability.app/api/v1/currencies?isActive=true" \
  -H "Authorization: Bearer your-session-token"
isActive
boolean
default:"true"
Filter by active status (only active currencies by default)
{
  "currencies": [
    {
      "code": "USD",
      "name": "United States Dollar",
      "symbol": "$",
      "decimalPlaces": 2,
      "isActive": true
    },
    {
      "code": "EUR",
      "name": "Euro",
      "symbol": "€",
      "decimalPlaces": 2,
      "isActive": true
    },
    {
      "code": "GBP",
      "name": "British Pound Sterling",
      "symbol": "£",
      "decimalPlaces": 2,
      "isActive": true
    },
    {
      "code": "JPY",
      "name": "Japanese Yen",
      "symbol": "¥",
      "decimalPlaces": 0,
      "isActive": true
    },
    {
      "code": "CHF",
      "name": "Swiss Franc",
      "symbol": "Fr",
      "decimalPlaces": 2,
      "isActive": true
    },
    {
      "code": "CAD",
      "name": "Canadian Dollar",
      "symbol": "C$",
      "decimalPlaces": 2,
      "isActive": true
    },
    {
      "code": "AUD",
      "name": "Australian Dollar",
      "symbol": "A$",
      "decimalPlaces": 2,
      "isActive": true
    },
    {
      "code": "CNY",
      "name": "Chinese Yuan",
      "symbol": "¥",
      "decimalPlaces": 2,
      "isActive": true
    }
  ]
}

Response Fields

currencies
array
Array of currency objects

Common Currencies

The API returns predefined currencies including:

Major Currencies

  • USD - United States Dollar
  • EUR - Euro
  • GBP - British Pound Sterling
  • JPY - Japanese Yen

Regional Currencies

  • CHF - Swiss Franc
  • CAD - Canadian Dollar
  • AUD - Australian Dollar
  • CNY - Chinese Yuan

Latin America

  • MXN - Mexican Peso
  • BRL - Brazilian Real
  • ARS - Argentine Peso
  • CLP - Chilean Peso

Asia-Pacific

  • INR - Indian Rupee
  • SGD - Singapore Dollar
  • HKD - Hong Kong Dollar
  • KRW - South Korean Won

Usage in UI

This endpoint is designed for populating currency dropdowns in the user interface:
// Example usage in a React component
const { data: currencies } = useQuery({
  queryKey: ['currencies'],
  queryFn: () => api.GET('/api/v1/currencies')
})

return (
  <select name="currency">
    {currencies?.currencies.map((currency) => (
      <option key={currency.code} value={currency.code}>
        {currency.code} - {currency.name} ({currency.symbol})
      </option>
    ))}
  </select>
)

Decimal Precision

Use the decimalPlaces field to format amounts correctly:
function formatAmount(amount, currencyCode, currencies) {
  const currency = currencies.find(c => c.code === currencyCode)
  const decimals = currency?.decimalPlaces ?? 2
  
  return new Intl.NumberFormat('en-US', {
    style: 'currency',
    currency: currencyCode,
    minimumFractionDigits: decimals,
    maximumFractionDigits: decimals
  }).format(amount)
}

// Examples:
formatAmount(1234.56, 'USD', currencies)  // "$1,234.56"
formatAmount(1234.56, 'JPY', currencies)  // "¥1,235" (no decimals)
formatAmount(1234.567, 'EUR', currencies) // "€1,234.57" (2 decimals)
The currency list is predefined and managed at the application level. Custom currencies cannot be added via the API.

Build docs developers (and LLMs) love