POST
/
api
/
service
/
fx
/
retrieve-rate
JavaScript
import Ivy from '@getivy/node-sdk';

const client = new Ivy({
  apiKey: 'My API Key',
});

const response = await client.fx.retrieveRate({ sourceCurrency: 'EUR', targetCurrency: 'EUR' });

console.log(response.rate);
{
  "rate": "<string>",
  "targetAmount": "<string>",
  "sourceAmount": "<string>"
}

Authorizations

X-Ivy-Api-Key
string
header
required

API key for authentication

Body

application/json
sourceCurrency
enum<string>
required

The source currency code.

Available options:
EUR,
GBP,
USDC
targetCurrency
enum<string>
required

The target currency code.

Available options:
EUR,
GBP,
USDC
sourceAmount
string

The amount of source currency to convert. If not provided, only the rate will be returned. Decimal places should be separated by a dot.

Response

200 - application/json

Returns the current exchange rate for the given currency pair.

rate
string
required

The current exchange rate for the given currency pair.

targetAmount
string

The amount of the target currency for the given source amount. Only returned if the source amount is provided.

sourceAmount
string

The amount of source currency to convert. Only returned if the source amount is provided.