Exchange rate providers

Use this method to obtain exchange rates.

GET[host]/api/v2/rates/{baseCurrency}/{quoteCurrency}

Get an exchange rate for a currency pair

Use these methods to manage the exchange rate providers configured in the Back Office.

GET[host]/api/v2/rates/providers

Get a list of exchange rate providers

GET[host]/api/v2/rates/providers/{providerId}

Get exchange rate provider details

GET[host]/api/v2/rates/providers/{providerId}/status

Validate the connection to an exchange rate provider

POST[host]/api/v2/rates/providers

Add an exchange rate provider

PUT[host]/api/v2/rates/providers/{providerId}

PATCH[host]/api/v2/rates/providers/{providerId}

Update an exchange rate provider

DELETE[host]/api/v2/rates/providers/{providerId}

Delete an exchange rate provider

Get an exchange rate for a currency pair

Use this method to obtain a current exchange rate for a specified currency pair.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

baseCurrency required

The alphabetic code of a base currency.

quoteCurrency required

The alphabetic code of a quote currency.

GET[host]/api/v2/rates/{baseCurrency}/{quoteCurrency}

curl --location --request GET 'https://host.name/api/v2/rates/btc/usd' \
--header 'Authorization: Bearer <token>'

Response

rate object

The details about an exchange rate.

Show object fields
value string

The exchange rate.

scale integer

The number of decimal places displayed when representing amounts in a currency.

RESPONSE EXAMPLE
{
    "scale": 14,
    "value": "19117.65"
  }

Get a list of exchange rate providers

Use this method to obtain a list of exchange rate providers configured in the Back Office.

Request

Header parameters:

  • Authorization: Bearer <token>

GET[host]/api/v2/rates/providers

curl --location --request GET 'https://host.name/api/v2/rates/providers?limit=10&offset=0' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'

Response

A response contains an array of Exchange Rate Provider objects including information about the rate providers matching the request parameters.


Get exchange rate provider details

Use this method to obtain detailed information about a specific exchange rate provider.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

providerId required

The identifier of an exchange rate provider.

GET[host]/api/v2/rates/providers/{providerId}

curl --location --request GET 'https://host.name/api/v2/rates/providers/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'

Response

A response contains an Exchange Rate Provider object including information about the specified rate provider.


Validate the connection to an exchange rate provider

Use this method to check whether a connection to a specific exchange rate provider is valid and whether exchange rates are returned.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

providerId required

The identifier of an exchange rate provider.

GET[host]/api/v2/rates/providers/{providerId}/status

curl --location --request GET 'https://host.name/api/v2/rates/providers/1/status' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'

Response

A response provides the following data about the status of the specified exchange rate provider:

isSuccess boolean

If true, the connection to an exchange rate provider is valid; otherwise, false.

tasks object

The details about getting an exchange rate for a specific currency pair.

Show object fields
name string

The currency pair for which an exchange rate is obtained.

isSuccess boolean

If true, an exchange rate was successfully obtained; otherwise, false.

failReason string

In case of failure, the reason why an exchange rate wasn’t obtained.

RESPONSE EXAMPLE
{
    "isSuccess": false,
    "tasks": [
        { 
            "name": "GetRate [BTC => USD]",
            "isSuccess": false,
            "failReason": "Source Currency BTC is not supported by CoinGecko"
        }
      ]
  }

Add an exchange rate provider

Use this method to configure a new exchange rate provider.

Request

Header parameters:

  • Authorization: Bearer <token>

Body:

Specify the following parameters for a rate provider:

provider string required

The exchange rate provider name.

name string required

The name that you want to assign to an exchange rate provider in the Back Office.

fromCurrencies object

The details about the base currencies that you want to add for an exchange rate provider.

toCurrency object

The details about the quote currencies that you want to add for an exchange rate provider.

POST[host]/api/v2/rates/providers

curl --location --request POST 'https://host.name/api/v2/rates/providers' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
  "provider": "CoinGeko",
  "name": "CoinGeko",
  "fromCurrencies": [
    "USD"
  ],
  "toCurrencies": [
    "BTC",
    "USDТ",
    "EUR"
  ]
}'

Response

A response contains an Exchange Rate Provider object including information about the rate provider that was created.


Update an exchange rate provider

Use this method to update a specified exchange rate provider.

Note

Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

providerId required

The identifier of an exchange rate provider.

Body:

The following field values can be updated for a rate provider:

name string

The name assigned to an exchange rate provider in the Back Office.

enabled boolean

If true, a rate provider is enabled; otherwise, false.

fromCurrencies object

The details about the base currencies specified for an exchange rate provider.

toCurrency object

The details about the quote currencies specified for an exchange rate provider.

options object

The details about the settings specific to an exchange rate provider.

PUT[host]/api/v2/rates/providers/{providerId}

curl --location --request PUT 'https://host.name/api/v2/rates/providers/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
  "enabled": true,
  "name": "CoinGeko",
  "fromCurrencies": [
    "USD"
  ],
  "toCurrencies": [
    "BTC",
    "USDТ",
    "EUR"
  ],
  "options": [
    "rate": "2",
    "base": "USD"
  ]
}'

Response

A response contains an Exchange Rate Provider object including information about the rate provider that was updated.


Delete an exchange rate provider

Use this method to remove a specified exchange rate provider.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

providerId required

The identifier of an exchange rate provider.

DELETE[host]/api/v2/rates/providers/{providerId}

curl --location --request DELETE 'https://host.name/api/v2/rates/providers/1' \
--header 'Authorization: Bearer <token>'

Response

In case of success, no response body is returned.