Account operations

This section describes methods that are used for performing actions with account operations (deposit/withdrawal/transfer/adjustment/etc).

Each account operation should be assigned to a specific account ID. Please note that one user (user ID) could have many trading accounts (account ID), so it is required to specify the exact account for which the operation should be created.

Create account operation

POST /accountOperations

This method is used to create an account operation.

Body

Name
Type
Description

accountId

integer

ID of the account for which the operation will be created (whose funds are withdrawn, etc.)

amount

float

Amount of the account operation. Please note that operation side (debit\credit) is defined by the +\- sign.

operationTypeId

integer

Defines account operation type. For examplу, the following IDs are responsible for such operation types: Trading - 1 Transfer - 17 Dividends - 13 Deposit - 2 Withdrawal - 3 Adjustment - 12 All IDs can be found in Swagger -> Models for this method.

Request body

{
 "accountId": 3243753,
 "amount": 1000,
 "operationTypeId": 2
}

CURL

curl -X POST "https://sandbox.traderevolution.com:8443/proftrading/rest/accountOperations" -H "accept: application/json" -H "Authorization: Bearer eyI1MDQ5MTA4NDAiOjUwNDkxMDg...-c0hxfFY1TTpzT-rDDFCdVh0ZQbvP4DocV-nV8_wC-dQCPU7Pbxv4R4_O5X6K_v8vyoR01fbqY" -H "Content-Type: application/json" -d "{ \"accountId\": 3243753, \"amount\": 1000, \"operationTypeId\": 2}"

This request example contains the minimum set of required parameters for creating a deposit (type=2) account operation.

Note: you can add any useful information to the account operation which may be later available on frontends. To do this, you must include the frontendComment field in the request body.

circle-exclamation

Response

The response will contain the ID of the newly created account operation.

Get account operations

GET/accountOperations

This method is used for getting a list of account operations. Please note that you can apply various filters for this method (by adding them to query): account name or ID, currencyId, operationType, positionId, etc.

Query

Name
Type
Description

isSettled

string

Filter operations by settlement type:

false - unsettled operations will be shown.

true - settled operations will be shown.

Required parameter*

sort

string

Sort operations (ascending/descending) by a given field. Available fields for sorting: createdDate, accountId, amount, valueDate. For ascending order sign ‘+’ is used before specified field. For descending ‘-’ By default, descending order by createdDate is used:

Default value : +createdDate Required parameter*

CURL example (operations are filtered by account ID)

Response

The response will contain all account operations available for this account.

Delete account operation by ID

DELETE/accountOperations/{accountOperationId}

This method is used for removing the specified account operation from the server.

Path

Name
Type
Description

accountOperationId

string

Identifier of the account operation that will be deleted.

CURL

You will receive the 204 (No content) code in the response, meaning the account operation has been deleted successfully.

Last updated