Currencies

On this page:

THE CURRENCY OBJECT

A detailed description of the JSON object

GET[base]/currencies

Get a currencies list

GET[base]/currencies/{currencyId}

Get currency details

POST[base]/currencies

Add a new currency

PUT[base]/currencies/{currencyId}

Update a currency

DELETE[base]/currencies/{currencyId}

Delete a currency


The Currency object

This object provides the following data about a currency:

currencyId string

The currency identifier.

name string

The currency name.

aliases array

An array of string values specifying the aliases assigned to the currency.

alphabetic string

The alphabetic currency code.

numeric string

The numeric currency code.

precision integer

The minor unit of a currency (the number of digits after the decimal separator).

sign string

A sign specified for the currency.

class string

The currency class (crypto or fiat).

createTime string

The date and time when the object has been created.

updateTime string

The date and time when the object has been last updated.

THE CURRENCY OBJECT
{
  "currencyId": "6006dda272f002519c3eb505",
  "name": "Bitcoin",
  "aliases": [
    "XBT"
  ],
  "alphabetic": "BTC",
  "numeric": "12345",
  "precision": 1,
  "sign": "₿",
  "class": "crypto",
  "createTime": "2021-01-01T00:00:00+00:00",
  "updateTime": "2021-01-01T00:00:00+00:00"
}

Get a currencies list

Use this method to obtain a list of currencies.

To obtain detailed information about a specified currency, use a separate method to get currency details.

Request

Header parameters:

  • Authorization: Bearer <token>

Query parameters:

This method supports pagination, sorting, and filtering. For details on applying the parameters, refer to the Query parameters section. Possible parameters for filtering and sorting are listed below. For values description, refer to the Currency object.

Possible values for the filter parameter:

  • aliases

  • alphabetic

  • class (crypto or fiat)

  • name

  • numeric

  • precision

  • sign

Possible values for the sort_by parameter:

  • aliases

  • alphabetic

  • class

  • createTime default

  • currencyId

  • name

  • numeric

  • precision

  • sign

  • updateTime

GET[base]/currencies

curl --location -g --request GET 'https://your.base-url.here/currencies?limit=10&offset=0&sort_by=createTime&sort_order=desc&filter[aliases]=xbt&filter[alphabetic]=btc&filter[class]=fiat&filter[name]=bitcoin&filter[numeric]=840&filter[precision]=8&filter[sign]=₿' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains an array of Currency objects providing information about all currencies that correspond to the query parameters specified in the request.


Get currency details

Use this method to obtain detailed information about a specified currency.

To obtain a list of currencies, use a separate method to get a list of currencies.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

currencyId required

The currency identifier.

GET[base]/currencies/{currencyId}

curl --location --request GET 'https://your.base-url.here/currencies/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains a Currency object providing information about the specified currency.


Add a new currency

Use this method to add a new currency.

Request

Header parameters:

  • Authorization: Bearer <token>

  • Content-Type: application/json

Body:

class string

The currency class. Possible values:

  • crypto

  • fiat

name string

The currency name.

The string value length can’t exceed 255 characters.

sign string

The sign specified for the currency.

The string value length can’t exceed 255 characters.

alphabetic string required

The alphabetic currency code.

The string value length can’t exceed 255 characters.

numeric string

The numeric currency code.

The string value length can’t exceed 255 characters.

precision integer

The minor unit of a currency (the number of digits after the decimal separator).

The string value length can’t exceed 18 characters.

aliases array

An array of strings containing alphabetic aliases for the currency.

POST[base]v1/currencies

curl --location --request POST 'https://your.base-url.here/currencies' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "alphabetic": "BTC",
  "class": "crypto",
  "name": "Bitcoin",
  "sign": "₿",
  "numeric": null,
  "precision": 8,
  "aliases": [
    "XBT"
  ]
}'

Response

Body:

In case of success, the response body contains a Currency object providing information about the newly created currency.


Update a currency

Use this method to update a specified currency.

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>

  • Content-Type: application/json

Path parameters:

currencyId required

The currency identifier.

Body:

Values of the following fields can be updated:

class string

The currency class. Possible value:

  • crypto

  • fiat

name string

The currency name.

The string value length can’t exceed 255 characters.

sign string

A sign specified for the currency.

The string value length can’t exceed 255 characters.

alphabetic string required

The alphabetic currency code.

The string value length can’t exceed 255 characters.

numeric string

The numeric currency code.

The string value length can’t exceed 255 characters.

precision integer

The minor unit of a currency (the number of digits after the decimal separator).

The string value length can’t exceed 18 characters.

aliases array

An array of strings containing alphabetic aliases for the currency.

PUT[base]/currencies/{currencyId}

curl --location --request PUT 'https://your.base-url.here/currencies/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "class": "crypto",
  "name": "Bitcoin",
  "sign": "₿",
  "alphabetic": "BTC",
  "numeric": null,
  "precision": 8,
  "aliases": [
    "XBT"
  ]
}'

Response

Body:

In case of success, the response body contains a Currency objects providing information about the updated currency.


Delete a currency

Use this method to delete a specified currency.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

currencyId required

The currency identifier.

DELETE[base]/currencies/{currencyId}

curl --location --request DELETE 'https://your.base-url.here/currencies/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, no response body is returned.