Maintain a lookup table of currency exponents: most currencies use 2 decimal places (USD, EUR, GBP → multiply by 100), some use 3 (KWD, BHD, OMR → multiply by 1000), and zero-decimal currencies use no multiplier (JPY, KRW, VND → pass the whole number).
Store canonical amounts in your system as integers in the smallest unit (e.g., cents) or as exact decimal types (not float) — floating-point arithmetic on monetary values causes rounding errors that compound across transactions.
Before calling any PSP API, convert from your stored representation to the PSP's expected format: Stripe, GoCardless, and Razorpay expect minor units as integers; some older APIs expect decimal strings (e.g., Mollie expects '10.00' for EUR 10).
When receiving amounts from webhooks, convert back to your internal representation using the same exponent table; never assume all webhooks use the same format even from the same provider across different endpoints.
Test explicitly with JPY, KWD, and at least one 2-decimal currency in your payment integration tests — a passing test with only USD does not validate currency handling.
Log the raw 'amount' and 'currency' fields from every API response alongside your expected values; discrepancies surface misconfiguration before they reach production.
Known gotchas
Stripe's API silently accepts an amount of 1000 for USD and charges $10.00, but for JPY it charges ¥1000 — a copy-paste of code that sends 1000 for a $10 JPY-equivalent order charges 100x more than intended.
Some PSPs perform their own currency conversion and may change the amount field's scale in the response (e.g., returning a JPY amount with a decimal) — always use the 'currency' field to determine how to interpret the 'amount' field, not positional assumptions.
Zero-decimal currency lists are not static — new currencies are occasionally added or reclassified; subscribe to your PSP's changelog or API versioning notifications to catch changes.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp