Skip to main content
POST
/
api
/
service
/
fx
/
execute
JavaScript
import Ivy from '@getivy/node-sdk';

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

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

console.log(response.id);
{
  "id": "<string>",
  "rate": "<string>",
  "targetAmount": "<string>",
  "sourceAmount": "<string>",
  "sourceCurrency": "EUR",
  "targetCurrency": "EUR",
  "metadata": {},
  "status": "initiated"
}

Authorizations

X-Ivy-Api-Key
string
header
required

API key for authentication

Body

application/json
idempotencyKey
string
required

Idempotency key for the request.

sourceAmount
string
required

The amount of source currency to convert.

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
metadata
object

Additional metadata.

Response

200 - application/json

FX executed successfully

id
string
required

The fxId attached to the transfer.

rate
string
required

The exchange rate for the given currency pair.

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
status
enum<string>
required

The status of the FX transaction.

Available options:
initiated,
succeeded,
failed
targetAmount
string

The amount of the target currency for the given source amount.

sourceAmount
string

The amount of source currency to convert.

metadata
object

Additional metadata.