PlexySDK DOCS

Currency Codes

Supported currencies and formatting

Currency Codes

Supported currencies and how to format amounts.

Amount format

Amounts are specified in the smallest currency unit (e.g., cents):

CurrencyAmountMeaning
KZT500050.00 ₸
USD5000$50.00
EUR500050.00
GBP500050.00
JPY50005,000

Converting amounts

// Convert display amount to API amount
function toSmallestUnit(amount, currency) {
  const zeroDecimal = ['JPY', 'KRW', 'VND', 'BIF', 'CLP', 'GNF', 'KMF', 'MGA', 'PYG', 'RWF', 'UGX', 'XAF', 'XOF', 'XPF'];

  if (zeroDecimal.includes(currency)) {
    return Math.round(amount);
  }
  return Math.round(amount * 100);
}

// $50.00 USD
const amount = toSmallestUnit(50.00, 'USD'); // 5000

// 5000 JPY
const amountJpy = toSmallestUnit(5000, 'JPY'); // 5000

Formatting for display

function formatCurrency(amountInSmallestUnit, currency) {
  const zeroDecimal = ['JPY', 'KRW', 'VND'];
  const divisor = zeroDecimal.includes(currency) ? 1 : 100;

  return new Intl.NumberFormat('en-US', {
    style: 'currency',
    currency: currency
  }).format(amountInSmallestUnit / divisor);
}

formatCurrency(5000, 'USD'); // "$50.00"
formatCurrency(5000, 'JPY'); // "5,000"

Minimum amounts

Each currency has a minimum charge amount:

CurrencyMinimum
USD$0.50
EUR0.50
GBP0.30
JPY50

See also

Осы бетте