Skip to main content
POST
/
v1
/
fee-calculation
Calculate Exchange Rates
curl --request POST \
  --url https://sandbox.api.fin.com/v1/fee-calculation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "source_currency": "USD",
  "source_amount": 3508679,
  "beneficiary_id": "ceb7e6c9-ef2a-41c2-8459-38d67ec3c655"
}
'
{
  "data": {
    "source_currency": "USD",
    "destination_currency": "AUD",
    "source_amount": 350,
    "exchange_rate": 145,
    "destination_amount": 465,
    "fee": {
      "fixed": 25,
      "percentage": 4,
      "total": 29,
      "is_fee_applied": true
    }
  }
}
You can use this API to:
  • Calculate the source amount to transact with based on destination amount you are required to send
  • Calculate the destination amount based on the source amount you want to transact with
  • Calculate the developer fees (your fees) based on the beneficiary id you intend to send to
With respect to the above capabilities, you can either pass source_amount or destination_amount and the API will calculate the other based on the exchange rate. If you want to make the calculation developer fee aware, you may pass in beneficiary_id instead of destination_currency (the beneficiary model already has destination currency information). The response will contain the developer fee if based on the values set when creating the beneficiary.

Authorizations

Authorization
string
header
required

Bearer token authentication. Obtain token from /v1/oauth/token endpoint

Body

application/json
source_currency
string
required

ISO 4217 source currency code

Example:

"USD"

source_amount
number
required

Amount in source currency (provide either this or destination_amount)

Example:

3508679

beneficiary_id
string<uuid>
required

Unique identifier for the beneficiary

Example:

"ceb7e6c9-ef2a-41c2-8459-38d67ec3c655"

Response

Fee calculation completed successfully

data
object