Assets management

Various assets can be created on the server and then assigned to trading instruments. This page describes methods intended for working with assets, you can create, modify, or delete such assets as currencies, shares, commodities, and crypto CCY.

Add new asset

POST /assets

This method is used to add a new asset to the server. All required parameters of the new asset should be specified in the request body.

Body

Name
Type
Description

creditForSell

double

Defines the credit for sell of asset. Set as a percentage. Parameter is used only if type=1 (Shares)

description

string

Comment for an object

instrumentId

integer

Defines the instrument for asset pricing. Parameter is used if type=1

isin

string

International securities identification number. Parameter is used and is mandatory if type=1

liquidityRate

double

The liquidity rate of the asset. Set as a percentage. Parameter is used if type=1

minChange*

double

The smallest indivisible part of the asset, required parameter

name*

string

Defines the name of the object, required

routeId

integer

Defines the route of instrument (by id) for asset pricing

type*

integer

Defines the type of asset. Valid value: 0 - Currency, 1 - Shares, 2 - Commodities, 3 - Crypto CCY

Body example

{
  "creditForSell": 80,
  "description": "asset",
  "instrumentId": 25358,
  "isin": "US38150K1034",
  "liquidityRate": 30,
  "minChange": 1,
  "name": "AAPL1",
  "routeId": 353266,
  "type": 1
}

CURL

Response

The response body will contain the name of the newly created asset and its ID.

Get all assets

GET/assets

This method is used to get all assets added to this server. You can filter them by type or by name (several names can be specified in the filter) by adding these parameters to the request query.

Query

Name
Type
Description

name

string

Filter by name. Several names can be specified using comma separator. By default this parameter is empty and response contains all entities.

type

string

Specifies the type of asset. Valid values: 0 - Currency, 1 - Shares, 2 - Commodities, 3 - Crypto CCY

CURL

Response

In the response, you will receive all assets (if the filtering is not applied) added to this server with an indication of their names and IDs.

Get asset (by its ID)

GET/assets/{assetId}

This method allows to request of one required asset by its ID. The ID of the required asset should be specified in the request path.

Path

Name
Type
Description

assetId

string

Unique identifier of the asset for which the info is required

CURL

Response

In the response, you will receive full info on the required asset. If some parameters are absent (not available for this type), they will be stated as null.

Remove asset from the server

DELETE/assets/{assetId}

This method is used to delete an asset from the serve by its IDr. Please note that an asset will be deleted completely. The ID of the required asset should be specified in the request path.

Path

Name
Type
Description

assetId

string

Unique identifier of the asset that should be removed

CURL

Response

In the response, you will simply receive the 204 No content code, which means that the asset is deleted successfully.

Modify asset

PATCH/assets/{assetId}

This method is used to modify an asset that exists on the server. The request path should contain the ID of the asset that will be modified while the body should contain all parameters similar to the POST request.

Path/Body

Name
Type
Description

assetId

string/path

Unique identifier of the asset that should be modified

creditForSell

double/body

Defines the credit for sell of asset. Set as a percentage. Parameter is used only if type=1 (Shares)

description

string/body

Comment for an object

instrumentId

integer/body

Defines the instrument for asset pricing. Parameter is used if type=1

isin

string/body

International securities identification number. Parameter is used and is mandatory if type=1

liquidityRate

double/body

The liquidity rate of the asset. Set as a percentage. Parameter is used if type=1

minChange*

double/body

The smallest indivisible part of the asset, required parameter

name*

string/body

Defines the name of the object, required

routeId

integer/body

Defines the route of instrument (by id) for asset pricing

type*

integer/body

Defines the type of asset. Valid value: 0 - Currency, 1 - Shares, 2 - Commodities, 3 - Crypto CCY

CURL

Response

In the response you will receive the 200 OK code, which means that update is performed successfully.

Last updated