Skip to main content
The Endpoint allows you to convert funds between currency pairs.

Request parameters

Pass these as request body on the /fx-quotes endpoint.
to_currency
string
The currency you want to convert to. ISO 4217 format.
from_currency
string
The currency you want to convert from. ISO 4217 format.
amount_to
number
The amount you want to convert to. This is conditionally required.
amount_from
number
The amount you want to convert from. This is conditionally required.
account_id
string
The ID of the account from which to debit the funds.
counterparty_id
string
required
The ID of the counterparty involved in the exchange.
payment_detail_id
string
required
The ID of the payment details associated with the exchange.

Convert funds between currency pairs.

You can specify either the amount_to or amount_from field, but not both. The endpoint calculates the other amount based on the current exchange rate.
  -H "Authorization: Bearer $NUVION_API_KEY" \
  -H "Content-Type: application/json" \ 
  -d '{
  "to_currency": "NGN",
  "from_currency": "USD",
  "amount_to": 100,
  "amount_from": 100,
  "account_id": "acc-id",
  "counterparty_id": "cp_id", //Required
  "payment_detail_id":  "pd_id", // Required
}'

Response Parameters

id
string
Unique entity identifier.
to
string
Currency converted to.
rate
number
The exchange rate applied to the conversion.
from
string
Currency converted from
quote
object
The quote details associated with this forex exchange.
created
number
Timestamp for when the forex exchange was created.
updated
number
Timestamp for when the forex exchange was last updated.
Example
{
  "id": "01HXYZ5678EFGH",
  "to": "NGN",
  "from": "USD",
  "rate": 750,
  "quote": {
    "used_at": null,
    "expires_at": 1700000000,
    "used_in_payment_id": null,
    "valid_for": 300,
    "status": "active"
  },
  "created": 1690000000,
  "updated": 1690000000
}