Documentation Payments Currency conversion

Payments integration

Currency conversion

Currency conversion integration overview
  • CategoryPayments
  • AuthPlatform managed

Overview

Currency conversion is MessageMind's shared money layer rather than a credentialed external integration. The /integrations card lists it under Bank and Finance with an empty fields array and a Disabled status, because there is nothing per-tenant to paste. Every account has an account currency (the owner's own locale currency, resolved from the assistant profile or country when not yet set), and every reader can request totals in their own currency through the display currency header or query parameter. A single rate table per UTC day is used across the whole platform, fetched from a configured provider, cached in memory, and persisted so the last known day can serve stale when the provider is temporarily unreachable.

What MessageMind can do with it

  • Resolve each account's own currency from the assistant profile, the stored country, or the account time zone, defaulting to USD when nothing is known. The default is stamped on the account the first time it is read so it never changes under the owner.
  • Fetch and cache one FX rate table per UTC day, store it in the database, and serve the last stored day (marked stale) when the provider is unreachable.
  • Convert a stored amount from any ISO 4217 currency the registry knows into the reader's currency, with proper half-away-from-zero rounding at that currency's digits (0, 2, or 3).
  • Report the rate table's day, staleness, and any currencies the reader asked for that the table could not convert, on every money-bearing response.
  • Expose a convertCurrency assistant tool that converts one or more amounts between two currencies, returning either a value or a human-readable breakdown with exact, rounded, and nearest-5 variants.

Requirements

  • A FX rate provider configured through the CURRENCY_URL environment variable. The provider is expected to return a payload with a data block of CODE: rate pairs.
  • A MongoDB connection (used to persist the day's rate table and to allow stale fallback).

How to connect

  1. There is nothing to connect per account. The /integrations card for Currency Conversion ships with no fields and a Disabled status because the capability is wired at the platform layer, not per tenant.
  2. An operator sets the CURRENCY_URL environment variable to the FX provider's endpoint on the deployment.
  3. The first read for a given UTC day triggers a fetch, stores the table, and keeps it in memory for the day.
  4. Each account's account currency is resolved from the assistant profile, country, and time zone, then stamped on the account's user record the first time it is read.

Authentication and permissions

Mechanism
The FX provider URL is treated as pre-authenticated (any API key is embedded in the URL and never logged). The convert endpoints inside MessageMind inherit the standard request authentication.
Credentials
Set via CURRENCY_URL on the deployment. No credentials are collected in the dashboard card.

Available data and actions

Reads

  • The configured FX provider, once per UTC day, with a 10 second timeout.
  • The stored rate table from MongoDB (one document per day), for both today's lookup and the stale fallback.
  • The owner's stored currency, country, time zone, and the assistant profile's store or hotel currency, to resolve the account currency.

Writes

  • The day's FX rate table is upserted into the fxrates collection on a successful provider fetch.
  • The resolved default account currency is stamped on the owner's user record the first time no currency is stored.

AI agent use cases

  • A customer asks the price of something quoted in a different currency; the AI converts it on the fly through the convertCurrency tool.
  • A reader on a different currency opens their money view with a currency query parameter or the x-currency header; totals are converted into their currency, with the rate day and staleness surfaced on the response.
  • An amount stored without an explicit currency is read in the owner's account currency, so legacy or ambiguous records remain comparable.

Configuration

  • The registry covers the circulating ISO 4217 codes as of October 2026. Metals, SDR, fund codes, and withdrawn codes are deliberately excluded.
  • A code outside the registry is ignored (not refused), so a stale client that asks for a withdrawn code still gets a readable response in the fallback currency.
  • After a provider failure, the fetch is held off for 15 minutes while readers receive the last stored day with the stale flag set.
  • Rounding uses the currency's own ISO 4217 minor units (0, 2, or 3), from a baked-in table.
  • The display currency is taken from the currency query parameter first, then the x-currency header, then a per-caller fallback, then the owner's account currency.

Example workflows

Convert an amount in a conversation

  1. The AI calls the convertCurrency tool with one or more amounts, a from currency, and a to currency.
  2. The latest rate table is read (memory, then today's stored row, then a fresh fetch, else the last stored day).
  3. The amount is multiplied by the ratio of the two currencies' rates.
  4. The tool returns the exact value, or a description that includes exact, rounded, and nearest-5 variants.

Limitations

  • One rate table per UTC day. Intraday rate moves are not reflected.
  • When the provider is down and no stored day exists, no conversion is possible and the response surfaces that explicitly.
  • Codes outside the baked-in registry are not converted. The registry excludes metals, SDR, fund codes, and withdrawn codes.
  • Only the owner's stored currency, country, and time zone (and the assistant profile currency) feed the default resolution.
  • The /integrations card shows status Disabled because there is no per-tenant credential to collect; the capability is on whenever the deployment has CURRENCY_URL set.

Troubleshooting

A money view answers with no FX block or converts nothing.

The provider failed and no day is stored yet. Confirm CURRENCY_URL is set and reachable; the next successful fetch will populate the table.

The convertCurrency tool answers that the conversion rate is not available for a given code.

Today's rate table has no entry for that code. Check that the provider returns it; otherwise the code is excluded from conversions until it does.

Totals appear to be in a stale day's rates.

The provider is temporarily unreachable and the last stored day is being served (stale: true on the fx block). Rates will refresh automatically once the provider recovers.

The Currency Conversion card on /integrations looks disabled and takes no input.

That is expected. The card has an empty fields list because conversion is wired at the deployment through CURRENCY_URL, not through a per-account form.

Disconnect and reconnect

  • Currency conversion is a platform capability rather than a per-account connection; there is no per-tenant disconnect flow. Unset CURRENCY_URL at the deployment to stop fetching new rates (stored days will still be served, marked stale).