Currencies

Use these methods to exchange currencies and obtain the current exchange rates.

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

Get currency rates

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

Get an exchange rate for a currency pair

GET[host]/api/v2/my/currencies/{alphabeticCode}/paired

Get a list of paired currencies

POST[host]/api/v2/my/rates/pairs

Get exchange rates for currency pairs

POST[host]/api/v2/my/exchanges

Exchange currencies

Get currency rates

Use this method to obtain a list of currencies available for exchange and their current rates.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

baseCurrency required

The alphabetic code of a base currency for which the exchange rates are retrieved.

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

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

Response

A response contains an array of objects providing information about the available quote currencies and their current exchange rates.

quoteId string

The quote identifier.

currency object

The details about the quote currency available for exchange. See the Currency object to learn more.

expiredAt string or null

The date and time when the exchange rate data is due to expire.

lifetime integer

The number of seconds the exchange rate data is valid.

rate string or null

The exchange rate.

maxAmount string

The maximum allowed amount per exchange operation, specified for a currency pair.

RESPONSE EXAMPLE
{
  "quoteId": "36f59381-5b54-48bd-a0c7-3b908c476732",
  "currency": {
    "alphabeticCode": "USD",
    "minorUnit": 2,
    "name": "US Dollar",
    "numericCode": 840
  },
  "expiredAt": "2022-01-01T00:00:00+00:00",
  "lifetime": 60,
  "rate": "8.10000066",
  "maxAmount":"0.000000000000000000"
}

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/my/rates/{baseCurrency}/{quoteCurrency}

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

Response

quoteId string

The quote identifier.

currency object

The details about a quote currency. See the Currency object to learn more.

expiredAt string

The date and time when the exchange rate data is due to expire.

lifetime integer

The number of seconds the exchange rate data is valid.

rate string

The exchange rate.

maxAmount string

The maximum allowed amount per exchange operation, specified for a currency pair.

RESPONSE EXAMPLE
{
  "quoteId": "36f59381-5b54-48bd-a0c7-3b908c476732",
  "currency": {
    "alphabeticCode": "USD",
    "minorUnit": 2,
    "name": "US Dollar",
    "numericCode": 840
  },
  "expiredAt": "2022-01-01T00:00:00+00:00",
  "lifetime": 60,
  "rate": "8.10000066",
  "maxAmount":"0.000000000000000000"
}

Get a list of paired currencies

Use this method to get a list of currencies that are paired with a specified currency. The specified currency can be exchanged for any currency from the obtained list.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

alphabeticCode required

The alphabetic code of a currency for which you want to get a list of paired currencies.

GET[host]/api/v2/my/currencies/{alphabeticCode}/paired

curl --location 'https://host.name/api/v2/my/currencies/BTC/paired' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'

Response

A response includes an array of Currency objects providing information about the currencies that are paired with the specified currency.

Get exchange rates for currency pairs

Use this method to get the current exchange rates for specific currency pairs.

Request

Header parameters:

  • accept-language: <string>

  • Content-Type: application/json

  • Accept: application/json

  • Authorization: Bearer <token>

Body:

pairs array required

An array of string values specifying the currency pairs for which you want to get the exchange rates, such as btc_usd.

POST[host]/api/v2/my/rates/pairs

curl --location --request POST 'https://host.name/api/v2/my/rates/pairs' \
--header 'accept-language: <string>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "pairs": [
     "btc_usd",
     "btc_eur"
  ]
}'

Response

A response includes an Exchange Rate object providing information about the current exchange rates for the specified currency pairs.

Exchange currencies

Use this method to exchange currencies in specified amounts.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

Specify the following parameters for an exchange operation:

amount string required

The amount to be exchanged.

destinationAccountId integer required

The identifier of a destination account.

quoteId string required

The quote identifier.

sourceAccountId integer required

The identifier of a source account.

POST[host]/api/v2/my/exchanges

curl --location --request POST 'https://host.name/api/v2/my/exchanges' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "amount": "1.000000000000000000",
  "destinationAccountId": 1,
  "quoteId": "36f59381-5b54-48bd-a0c7-3b908c476732",
  "sourceAccountId": 1
}'

Response

A response includes a Transaction object providing information about the exchange operation that was made.