Foreign Exchange Rates
This endpoint allows you to retrieve the current foreign exchange (FX) rate between two currencies. By default, it returns the exchange rate from MXN to USD, but you can specify any supported currency pair.
The Foreign Exchange model
The FX model represents the current exchange rate between two currencies.
It allows you to retrieve real-time conversion rates—by default, from MXN to USD—but it supports any valid currency pair.
The response includes the base currency, the target currency, the exchange rate, and a timestamp indicating when the rate was retrieved.
This model is read-only and is designed for quick access to market rates for pricing, conversions, and transaction calculations.
Properties
- Name
value- Type
- string
- Description
The exchange rate between the base and target currencies.
- Name
created_at- Type
- string
- Description
Timestamp of when the exchange rate was retrieved.
Get the current foreign exchange
This endpoint allows you to retrieve the current foreign exchange rate between two currencies.
Optional attributes
- Name
from- Type
- string
- Description
The base currency. Supported values:
MXN,USD,JPY,GBP,EUR,CAD.
Defaults toUSDif not provided.
- Name
to- Type
- string
- Description
The target currency. Supported values:
MXN,USD,JPY,GBP,EUR,CAD.
Defaults toMXNif not provided.
Request
curl -G https://sandbox.api.coba.ai/metal/fx\
-H "Authorization: Bearer {access_token}" \
-H "X-Coba-Metal-API-Key: {client_api_key}"
Response
{
"created_at": "2025-05-21T20:10:01.509Z",
"value": "19.2230752"
}