Page tree
Skip to end of metadata
Go to start of metadata

Please refer to HOW TO use REST API for getting started information and a few examples on using REST API.

 

HTTP Request

 

Common Response

See Etna.Trading.OmsWebService.Dto.MobileServiceResult<T>.

Message direction

Format

Body

Additional info (possible values)

Response

JSON

{

  • "ResponseCode":"int",
  • "Ticket":"string",
  • "Result":{}

}

ResponseCode (see Etna.Trading.OmsWebService.Dto.MobileServiceResponseCode):

  • 0 - no error
  • 1 - internal server error
  • 2 - client version is too old
  • 3 - error during authentication
  • 4 - error during registration - email is already in use
  • 5 - error during recover - invalid data (email or question or answer)
  • 6 - error during add watch list - name is already in use
  • 7 - error during registration - login is already in use
  • 8 - error during registration - invalid pin
  • 9 - error during file upload
  • 10 - company is disabled or not exists
  • 11 - user is disabled for company
  • 12 - access denied
  • 13 - invalid request

Ticket is authentication ticket. It should be passed to almost all methods. Client should get new ticket from result every time.

Result is actual method return.

Get Service Address(obsolete)

Obsolete in version 2.19, iOS 2.20. See ServiceAddress, Login

Get service address and streaming addresses for requested device type and application version.

Url: {server-path}/get-service-address

HTTP Method: POST 

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "version":"3.00",
  • "device":"iOS"

}

Device:

  • ios
  • android
  • winphone

Version format is "X.XX".

Response

JSON

{

  • "ServiceAddress":"https://api.etnatrader.com/v0/test",
  • "StreamingAddress":"ws://etnatrader-test-amazonaws.com:80",
  • "StreamingAddresses":[
    "ws://etnatrader-test-amazonaws.com:80"
    ]

}

PinEnabled indicates that PIN is required to log in

ServiceAddress is a service address for given device and version.

StreamingAddress is a main streaming server.

StreamingAddresses is a list of all available streaming servers.

Service Address

Get service address and streaming addresses for requested device type and application version.

Url: {server-path}/service-address

HTTP Method: POST 

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "version":"3.00",
  • "device":"iOS"

}

Device:

  • ios
  • android
  • winphone

Version format is "X.XX".

Response

JSON

{"ServiceAddress":"https://api.etnatrader.com/v0/test"}

ServiceAddress is a service address for given device and version.

Registration

A new user in the system could be registered using following data:

Url: {server-path}/registration

HTTP Method: POST

Hearers:

HeaderValue (ETNA Trader Demo is taken as an example environment)
x-api-routingdemo
x-api-keyyiBCDJFVpimYYtmI0dYp9uUsc9YWeYc233VW9v2j
Content-Typeapplication/json

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{
"version":"3.00",
"device":"iOS",
"registrationRequest":

{

"AnswerSecretQuestion":"your_answer",
"Login":"your_login",
"SecretQuestion":2,
"FirstName":"your_FirstName",
"LastName":"your_LastName",
"Password":"your_password",
"Email":"Your email",

"PrimaryPhoneCountry":"Primary_phone_country_code",
"PrimaryPhoneCode":"Primary_phone_country_region_code",
"PrimaryPhone":"Primary_phone",

"StreetAddress1":"Main_street_address",
"StreetAddress2":"Secondary_street_address",
"City":"City",
"State":"state_id_when_country_is_US",

"PostalCode":"Postal_or_zip_code.",
"CountryId":"Country_ID",

"SendInvitationEmail":true/false

 }

}

SecretQuestion applicable values are: -1,2,3,4,5,6,7

IdName

-1

Unknown
2MotherNameQuestion
3ChildhoodNicknameQuestion
4SpouseMeetingCityQuestion
5ChildhoodFriendNameQuestion
6HomeStreetThirdGradeQuestion
7EldestSiblingBirthdayQuestion

Response

JSON

{
"ResponseCode": 0,
"Result": {
"ErrorAttributes": null,
"ErrorKey": null,
"Login": "your_login",
"Password": "your_password",
"UserId": your_userID
},
"Ticket": ""
}

ResponseCode values: 0, 1, 2, 4, 7

Ticket and Result are not used.

Change password

Changes user password

Url: {server-path}/change-password

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"string",
  • "oldPassword":"string"
  • "newPassword":"string"

}

 

Response

JSON

{

  • "ResponseCode":"int",
  • "Ticket":"string",
  • "Result":{
    • "Changed":"bool",
    • "Error":"string"
      }

}

Error:

WrongOldPassword - Old password doesn't match

InvalidPasswordLength - Password Length should be 6-16 chars

InvalidPasswordSymbols - Password should contain latin characters, digits or common punctuations

NewPasswordEqualsOld - New password shouldn't be the same with old password

Recover

Recover user's password

Url: {server-path}/recover

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "device":"string",
  • "version":"string",
  • "email":"string",
  • "secretQuestion":"int",
  • "answerSecretQuestion":"string",
  • "newPassword":"string"

}

 

Response

JSON

{

  • "ResponseCode":"int",
  • "Ticket":"string",
  • "Result":{}

}

ResponseCode values: 0, 1, 2, 5

Ticket and Result are not used.

 

Login

Sign in user to the system

Url: {server-path}/login

HTTP Method: POST 

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "device":"string",
  • "version":"string",
  • "login":"string",
  • "password":"string",
  • "companyId": "int"

}

email from registration is used as login

As example:

{
"device":"iOS",
"version":"3.00",
"login":"techsupport",
"password":"jxsmoBhz"
}

Response

JSON

{

}

 

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

AuthStep:

  • 0-OK,
  • 1-EnterPin (need to provide PIN invoking EnterPIN method),
  • 2-EnterSecuritySettings (need to set PIN for user invoking SetSecuritySettings method)
  • 3-Agreement (need to accept agreements for user)
  • 4-PasswordExpired (need to enter new password for user because old password expired)

 


Recover Session

Refresh expired ticket and session.

Url: {server-path}/recover-session

HTTP Method: POST 

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"string"
  • "sessionType":"int"

}

sessionType values: 0, 1
0 – data session
1 – quote session

Response

JSON

{

  • "ResponseCode":"int",
  • "Ticket":"string",
  • "Result":"string"

}

Result - recovered session id;
If session type was not defined or
quote service is disabled returns
recovered data session id.

 

Logout

Logout user from the system

Url: {server-path}/logout

HTTP Method: POST 

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"string"

}

 

Response

JSON

{

  • "ResponseCode":"int",
  • "Ticket":"string",
  • "Result":{}

}

ResponseCode values: 0, 1, 2, 3

Ticket and Result are not used.

 

Get Securities By Mask

Url: {server-path}/get-securities-by-mask

HTTP Method: POST 

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"83774...465CE4E",
  • "count":20,
  • "mask":"Aap"

}

 

Response

JSON

{

  • "ResponseCode":0,
  • "Result":[{
      • "AddedDate":"\/Date(1354205143993+0000)\/",
      • "AllowMargin":false,
      • "AllowShort":false,
      • "AllowTrade":true,
      • "ContractSize":1.00000,
      • "Currency":null,
      • "Description":"USD - APPLE Inc",
      • "Enabled":true,
      • "Exchange":"NSDQ",
      • "ExpirationDate":"\/Date(-62135596800000)\/",
      • "ExpirationName":"01 Jan 0001",
      • "ExpirationType":4,
      • "HasOptions":false,
      • "Id":4,
      • "Industry":null,
      • "MarginRate":0,
      • "ModifyDate":"\/Date(1441293639150+0000)\/",
      • "Name":"AAPL",
      • "OptionType":2,
      • "ParentId":-1,
      • "Precision":2,
      • "Sector":null,
      • "SeriesId":-1,
      • "Source":0,
      • "SourceId":null,
      • "StrikePrice":0,
      • "Suffix":null,
      • "Symbol":"AAPL",
      • "Type":6,
      • "UnderlyingSecuritySymbol":null,
      • "Unit":null
      },
    ],
  • "Ticket":"837D...5CE4E"

}

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result contains matched securities.

Get Security By Id

Url: {server-path}/get-security-by-id

HTTP Method: POST 

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"83774...465CE4E",
  • "securityIds":"int[]"

}

 

Response

JSON

{

  • "ResponseCode":0,
  • "Result":[{
      • "AddedDate":"\/Date(1354205143993+0000)\/",
      • "AllowMargin":false,
      • "AllowShort":false,
      • "AllowTrade":true,
      • "ContractSize":1.00000,
      • "Currency":null,
      • "Description":"USD - APPLE Inc",
      • "Enabled":true,
      • "Exchange":"NSDQ",
      • "ExpirationDate":"\/Date(-62135596800000)\/",
      • "ExpirationName":"01 Jan 0001",
      • "ExpirationType":4,
      • "HasOptions":false,
      • "Id":4,
      • "Industry":null,
      • "MarginRate":0,
      • "ModifyDate":"\/Date(1441293639150+0000)\/",
      • "Name":"AAPL",
      • "OptionType":2,
      • "ParentId":-1,
      • "Precision":2,
      • "Sector":null,
      • "SeriesId":-1,
      • "Source":0,
      • "SourceId":null,
      • "StrikePrice":0,
      • "Suffix":null,
      • "Symbol":"AAPL",
      • "Type":6,
      • "UnderlyingSecuritySymbol":null,
      • "Unit":null
    1. },
    ],
  • "Ticket":"837D...5CE4E"

}

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result contains matched securities.

Get Watch Lists

Retrieve all of a users watchlists.

Url: {server-path}/get-watch-lists   

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"string",
  • "excludeSecurityList":"bool"

}

excludeSecurityList is optional parameter

if value is true - system will exclude securities

from the watchlists in response

Response

JSON

{

  • "ResponseCode":0,
  • "Result":[{
      • "CreateDate":"\/Date(1391183133383+0000)\/",
      • "Description":"System Watch List: * Indices",
      • "Id":787,
      • "ModifyDate":"\/Date(1442215798856+0000)\/",
      • "Name":"* Indices",
      • "SecurityList":[{
          • "__type":"BasicSecurity:#Etna.Trading.Security",
          • "AddedDate":"\/Date(1354205143993+0000)\/",
          • "AllowMargin":false,
          • "AllowShort":false,
          • "AllowTrade":true,
          • "ContractSize":1.00000,
          • "Currency":null,
          • "Description":"USD - APPLE Inc",
          • "Enabled":true,
          • "Exchange":"NSDQ",
          • "ExpirationDate":"\/Date(-62135596800000)\/",
          • "ExpirationName":"01 Jan 0001",
          • "ExpirationType":4,
          • "HasOptions":false,
          • "Id":4,
          • "Industry":null,
          • "MarginRate":0,
          • "ModifyDate":"\/Date(1441293639150+0000)\/",
          • "Name":"AAPL",
          • "OptionType":2,
          • "ParentId":-1,
          • "Precision":2,
          • "Sector":null,
          • "SeriesId":-1,
          • "Source":0,
          • "SourceId":null,
          • "StrikePrice":0,
          • "Suffix":null,
          • "Symbol":"AAPL",
          • "Type":6,
          • "UnderlyingSecuritySymbol":null,
          • "Unit":null
          },
        ],
      • "Source":"ListBySecurityTypeBuilder",
      • "Type":1,
      • "UserId":null,
      • "ReadOnly":false
    ],
  • "Ticket":"3E8039459...1905D28F371"

}

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result contains all user watch lists.

Get Symbols Paged

Retrieve securities page by watchlist

Url: {server-path}/get-symbols-paged   

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"string",
  • "listId":"int",
  • "startIndex":"int",
  • "pageSize":"int",
  • "sortField":"string",
  • "sortDirection":"string",

}

sortField - filed name by which data

will be sorted (e.g. "Symbol")

sortDirection - direction of sorting. Possible

values: "asc", "desc"

Response

JSON

{

  • "ResponseCode":0,
  • "Result":{
      • "Index":"1",
      • "Items":[{
          • "__type":"BasicSecurity:#Etna.Trading.Security",
          • "AddedDate":"\/Date(1354205143993+0000)\/",
          • "AllowMargin":false,
          • "AllowShort":false,
          • "AllowTrade":true,
          • "ContractSize":1.00000,
          • "Currency":null,
          • "Description":"USD - APPLE Inc",
          • "Enabled":true,
          • "Exchange":"NSDQ",
          • "ExpirationDate":"\/Date(-62135596800000)\/",
          • "ExpirationName":"01 Jan 0001",
          • "ExpirationType":4,
          • "HasOptions":false,
          • "Id":4,
          • "Industry":null,
          • "MarginRate":0,
          • "ModifyDate":"\/Date(1441293639150+0000)\/",
          • "Name":"AAPL",
          • "OptionType":2,
          • "ParentId":-1,
          • "Precision":2,
          • "Sector":null,
          • "SeriesId":-1,
          • "Source":0,
          • "SourceId":null,
          • "StrikePrice":0,
          • "Suffix":null,
          • "Symbol":"AAPL",
          • "Type":6,
          • "UnderlyingSecuritySymbol":null,
          • "Unit":null
          },
        ],
      • "Total":11,
    ],
  • "Ticket":"3E8039459...1905D28F371"

}

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result contains watchlist securities page

 

Feedback

Send user feedback

Url: {server-path}/feedback

HTTP Method: POST 

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"string",
  • "contacts":"string",
  • "subject":"string",
  • "comment":"string",
  • "device":"string",
  • "attachments":[
    • {
      • "Name":"string",
      • "Type":"string",
      • "Data":"string"
      }
    ]

}

Ticket = null for non-authorized user

Attachments:

Type - MIME-type of a file,

Data - Base64 representation of a file

Response

JSON

{

  • "ResponseCode":"int",
  • "Ticket":"string",
  • "Result":{}

}

ResponseCode values: 0, 1, 3, 9

 

Audit

Send user's statistic to the system

Url: {server-path}/audit   

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"string",
  • "type":"string",
  • "date":"int",
  • "title":"string",
  • "description":"string"

}

 

Response

JSON

{

  • "ResponseCode":"int",
  • "Ticket":"string",
  • "Result":{}

}

 

Enter Pin

Send user's PIN for sign in to the system

Url: {server-path}/enter-pin

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

 

{

  • "ticket":"string",
  • "pin":"string",

}

 

Response

JSON

{

}

 

Enter New Password

Send user's new password for sign in to the system in the case when old user's password expired

Url: {server-path}/enter-new-password

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

 

{

  • "ticket":"string",
  • "password":"string",

}

 

 

Response

JSON

{

}

 

Set SecuritySettings

Url: {server-path}/set-security-settings

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"string",
  • "pin":"string",
  • "SecretImage":"string",
  • "PersonalPhrase":"string"

}

 

Response

JSON

{

}

 If security settings were successfully changed logs user in and returns AuthStep = 0

Get Application Settings

Url: {server-path}/get-application-settings

HTTP Method: GET

Message direction

Format

Body

Additional info (possible values)

Request

JSON

 

 

Response

JSON

'Settings' field can contain various quantity of string parameters depending on properties declared in 'MobileAppSettings' table

Add Watch List

Url: {server-path}/add-watch-list

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"string",
  • "watchListName":"string"

}

 

Response

JSON

{

  • "ResponseCode":"int",
  • "Ticket":"string",
  • "Result":{
    • "Id":"int",
    • "UserId":"int",
    • "Name":"string",
    • "Description":"string",
    • "Type":"int",
    • "CreateDate":"DateTime",
    • "ModifyDate":"DateTime",
    • "ReadOnly":false,
    • "SecurityList":[]
    }

}

ResponseCode values: 0, 1, 2, 3, 6

Ticket is authentication ticket.

Result is added watch list.

 

Delete Watch List

Url: {server-path}/delete-watch-list

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"string",
  • "watchListId":"int"

}

 

Response

JSON

{

  • "ResponseCode":"int",
  • "Ticket":"string",
  • "Result":"int"

}

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result is removed watch list ID.

 

Edit Watch List Name

Url: {server-path}/edit-watch-list-name

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"string",
  • "watchlistId":"int"
  • "newWatchListName":"string"

}

 

Response

JSON

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result is watch list.

 

Add Security To Watch List

Url: {server-path}/add-security-to-watch-list

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{
  • "ticket":"string",
  • "watchlistId":"int",
  • "securityId":"int"
}
 

Response

JSON

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result is just added security.

 

Delete Security From Watch List

Url: {server-path}/delete-security-from-watch-list

HTTP Method: POST

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{
  • "ticket":"string",
  • "watchlistId":"int",
  • "securityId":"int"
}
 

Response

JSON

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result is watch list.

Get Accounts

Url: {server-path}/get-accounts

HTTP Method: POST

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON

{

  • "ticket":"string"

}

 
ResponseJSON
{  
 ResponseCode:int,
 Ticket:string,
 Result:[int]
}

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result is user accounts ids.

 

Get Account Balance History

Sign in user to the system

Url: {server-path}/get-account-balance-history

HTTP Method: POST 

Message direction

Format

Body

Additional info (possible values)

Request

JSON

{

  • "ticket":"837CF...CE4E",
  • "accountId":140,
  • "startDate":1441034790,
  • "userId":1143,
  • "endDate":1442030400,
  • "step":86400

}

startDate and endDate are UNIX-timestamps of start and end of a history period.

step - step in seconds between history points

Response

JSON

{

  • "ResponseCode":0,
  • "Result":[
    • {
      • "Date":"\/Date(1441065600000+0000)\/",
      • "Value":1194019.39463
      },
    • {
      • "Date":"\/Date(1441152000000+0000)\/",
      • "Value":1196641.39463
      },
    • {
      • "Date":"\/Date(1441238400000+0000)\/",
      • "Value":1196641.39463
      },
    ],
  • "Ticket":"837C6...CE4E"

}

ResponseCode values: 0, 1, 3

 

Get User Info

Url: {server-path}/get-user-info

HTTP Method: POST

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON

{

  • "ticket":"string"

}

 
ResponseJSON
{  
 ResponseCode:int,
 Ticket:string,
 Result:
 {
    UserId:int, 
    FirstName:string, 
    LastName:string, 
    AccountIds:[int] 
  }
}

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

AccountIds is user accounts ids.


Get Balance

Url: {server-path}/get-balance

HTTP Method: POST

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON
{
 ticket:string,
 accountId:int,
currency:string
}
Use "USD" for currency now.
ResponseJSON
{  
 ResponseCode:int,
 Ticket:string,
 Result: 
 { 
  _attributes:
 
[   {   Name:string,  Value:object   }   ]  } }

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result is account balance.

 

Get News

Url: {server-path}/get-news-by-symbol

HTTP Method: POST

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON

{

  • "ticket":"string",
  • "symbol":"string"

}

 
ResponseJSON
{
 ResponseCode:int,
 Ticket:string,
 Result:
 [
  {
  Attachment:string,
Content:string,
 Header:string,
Key:string,
NewsId:long,
Source:string,
 Date:string
 }
 ]
}

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result is news.

 

Get Positions

Url: {server-path}/get-positions

HTTP Method: POST

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON
{
 ticket:string,
 accountId:int,
  • "pageNumber":1,
  • "accountId":140,
  • "pageSize":"15"

}

 
ResponseJSON
{  
 ResponseCode:int,
 Ticket:string,
 Result: 
 [
  {  
   Id:int,
SecurityId:int,
 Symbol:string,
 Name:string,
 SecurityDescription:string,
SecurityCurrency:string,
 SecurityType:string, CreateDate:long, ModifyDate:long,   AverageClosePrice:double,  AverageOpenPrice:double, CostBasis:double,  DailyCostBasis:double,  Quantity:integer,  RealizedProfitLoss:double, StopLossPrice:double, TakeProfitPrice:double, MarketValue:double
 } ] }

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result is account positions.

 

Get Orders (obsolete)

Url: {server-path}/get-orders

HTTP Method: POST

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON
{
 ticket:string, accountId:int,
pageNumber:int,
pageSize:int,
 orderType:int,
 orderStatuses:int[]
}

ticket is an authentication ticket.

accountId is a trading account id.

pageNumber is a requested page number (0-based, defaults to 0).

pageSize is a size of the page (defaults to -1).

orderType is a type of order (null or not-specified - all orders )

orderStatuses is an array of order statuses (null or empty or not-specified - all orders)

 

ResponseJSON
{  
 ResponseCode:int,
 Ticket:string,
 Result: 
 [  
  {
   Id:long,
   SecurityId:int,
   Symbol:string,
 Name:string, SecurityDescription:string,
SecurityCurrency:string,
 SecurityType:string,
Quantity:double,
Price:double,
 StopPrice:double,
ExecutedQuantity:double,
 LastPrice:double,
  LastQuantity:double,
LeavesQuantity:double,
 AveragePrice:double,
Side:string,
Date:long,
TransactionDate:long,
Status:string,
ExecutionStatus:string,
Type:string,
Description:string,
Comment:string,
TimeInForce:string,
ExecInst:string, 
ExpireDate:long,
AccountId:int,
UserId:int,
ParentId:int,
Legs:[order],
Exchange:string,
  ExecutionVenue:string,
CreateDate:long,
ExecBroker:string,
  TrailingStopAmountType:int,
TrailingStopAmount:double,
 TrailingLimitAmountType:int
TrailingLimitAmount:double

} ] }

OrderType
{
Market = 0,
Limit = 1,
Stop = 2,
StopLimit = 3,
Pegged = 14,
TrailingStop = 19,
TrailingStopLimit = 20,
OneCancelOther = 21,
OneTriggerOther = 22,
External
}

OrderStatus
{
New = 0,
PartiallyFilled = 1,
Filled = 2,
DoneForDay = 3,
Canceled = 4,
Replaced = 5,
PendingCancel = 6,
Stopped = 7,
Rejected = 8,
Suspended = 9,
PendingNew = 10,
Calculated = 11,
Expired = 12,
AcceptedForBidding = 13,
PendingReplace = 14,
Error = 15,
}

Get Orders Page

Url: {server-path}/get-orders-page

HTTP Method: POST

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON

{

  • "ticket":"837C37...465CE4E",
  • "pageNumber":1,
  • "accountId":140,
  • "pageSize":"15",
  • "orderStatuses":[1,2]
  • "orderType":0

}

ticket is an authentication ticket.

accountId is a trading account id.

pageNumber is a requested page number (0-based, defaults to 0).

pageSize is a size of the page (defaults to -1).

orderType is a type of order (null or not-specified - all orders )

orderStatuses is an array of order statuses (null or empty or not-specified - all orders)

 

ResponseJSON
{
  • "ResponseCode":0,
  • "Result":{
    • "OrderCount":197,
    • "OrderStatuses":[1,2],
    • "Orders":[{
        • "AccountId":140,
        • "AveragePrice":101.00000,
        • "Comment":null,
        • "CreateDate":"\/Date(1437146136025+0000)\/",
        • "Date":"\/Date(1437146136025+0000)\/",
        • "Description":null,
        • "Exchange":"Auto",
        • "ExecBroker":"Auto",
        • "ExecInst":"0",
        • "ExecutedQuantity":100.00000,
        • "ExecutionStatus":"Filled",
        • "ExecutionVenue":"Etna emulator",
        • "ExpireDate":"\/Date(-62135596800000)\/",
        • "Id":7904,
        • "InitialType":"Limit",
        • "LastPrice":101.00000,
        • "LastQuantity":100.00000,
        • "LeavesQuantity":0.00000,
        • "Legs":[],
        • "Name":"VMSFT",
        • "ParentId":-1,
        • "Price":102.00000,
        • "Quantity":100.00000,
        • "SecurityCurrency":"USD",
        • "SecurityId":738803,
        • "SecurityType":"CommonStock",
        • "Side":"Buy",
        • "Status":"Filled",
        • "StopPrice":0.00000,
        • "Symbol":"VMSFT",
        • "SymbolDescription":"Virtual MSFT Stock",
        • "TimeInForce":"Day",
        • "TrailingLimitAmount":0.00000,
        • "TrailingLimitAmountType":0,
        • "TrailingStopAmount":0.00000,
        • "TrailingStopAmountType":0,
        • "TransactionDate":"\/Date(1437146140143+0000)\/",
        • "Type":"Limit",
        • "UserId":1143
        },
      ]
    },
  • "Ticket":"84B87...465CE4E"
}

OrderType
{
Market = 0,
Limit = 1,
Stop = 2,
StopLimit = 3,
Pegged = 14,
TrailingStop = 19,
TrailingStopLimit = 20,
OneCancelOther = 21,
OneTriggerOther = 22,
External
}

OrderStatus
{
New = 0,
PartiallyFilled = 1,
Filled = 2,
DoneForDay = 3,
Canceled = 4,
Replaced = 5,
PendingCancel = 6,
Stopped = 7,
Rejected = 8,
Suspended = 9,
PendingNew = 10,
Calculated = 11,
Expired = 12,
AcceptedForBidding = 13,
PendingReplace = 14,
Error = 15,
}

CreateDate - date of the order creation.

Date - date of the last order modification.

Status - current status of the order.

ExecutionStatus - the state of the last operation with the order.

ExecInst - Instructions for order handling on exchange trading floor.

If more than one instruction is applicable to an order,

this field can contain multiple instructions separated by space.

Exact values of this field can be found here:

http://fiximate.fixtrading.org/en/FIX.4.2/tag18.html

Verify Order

Url: {server-path}/verify-order

HTTP Method: POST

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON

executionTarget values:

  • 1 - new
  • 2 - modify
  • 4 - cancel

Id should be filled only for modify and cancel

Side values:

  • 0 - buy
  • 1 - sell
  • 4 - sell short
  • 9 - buy to cover

Type values:

  • 0 - market
  • 1 - limit
  • 2 - stop
  • 3 - stop limit

TimeInForce values:

  • 0 - day
  • 1 - DTC
  • 6 - GTD

Contingent:

PriceType values:

  • Ask
  • Bid
  • Last
Direction values:
  • Gt
  • Lt
ExtendedHours:
  • PRE
  • POST
  • ALL
  • REGPOST
  • PREREG
  • PREPOST

 

ResponseJSON
{
  • "ResponseCode":0,
  • "Result":{

    • "Commission":4.75000,
    • "CommissionInfo":

      [
      {
      "CommissionId": "Per Trade Commission",
      "CommissionValue": 4.75
      }
      ],

    • "Cost":11574.00,
    • "NetCost": 11578.75
    • "ErrorDescription":null,
    • "ErrorDescriptionArgs":null,
    • "Quote":
      [

      {

       "EntityType":"Quote",
      • "QuoteTypes":"0",
      • "Ask":"76",
      • "AskMarket":"",
      • "AskTime":"08/20/2015 20:00:00",
      • "AskUpdate":"False",
      • "Bid":"72.9",
      • "BidMarket":"",
      • "BidTime":"01/01/1970 00:00:00",
      • "BidUpdate":"False",
      • "Last":"69",
      • "Price":"69",
      • "LastMarket":"",
      • "Key":"738939",
      • "Date":"08/11/2015 13:51:18",
      • "High":"69",
      • "Low":"69",
      • "Open":"69",
      • "Close":"69",
      • "Volume":"2",
      • "Change":"0",
      • "ChangePc":"0",
      • "Week52Low":"67.8",
      • "Week52High":"125.9",
      • "Dividend":"0",
      • "DividendShare":"0",
      • "DividendYield":"0",
      • "MarketCap":"0",
      • "Eps":"0",
      • "DayHigh":"0",
      • "DayLow":"0",
      • "PeRatio":"0",
      • "OpenInterest":"4",
      • "TotalDailyVolume":"0",
      • "AskSize":"36",
      • "BidSize":"23",
      • "UnixTimeStamp":"0",
      • "TradeCondition":"18",
      • "Beta":"0",
      • "Sector":"",
      • "AverageVolume3Month":"0",
      • "PreviousClose":"0",
      • "DontAffectCandle":"False"

      }

      ],

    • "Result":true
    },
  • "Ticket":"3E8...8F371"
}

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Verification Order Errors

 

Place Trade Order

Url: {server-path}/place-trade-order

HTTP Method: POST

Message DirectionFormatBodyAdditional info (possible values)Example(Multi-leg)Example(Limit)
RequestJSON

public enum OrderTrailingType
{
Absolute,
Persentage
}

 

Contingent:

PriceType values:

  • Ask
  • Bid
  • Last
Direction values:
  • Gt
  • Lt
ExtendedHours:
  • PRE
  • POST
  • ALL
  • REGPOST
  • PREREG
  • PREPOST

 

Trailing:
  • AmountType:

    0 - for absolute value (price change)

    1 - for percentage changes

 

PerContractCommission is specified for all securities at once. For example, if you intend to purchase 100 Apple stocks and levy a 2-cent fee on each stock, the PerContractCommission should be set to "2" ($2 split between 100 stocks — 2 cents per stock).

PerTradeCommission is applied to the entire transaction.

 

 

{

 "accountId":140,

 "executionTarget":1,

"order":{

"TrailingLimitAmount":0,

"Legs":[

{

"Quantity":100,

"Side":0,

"SecurityId":5,

"AllOrNone":0,

"Id":0

},

{

"Quantity":1,

"Side":0,

"SecurityId":738931,

"AllOrNone":0,

"Id":0

},

{

"Quantity":1,

"Side":4,

"SecurityId":738930,

"AllOrNone":0,

"Id":0

}

],

"Price":0,

"StopPrice":0,

"Type":0,

"AllOrNone":0,

"Exchange":"Auto",

"TrailingStopAmount":0,

"TimeInForce":0

}

}
{

"executionTarget":1,

"accountId":263,

"order":{

"Price":115.74,

"Exchange":"Auto",

"TrailingLimitAmount":0,

"AllOrNone":0,

"TrailingStopAmount":0,

"Type":1,

"Quantity":100,

"SecurityId":4,

"Side":0,

"TimeInForce":0,

"StopPrice":0

}

}
ResponseJSON
{   
 ResponseCode:int, 
 ticket:string,
 result:int
}
Where 'result' is your OrderId

Verification Order Errors 

  

 

  • Get By Date Candle

Url: {server-path}/get-by-date-candle

HTTP Method: POST

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON
ticket: string
securityKey: string
start: int, 
end: int, 
period:int
}

securitySignature:

  see Etna.Trading.Security.SecurityManager.GetSecuritySignature

unixStartTime and unixEndTime: time interval in Unix format

period - candle period, basically # of sec. but allows negative vals

ResponseJSON
 GetByDatesCandleResult:
 [
  {
   OpenInterest:double,
Time:long,
Volume:double,
Close:double,
High:double,
Low:double,
Open:double
}
 ]
}
 

 

  • Get By Interval Candle

Url: {server-path}/get-by-interval-candle

HTTP Method: POST

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON
{
  • "securityKey":"AAPL",
  • "ticket":"837590...CE4E",
  • "end":1442246045,
  • "interval":-5,
  • "period":-3,
  • "start":1441641245
}

securitySignature:

  see Etna.Trading.Security.SecurityManager.GetSecuritySignature

unixStartTime and unixEndTime: time interval in Unix format

period - candle period, basically # of sec. but allows negative vals

interval - history interval, basically # of sec. but allows negative vals

 

Intervals:

-1, all available
-4, 1 day
-12, 3 days (mobile client thinks that -11)
-5, 1 week
-6, 1 month
-7, 3 months
-8, 6 months
-2, year to date
-9, 1 year
-10, 3 years

-3 custom

 

Periods:

-1, 1 minute
-2, 5 minutes
-3, 15 minutes
-4, 30 minutes
-5, 1 hour
-6, 1 day
-7, 1 week
-8, 1 month
-9, 1 quarter (3 months)
-10, half a year (6 months)
-11, 1 year

ResponseJSON
{
  • "ResponseCode":0,
  • "Result":[
    • {
      • "DateTime":"\/Date(1441719000000+0000)\/",
      • "IsMarket":true,
      • "OpenInterest":0,
      • "Time":1441719000,
      • "Volume":5608911,
      • "Close":112.522600,
      • "High":112.550000,
      • "Low":109.270000,
      • "Open":109.270000
      }
    ]
}
 

 

  • Expirations By Security

Url: {server-path}/get-expirations

HTTP Method: POST

 

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON
{
  • "ticket":"874B87...CE4E",
  • "securityId":4
}
 
ResponseJSON

{

  • "ResponseCode":0,
  • "Result":[
    • {
      • "ExpirationDate":1484870400,
      • "ExpirationType":0
      }
    ],
  • "Ticket":"837C...CE4E"

}

result contains list of expirationDate (int)

public enum OptionExpirationType
{
Regular,
Quarterly,
Weekly,
Flex,
Undefined,
Mini
}

 

  • Get Options

Url: {server-path}/get-options

HTTP Method: POST

 

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON
{
  • "ticket":"837C62...B465CE4E",
  • "expirationDate":1484870400,
  • "expirationType":0,
  • "securityId":5,
  • "range":4
}
range (n for short) is

(strike lower than under. sec. price take n) ++

(strike == under. sec. price) ++

(strike greater than under. sec. price take n) ++

ResponseJSON

{

  • "ResponseCode":0,
  • "Result":[
    • {
      • "Call":{
        • "Id":738884,
        • "Name":"GOOG7AKC580000"
        },
      • "Put":{
        • "Id":738932,
        • "Name":"GOOG7MKC580000"
        },
      • "Strike":580.00000
      },
    ],
  • "Ticket":"837C6C9...65CE4E"

}

 

 

  • Get Exchanges

Url: {server-path}/get-exchanges

HTTP Method: POST

 

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON

{

  • "ticket":"string"

}

 
ResponseJSON
{
  • "ResponseCode":0,
  • "Result":[
    • "NYSE",
    • "KNIGHT",
    • "NASDAQ",
    • "Auto"
      ],
  • "Ticket":"3E8...8F371"
}

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result is a list of exchanges available for current user.

 

  • Get User Settings

Url: {server-path}/get-user-settings

HTTP Method: POST

 

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON
{  
 ticket:string,
 userId: int
}
 
ResponseJSON
{  
 ResponseCode:int,
 Ticket:string,
 Result: string
}

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result is a serialized JSON string with settings.

 

  • Set User Settings

Url: {server-path}/set-user-settings

HTTP Method: POST

 

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON
{
  • "ticket":"string",
  • "userId":1234,
  • "settings":{
    • "OrderType":"Limit",
    • "DurationType":"GoodTillCancel",
    • "ExchangeType":"NYSE",
    • "Options":1,
    • "AON":true,
    • "Spreads":1,
    • "Stocks":100,
    • "StrikeRangeNearMoney":1
    }
}
Settings is a serialized JSON string with settings
ResponseJSON
{  
 ResponseCode:int,
 Ticket:string,
 Result: null
}

ResponseCode values: 0, 1, 2, 3

Ticket is authentication ticket.

Result is always null.

 

  • Cancel Order

Url: {server-path}/cancel-order

HTTP Method: POST

 

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON
 ticket:string,
 accountId:string,
 orderId:string
}
 
ResponseJSON

{

ResponseCode:int,
result:long

ticket:string,

}

result - canceled order Id

 

  • Replace Order

Url: {server-path}/replace-order

HTTP Method: POST

 

Message DirectionFormatBodyAdditional info (possible values)
RequestJSON
{
 ticket:string,
accountId:int,
 order: { Id:int, SecurityId:int,
 Quantity:double,
Price:double,
StopPrice:double,
Side:int,
Type:int,
Comment:string,
TimeInForce:int,
ExpireDate:int,
  TrailingStopAmountType:int,
TrailingStopAmount:double,
 TrailingLimitAmountType:int
TrailingLimitAmount:double,

Legs: [order],
  Contingent:
{
PriceType: string,
Direction: string,
Threshold: double,
SecurityId: int
}
 }
}
 
ResponseJSON

{

 exceptionCode:int, 
 ticket:string,
 result:long

}

result - replaced order Id

  • Get Order

Url: {server-path}/get-order

HTTP Method: POST

Returns a single order by it's internal identifier

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request

x-api-key

 x-api-routing

Content-Type: application/json

Accept: */*

JSON
{
  • "ticket":"string",
  • "orderId":"int"
}
orderId: an internal order identifier
Response JSON

{

    • "AccountId":140,
    • "AveragePrice":101.00000,
    • "Comment":null,
    • "CreateDate":"\/Date(1437146136025+0000)\/",
    • "Date":"\/Date(1437146136025+0000)\/",
    • "Description":null,
    • "Exchange":"Auto",
    • "ExecBroker":"Auto",
    • "ExecInst":"0",
    • "ExecutedQuantity":100.00000,
    • "ExecutionStatus":"Filled",
    • "ExecutionVenue":"Etna emulator",
    • "ExpireDate":"\/Date(-62135596800000)\/",
    • "Id":7904,
    • "InitialType":"Limit",
    • "LastPrice":101.00000,
    • "LastQuantity":100.00000,
    • "LeavesQuantity":0.00000,
    • "Legs":[],
    • "Name":"VMSFT",
    • "ParentId":-1,
    • "Price":102.00000,
    • "Quantity":100.00000,
    • "SecurityCurrency":"USD",
    • "SecurityId":738803,
    • "SecurityType":"CommonStock",
    • "Side":"Buy",
    • "Status":"Filled",
    • "StopPrice":0.00000,
    • "Symbol":"VMSFT",
    • "SymbolDescription":"Virtual MSFT Stock",
    • "TimeInForce":"Day",
    • "TrailingLimitAmount":0.00000,
    • "TrailingLimitAmountType":0,
    • "TrailingStopAmount":0.00000,
    • "TrailingStopAmountType":0,
    • "TransactionDate":"\/Date(1437146140143+0000)\/",
    • "Type":"Limit",
    • "UserId":1143
    }

OrderType (Type)
{
Market = 0,
Limit = 1,
Stop = 2,
StopLimit = 3,
Pegged = 14,
TrailingStop = 19,
TrailingStopLimit = 20,
OneCancelOther = 21,
OneTriggerOther = 22,
External
}

OrderStatus (Status, ExecutionStatus)
{
New = 0,
PartiallyFilled = 1,
Filled = 2,
DoneForDay = 3,
Canceled = 4,
Replaced = 5,
PendingCancel = 6,
Stopped = 7,
Rejected = 8,
Suspended = 9,
PendingNew = 10,
Calculated = 11,
Expired = 12,
AcceptedForBidding = 13,
PendingReplace = 14,
Error = 15,
}

  • Get Security (obsolete)

Url: {server-path}/get-security

HTTP Method: POST

Get a particular security by its symbol

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request

x-api-key

 x-api-routing

Content-Type: application/json

JSON
{
  • "ticket":"string",
  • "symbol":"string"
}
 
Response JSON

{

    • "AddedDate":"\/Date(1354205143993+0000)\/",
    • "AllowMargin":false,
    • "AllowShort":false,
    • "AllowTrade":true,
    • "ContractSize":1.00000,
    • "Currency":null,
    • "Description":"USD - APPLE Inc",
    • "Enabled":true,
    • "Exchange":"NSDQ",
    • "ExpirationDate":"\/Date(-62135596800000)\/",
    • "ExpirationName":"01 Jan 0001",
    • "ExpirationType":4,
    • "HasOptions":false,
    • "Id":4,
    • "Industry":null,
    • "MarginRate":0,
    • "ModifyDate":"\/Date(1441293639150+0000)\/",
    • "Name":"AAPL",
    • "OptionType":2,
    • "ParentId":-1,
    • "Precision":2,
    • "Sector":null,
    • "SeriesId":-1,
    • "Source":0,
    • "SourceId":null,
    • "StrikePrice":0,
    • "Suffix":null,
    • "Symbol":"AAPL",
    • "Type":6,
    • "UnderlyingSecuritySymbol":null,
    • "Unit":null
    }

 

  • Get Security

Url: {server-path}/securities/{id}

HTTP Method: GET

Get a particular security by its symbol

Path parameters: id - a security identifier, either internal id or symbol

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request

x-api-key

x-api-routing

ticket

Content-Type: application/json

Accept: /

 
 

 

  • v0/{route}/securities/GOOG
  • v0/{route}/securities/1508

 

Response JSON

{

    • "AddedDate":"\/Date(1354205143993+0000)\/",
    • "AllowMargin":false,
    • "AllowShort":false,
    • "AllowTrade":true,
    • "ContractSize":1.00000,
    • "Currency":null,
    • "Description":"USD - APPLE Inc",
    • "Enabled":true,
    • "Exchange":"NSDQ",
    • "ExpirationDate":"\/Date(-62135596800000)\/",
    • "ExpirationName":"01 Jan 0001",
    • "ExpirationType":4,
    • "HasOptions":false,
    • "Id":4,
    • "Industry":null,
    • "MarginRate":0,
    • "ModifyDate":"\/Date(1441293639150+0000)\/",
    • "Name":"AAPL",
    • "OptionType":2,
    • "ParentId":-1,
    • "Precision":2,
    • "Sector":null,
    • "SeriesId":-1,
    • "Source":0,
    • "SourceId":null,
    • "StrikePrice":0,
    • "Suffix":null,
    • "Symbol":"AAPL",
    • "Type":6,
    • "UnderlyingSecuritySymbol":null,
    • "Unit":null
    }
 

 

  • Get Accounts

Url: {server-path}/accounts

HTTP Method: GET

Loads all accounts in the system

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
  • page-size
  • page-number
 
 
 
Response JSON

{

  • "SelectAccountsResult":{
    • "ResponseCode":0,
    • "Result":[
      • {
        • "Cash":45422.41750000,
        • "CashInterestRate":0.00000000,
        • "ClearingAccount":"TSTCLR1",
        • "CloseEquity":45422.41750000,
        • "CommissionPlan":null,
        • "CreatedDate":"/Date(1354205591010+0000)/",
        • "Currency":"USD",
        • "DayTrades":0,
        • "DayTradingBuyingPower":45422.41750000,
        • "Enabled":true,
        • "FedCall":0,
        • "Id":1,
        • "IsChanged":false,
        • "MaintenanceCall":0,
        • "MarginInterestRate":0.00000000,
        • "MarginType":2,
        • "ModifiedDate":"/Date(1442208600080+0000)/",
        • "OpenExcess":45422.41750000,
        • "OptionLevel":4,
        • "OwnerType":0,
        • "Permissions":15,
        • "SmaBalance":0,
        • "Status":3,
        • "SubscriptionPlanId":0,
        • "Sweep":0
        }
      ],
    • "ticket":"string"
    }

}

 

 

},

 

  • Add/Remove Cash 

Url: {server-path}/accounts/{id} 

HTTP Method: PATCH 

Deposits/Withdraws cash to/from the account 

Note! Allowed only for users with administrator permissions

Message DirectionHeadersFormatBodyAdditional info (possible values)Example
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
JSON
  • {

  •   "instructions":[ 

  • {
    • "Resource":"cash",
    • "Action":"ActionValue",
    • "Value":"decimal",
    • "Comment":"stringValue"
  • },
  • ...
  • ]}
ActionValue
description
1Deposit
2Withdraw
  • {

  • "instructions" : [{

  • "Resource":"cash",

  • "Action":"1",

  • "Value":"20.5",

  • "Comment":"valkjdfj"

  • }]

  • }

Response JSON

{

  • "SelectAccountsResult":{
    • "ResponseCode":0,
    • "Result":[
      • {
        • Cash: 0

        • CashInterestRate: 0

        • ClearingAccount: "1"

        • CloseEquity: 0

        • CommissionPlan: null

        • CreatedDate: "/Date(1436352654215+0000)/"

        • Currency: "USD"

        • DayTrades: 0

        • DayTradingBuyingPower: 0

        • Enabled: true

        • FedCall: 0

        • Id: 1

        • IsChanged: false

        • MaintenanceCall: 0

        • MarginInterestRate: 0

        • MarginType: 2

        • ModifiedDate: "/Date(1440394200007+0000)/"

        • OpenExcess: 0

        • OptionLevel: 4

        • OwnerType: 0

        • Permissions: 15

        • Status: 3

        • SubscriptionPlanId: 0

        • Sweep: 0

        }
      ],
    • "ticket":"string"
    }

}

  

 

  • Edit Account 

Url: {server-path}/accounts/{id} 

HTTP Method: PUT 

Updates account fields

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
JSON
  • {

    • "clearingNumber":"value"
  • },

clearingNumber - clearing account number

Response JSON
  • ResponseCode":"int", 0 - success
  • "Ticket":"string",
  • "Result":"result", 0 - success

 

 

  • Create new account 

Url: {server-path}/accounts

HTTP Method: POST

Create new account

Message DirectionHeadersFormatBodyAdditional info (possible values)Example
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
JSON
{
  • "marginType": value,
  • "cash": value

}

 marginType:

  • 1 - Cash
  • 2 - Margin
  • 4 - DayTrader
  • 8 - MarginIra

cash: account cash (exampe: 1000.22)

to create new account

POST v0/myroute/accounts

headers

x-api-key:YOURAPIKEY

x-api-routing:yourrouting

tiket:YOURTICKET

request payload (body):

{"marginType": 1, "cash": 10000.54 }

Response JSON
  • ResponseCode":"int", 0 - success 
  • "Ticket":"string",
  • "Result": int - id of a created account
  

 

  • Get Account By Id 

Url: {server-path}/accounts/{id} 

HTTP Method: GET 

Gets an account by its internal id or its clearingAccount

Path Parameters: id - account identifier(s)

{id} can be either single or comma separated list of identifiers, both internal id and clearing numbers are supported 

Message DirectionHeadersFormatBodyAdditional info (possible values)Example
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 

 

 

  • v0/{route}/accounts/1

  • v0/{route}/accounts/1,2,3

  • v0/{route}/accounts/CLR095X01,CLR095X02,CLR095X013
Response JSON
    • "Result":[
      • {
        • Account {

        • Cash: 0

        • CashInterestRate: 0

        • ClearingAccount: "1"

        • CloseEquity: 0 CommissionPlan: null

        • CreatedDate: "/Date(1436352654215+0000)/"

        • Currency: "USD"

        • DayTrades: 0

        • DayTradingBuyingPower: 0

        • Enabled: true

        • FedCall: 0

        • Id: 1

        • IsChanged: false

        • MaintenanceCall: 0

        • MarginInterestRate: 0

        • MarginType: 2

        • ModifiedDate: "/Date(1440394200007+0000)/"

        • OpenExcess: 0

        • OptionLevel: 4

        • OwnerType: 0

        • Permissions: 15

        • Status: 3

        • SubscriptionPlanId: 0

        • Sweep: 0

        }
      ],
  

 

  • Unmap Account

Url: {server-path}/accounts/{id}/unmap

HTTP Method: PUT to remove an account from user

Assigns an account to a particular user

Path Parameters: Id - internal account id

Message DirectionHeadersFormatBodyExample (remove an account 15 to user 200)
Request
  •  Ticket
  • X-Api-Key
  • X-Api-Routing
  • Content-Type: application/json
  • Accept: */*
 
    • userId: int

PUT v0/myroute/accounts/15/unmap

headers

X-Api-Key:YOURAPIKEY

X-Api-Routing:yourrouting

Tiket:YOURTICKET

request payload (body):

{userId:200}

Response  null 

 

  • Map Account

Url: {server-path}/accounts/{id}/map

HTTP Method: PUT to add an account to user;

Assigns an account to a particular user

Path Parameters: Id - internal account id

Message DirectionHeadersFormatBodyExample (add an account 15 to user 200)
Request
  • Ticket 
  • X-Api-Key
  • X-Api-Routing
  • Content-Type: application/json
  • Accept: */*
 
  • userId: int
  • accessType: int

PUT v0/myroute/accounts/15/map

headers

X-Api-Key:YOURAPIKEY

X-Api-Routing:yourrouting

Ticket:YOURTICKET

request payload (body):

{userId:200, accessType: 1}

access types:

Full: 0,
ReadOnly: 1,
ClosePositionsOnly: 2

Response  null 
  • Balances

Url: {server-path}/balances/{id}

HTTP Method: GET

Path Parameters: id - a comma separated list of clearing account numbers or internal identifiers

Message DirectionHeadersFormatBodyExample
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 

 

v0/{route}/positions/5R39001X,5R39002X

Response  JSON
  • {
    • "ResponseCode":0;
    • "Result":[
      • {
        • "AccountId":1,
        • "Attributes":[
          • {"Name":"dayTrades","Value":0},
          • {"Name":"pendingCash","Value":0},
          • {"Name":"equityTotal","Value":0},
          • {"Name":"stockLongMarketValue","Value":0},
          • {"Name":"stockShortMarketValue","Value":0},
          • {"Name":"optionLongMarketValue","Value":0},
          • {"Name":"optionShortMarketValue","Value":0},
          • {"Name":"maintenanceMargin","Value":0},
          • {"Name":"optionMaintenanceMargin","Value":0},
          • {"Name":"excess","Value":0},
          • {"Name":"stockBuyingPower","Value":0},
          • {"Name":"optionBuyingPower","Value":0},
          • {"Name":"openPL","Value":0},
          • {"Name":"closePL","Value":0},
          • {"Name":"netLiquidity","Value":0},
          • {"Name":"availableCash","Value":0},
          • {"Name":"pendingOrdersCount","Value":0}
        • ],
        • "ClearingAccount":"1"
      • }
    • ],
    • "Ticket":"YOURNEXTTICKET"
  • }
 
  • Get Accounts Balances

Url: {server-path}/get-accounts-balances

HTTP Method: POST

Message DirectionHeadersFormatBodyExample
Request

 

JSON
  • {
    • clearingAccounts: string[]
  • }

 

Response  JSON
  • {
    • "ResponseCode":0;
    • "Result":[
      • {
        • "AccountId":1,
        • "Attributes":[
          • {"Name":"dayTrades","Value":0},
          • {"Name":"pendingCash","Value":0},
          • {"Name":"equityTotal","Value":0},
          • {"Name":"stockLongMarketValue","Value":0},
          • {"Name":"stockShortMarketValue","Value":0},
          • {"Name":"optionLongMarketValue","Value":0},
          • {"Name":"optionShortMarketValue","Value":0},
          • {"Name":"maintenanceMargin","Value":0},
          • {"Name":"optionMaintenanceMargin","Value":0},
          • {"Name":"excess","Value":0},
          • {"Name":"stockBuyingPower","Value":0},
          • {"Name":"optionBuyingPower","Value":0},
          • {"Name":"openPL","Value":0},
          • {"Name":"closePL","Value":0},
          • {"Name":"netLiquidity","Value":0},
          • {"Name":"availableCash","Value":0},
          • {"Name":"pendingOrdersCount","Value":0}
        • ],
        • "ClearingAccount":"1"
      • }
    • ],
    • "Ticket":"YOURNEXTTICKET"
  • }
 
  • Place order via REST

Url: {server-path}/place-trade-order

HTTP Method: POST

Path Parameters: none

Message DirectionHeadersFormatBodyAdditional info (possible values)Example
Request
  • x-api-key
  • x-api-routing
  • Content-Type: application/json
  • Accept: */*
 JSON
  • {
    • ticket:string,
    • accountId:int,
    • "order":
    • {
      • Id:int, SecurityId:int,
      • Quantity:double,
      • Price:double,
      • StopPrice:double,
      • Side:int,
      • Type:int,
      • Comment:string,
      • TimeInForce:int,
      • ExpireDate:int,
      • TrailingStopAmountType:int,
      • TrailingStopAmount:double,
      • TrailingLimitAmountType:int
      • TrailingLimitAmount:double
      • Contingent:
      • {
        • PriceType: string,
        • Direction: string,
        • Threshold: double,
        • SecurityId: int
      • }
      • "ExecutionInstructions" : 
      • [
        {
        "Key": "PerTradeCommission",
        "Value": double
        },
        {
        "Key": "PerContractComission",
        "Value": double
        }
        ]

    • }
  • }

Side: 

  • Buy = 0,

  • Sell=1,

  • SellShort=4,

  • BuyToCover=9

Type: 

  • Market = 0,

  • Limit = 1,

  • Stop = 2,

  • StopLimit = 3,

  • Pegged = 14,

  • TrailingStop = 19,

  • TrailingStopLimit = 20,

  • OneCancelOther = 21,

  • OneTriggerOther = 22,

  • External = 23

SecurityId - the internal security identifier

TimeInForce:

  • Day=0,

  • GoodTillCancel=1,

  • AtTheOpening=2,

  • ImmediateOrCancel=3,

  • FillOrKill=4,

  • GoodTillCrossing=5,

  • GoodTillDate=6

Contingent:

PriceType values:

  • Ask

  • Bid

  • Last

Direction values:

  • Gt

  • Lt

PerContractCommission is specified for all securities at once. For example, if you intend to purchase 100 Apple stocks and levy a 2-cent fee on each stock, the PerContractCommission should be set to "2" ($2 split between 100 stocks — 2 cents per stock).

PerTradeCommission is applied to the entire transaction.
{
 "ticket":"YOURTICKETHERE",
 "accountId":"INTERNALACCOUNTIDHERE",
 "order":
    {
    "Price":115.74,
    "Exchange":"Auto",
    "TrailingLimitAmount":0,
    "AllOrNone":0,
    "TrailingStopAmount":0,
    "Type":1,
    "Quantity":100,
    "SecurityId":4,
    "Side":0,
    "TimeInForce":0,
    "StopPrice":0
    }
}
Response  JSON
  • ResponseCode":"int", 0 - success

  • "Ticket":"string",

  • "Result":"result", - orderId number
 

 

 

  • Positions via REST

Url: {server-path}/positions?symbol=[symbol]&accounts=[accounts]

HTTP Method: GET

Path Parameters: 

accounts - a comma separated list of clearing account numbers

symbol - a security identifier

Message DirectionHeadersFormatBodyAdditional info (possible values)Example
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 

 

 

Response  JSON
  • {

    • ResponseCode, 

    • Result:[

      • {

        • Account,

        • CostBasis,

        • Quantity,

        • Security,

        • Type,

    • ]

    • Ticket 

  • }

  • Type

  • {

    • Empty = 0,

    • Cash = 1,

    • Margin = 2,

    • DayTrader = 4,

    • MarginIra = 8,

  • }

If there is no position on the symbol, empty array will be returned.

If there is an empty position (position which was closed) which was not yet removed by clearing action at the start of day, response with 0 quantity will be returned.

Quantity is returned as stored in DB, with 8 decimal places precision.

 

 

  • Get Accounts Positions 

Url: {server-path}/get-accounts-positions

HTTP Method: POST

Message DirectionHeadersFormatBodyAdditional info (possible values)Example
Request

 

 JSON
  •  {
    • symbol: string,
    • clearingAccounts: [array],
    • ticket: string
  • }

clearingAccount uses array of values:
["acc1", "acc2"] 

 

Response  JSON
  • {

    • ResponseCode, 

    • Result:[

      • {

        • Account,

        • CostBasis,

        • Quantity,

        • Security,

        • Type,

    • ]

    • Ticket 

  • }

  • Type

  • {

    • Empty = 0,

    • Cash = 1,

    • Margin = 2,

    • DayTrader = 4,

    • MarginIra = 8,

  • }

 

  • Users

Url: {server-path}/users

HTTP Method: GET

Path Parameters: none

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 

 

 

Response  JSON

Array of

 

  • UserId
  • Login
  • AccountIds
  • FirstName
  • LastName

 

 

  • Get Single User

Url: {server-path}/users/{id}

HTTP Method: GET

Path Parameters: id - internal user identifier

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 

 

 

Response  JSON
  • UserId
  • Login
  • AccountIds
  • FirstName
  • LastName

 

 

  • Register

Url: {server-path}/users

HTTP Method: POST

Path Parameters: id - internal user identifier

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON

 

    • "request":
      • "Login":"value",
      • Email:"value",
      • Password:"value",
      • FirstName:"value",
      • LastName:"value",
      • SecretQuestion:"value",
      • AnswerSecretQuestion:"value",
      • PIN:"value",
      • SecretImage:"value",
      • PersonalPhrase:"value",
      • "PrimaryPhoneCountry":"Primary_phone_conutry_code",
      • "PrimaryPhoneCode":"Primary_phone_country_region_code",
      • "PrimaryPhone":"Primary_phone",
      • "StreetAddress1":"Main_street_address",

      • "PostalCode":"Postal_or_zip_code.",
      • "CountryId":"Country_ID"

      • "StreetAddress2":"Secondary_street_address",

      • "City":"City",

      • "State":"state_id_when_country_is_US",

      • "CompanyId":"Company_ID",

      • "SendInvitationEmail":true/false

    • }
  • }

PIN - can be omitted for now

SecretImage - can be ommitted for now

SecretQuestion: 

2 MotherNameQuestion
3 ChildhoodNicknameQuestion
4 SpouseMeetingCityQuestion
5 ChildhoodFriendNameQuestion
6 HomeStreetThirdGradeQuestion
7 EldestSiblingBirthdayQuestion

Response  JSON
  • ResponseCode":"int", 0 - success

  • "Ticket":"string",

  • "Result": int - id of a user

 

 

  • Get Scanner Sessions

Url: {server-path}/scanner-sessions

HTTP Method: POST

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • Content-Type: application/json
  • Accept: */*
 JSON

 {

  • "userId":123456,
  • "ticket":"3E8039459...1905D28F371"

}

 

Response  JSON

{

  • "ResponseCode":0,
  • "Result":[{
    • "Session":{
      • "Id":2,
      • "SignalId":22,
      • "ExecutionRuleId":54,
      • "OriginalSignalId":33,
      • "OriginalExecutionRuleId":9867,
      • "UserId":123456,
      • "Status":1,
      • "Type":"Realtime",
      • "ExecutionStatus":0,
      • "CreateDate":""
      },
    • "SignalName":"Bingo",
    • "ExecutionRuleName":"Test Rule",
    • "SessionStatus":"Active"
    }],
  • "Ticket":"3E8039459...1905D28F371"

}

ExecutionStatusType

StatusType

ScannerSessionType

 

 

  • Stop Scanner Session

Url: {server-path}/stop-scanner-session

HTTP Method: POST

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • Content-Type: application/json
  • Accept: */*
 JSON

{

  • "userId":123456,
  • "sessionId":2,
  • "closePositions":true,
  • "ticket":"3E8039459...1905D28F371"

}

 

Response  JSON

{

  • "ResponseCode":0,
  • "Result":{}
  • "Ticket":"3E8039459...1905D28F371"

}

 

 

  • Get Session Signals

Url: {server-path}/signals

HTTP Method: POST

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • Content-Type: application/json
  • Accept: */*
 JSON

{

  • "userId":123456,
  • "sessionId":2,
  • "pageNumber":2,
  • "pageSize":15,
  • "ticket":"3E8039459...1905D28F371"

}

 

Response  JSON

{

  • "ResponseCode":0,
  • "Result":{
    • "Signals":[
      1. {
        • "Id":45,
        • "ScannerSessionId":2,
        • "SecurityId":4,
        • "ExecutionRuleId":34,
        • "Status":"New",
        • "Symbol":"ORCL",
        • "Price":3456,
        • "Date":"\/Date(1354205143993+0000)\/",
        • "ExecDate":"\/Date(1354205143993+0000)\/",
        • "CompleteDate":"\/Date(1354205143993+0000)\/",
        • "RealizedProfitLoss":4533,
        • "UserId":123456,
        • "OpenOrderId":432,
        • "ProfitLoss":653954,
        • "CostBasis":123,
        • "Quantity":100,
        • "AverageOpenPositionPrice":114,
        • "DebugInfo":""
        }
      ],
    • "SignalsCount":120
    },
  • "Ticket":"3E8039459...1905D28F371"

}

 

  • Sessions via REST

Url: {server-path}/sessions/{id}

HTTP Method: GET

Path Parameters: 

sessions id

Message Direction
Headers
Format
Body
Additional info (possible values)
Example
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 

 

 

 

Response  JSON
  • {

    • ResponseCode, 

    • Result:[

      • {

        • Id,

        • SessionId,

        • UserId,

        • ProcessId,

        • Date,

    • ]

    • Ticket 

  • }

 

 

 

  •  in version:  2.19. iOS: see ServiceAddress, Login

 

  • Security Policy: get all security policies

Url: {server-path}/securitypolicies/

HTTP Method: GET

Path Parameters: none

Available from: version 1.2.30

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 

 

 

Response  JSON

Result is array of security policy objects

 

 

  • Security Policy: get specified security policy

Url: {server-path}/securitypolicies/{id}

HTTP Method: GET

Path Parameters: id - internal security policy identifier

Available from: version 1.2.30

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 

 

 

Response  JSON

Result is security policy object

 

 

  • Security Policy: Add new security policy

Url: {server-path}/securitypolicies

HTTP Method: POST

Path Parameters: none

Available from: version 1.2.30

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON

 

Response  JSON

Result is id of added security policy

 

 

  • Security Policy: update specified security policy

Url: {server-path}/securitypolicies

HTTP Method: PUT

Path Parameters: none

Available from: version 1.2.30

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON
 
   JSON

Result is id of updated security policy

 

 

  • Security Policy: delete specified security policy

Url: {server-path}/securitypolicies/{id}

HTTP Method: DELETE

Path Parameters: id - internal security policy identifier

Available from: version 1.2.30

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON

 

 
   JSON

Result is id of deleted security policy

 

 

  • Security Policy: get all security policy rules for specified security policy

Url: {server-path}/securitypolicies/{id}/rules

HTTP Method: GET

Path Parameters: id - internal security policy identifier

Available from: version 1.2.30

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON

 

 

Response  JSON

Result is array of security policy rule objects

 

 

  • Security Policy: get specified security policy rule for specified security policy

Url: {server-path}/securitypolicies/{id}/rules/{ruleid}

HTTP Method: GET

Path Parameters: id - internal security policy identifier

ruleid - internal security rule identifier

Available from: version 1.2.30

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON

 

 

Response  JSON

Result is security policy rule object.

 

 

  • Security Policy: add new security policy rule for specified security policy

Url: {server-path}/securitypolicies/{id}/rules

HTTP Method: POST

Path Parameters: id - internal security policy identifier

Available from: version 1.2.30

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON

 

Response  JSON

Result is id of added security policy rule

 

 

  • Security Policy: update specified security policy rule for specified security policy

Url: {server-path}/securitypolicies/{id}/rules

HTTP Method: PUT

Path Parameters: id - internal security policy identifier

ruleid - internal security policy rule identifier

Available from: version 1.2.30

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON

 

Response  JSON


Result is id of updated security policy rule

 

 

  • Security Policy: delete specified security policy rule for specified security policy

Url: {server-path}/securitypolicies/{id}/rules/{ruleid}

HTTP Method: DELETE

Path Parameters: id - internal security policy identifier

ruleid - internal security policy rule identifier

Available from: version 1.2.30

 

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON 

 

Response  JSON

 

 

Result is id of removed security policy rule

 

 

  • Security Policy: get all user groups bound to specified security policy

Url: {server-path}/securitypolicies/{id}/groups/

HTTP Method: POST

Path Parameters: id - internal security policy identifier

Available from: version 1.2.30

 

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON

{

  • "ticket":"string"

}

 

Response  JSON

 

 

Result is array of bound user group ids

 

 

  • Security Policy: bind security policy to user group

Url: {server-path}/securitypolicies/{id}/groups/{groupid}

HTTP Method: POST

Path Parameters: id - internal security policy identifier

ruleid - internal security policy rule identifier

Available from: version 1.2.30

 

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON

{

  • "ticket":"string"

}

 

Response  JSON

 

 

Result is id of bound user group

 

 

  • Security Policy: unbind security policy to user group

Url: {server-path}/securitypolicies/{id}/groups/{groupid}

HTTP Method: DELETE

Path Parameters: id - internal security policy identifier

ruleid - internal security policy rule identifier

Available from: version 1.2.30

 

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON 

 

Response  JSON

 

 

Result is id of unbound user group

 

 

  • Price Alert: get all price alerts

Url: {server-path}/user/{id}/pricealert

HTTP Method: GET

Path Parameters: user id

Available from: version 1.2.35

 

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON 

 

Response  JSON

Result is array of all users' price alerts

State:
  • New = 0
  • Expired = 1

  • Completed = 2

  • Stopped = 3

Operator:

  • GTEQ
  • LTEQ

Field:

  • Bid
  • Ask
  • Last

 

  • Price Alert: add new price alert

Url: {server-path}/user/{id}/pricealert

HTTP Method: POST

Path Parameters: user id

Available from: version 1.2.35

 

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON

Operator:

  • GTEQ
  • LTEQ

Field:

  • Bid
  • Ask
  • Last

 

Response  JSON

 

 

Result is id of created price alert

 

 

  • Price Alert: get specified price alert

Url: {server-path}/user/{id}/pricealert/{id}

HTTP Method: GET

Path Parameters: price alert id and user id

Available from: version 1.2.35

 

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON 

 

Response  JSON

Result is requested price alert

State:
  • New = 0
  • Expired = 1

  • Completed = 2

  • Stopped = 3

Operator:

  • GTEQ
  • LTEQ

Field:

  • Bid
  • Ask
  • Last

 

  • Price Alert: update specified price alert

Url: {server-path}/user/{id}/pricealert/{id}

HTTP Method: PUT

Path Parameters: user id and price alert id

Available from: version 1.2.35

 

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON
State:
  • New = 0
  • Expired = 1

  • Completed = 2

  • Stopped = 3

Operator:

  • LTEQ
  • GTEQ

Field:

  • Bid
  • Ask
  • Last
Response  JSON

 

 

Result is id of updated price alert

 

 

 

excludeSecurityList is optional parameterif value is true - system will return watchlists without included securities

 

  • Notification subscriptions: get all user notifications subscriptions by channel type

Url: users/{userId}/subscriptions/{channelType}

HTTP Method: GET

Path Parameters: user identifier, notification delivery channel type 

Available from: version 1.2.35

 

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON

 

 

 
 Available channel types:

"Email", "MobileText", "MobilePush",

"WebPopupAlert"

Response  JSON

 

 

Channel:

Message delivery channel type

NotificationType:

Notification message type

State:
  • Active= 1

  • Suspended= 2

 

 

 

  • Notification subscriptions: get all user notifications subscriptions 

Url: users/{userId}/subscriptions

HTTP Method: GET

Path Parameters: user identifier

Available from: version 1.2.35

 

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON

 

 

 
 
Response  JSON

 

 

Channel:

Message delivery channel type

NotificationType:

Notification message type

State:
  • Active= 1

  • Suspended= 2

 

 

 

  • Notification subscriptions: update specified subscription

Url: users/{userId}/subscriptions

HTTP Method: PUT

Path Parameters: user identifier

Available from: version 1.2.35

 

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON
Channel:

Message delivery channel type

NotificationType:

Notification message type

State:
  • Active= 1

  • Suspended= 2
     
 
Response  JSON

 

 

Channel:

Message delivery channel type

NotificationType:

Notification message type

State:
  • Active= 1

  • Suspended= 2

 

 

 

  • Notification subscriptions: set user push unique device identifier

Url: users/{userId}/subscriptions/MobilePush/uid

HTTP Method: POST

Path Parameters: user identifier

Available from: version 1.2.35

 

Message DirectionHeadersFormatBodyAdditional info (possible values)
Request
  • x-api-key
  • x-api-routing
  • ticket
  • Content-Type: application/json
  • Accept: */*
 JSON
uid:

One signal user device unique identifier

(player_id in current implementation)

 
Response  JSON

 

 

 

 

 

SecurityList


  • Trade allocation

Url: v0/{server-path}/allocate-position

HTTP Method: POST


Message DirectionHeadersFormatBodyAdditional Info (possible values)
Request

x-api-key

x-api-routing

ticket

Content-Type: application/json 

Accept: */*

JSON
AccountType: 1-cash, 2-margin

Action: 1 - buy, 2 - sell

Instrucitons - optional property and can be omitted for most cases

Responce JSON
 

Error Descriptions:

InvalidRequestCommission - commission < 0

InvalidRequestPrice - price < 0

InvalidRequestQty - quantity < 0

InvalidAvgAccountPosition - average price account (FromAccount) doesn't have a position or position quantity < quantity to allocate

 

  • Multiple trade allocations

Url: v0/{server-path}/allocate-positions

HTTP Method: POST


Message DirectionHeadersFormatBodyAdditional Info (possible values)
Request

x-api-key

x-api-routing

ticket

Content-Type: application/json 

Accept: */*

JSON
AccountType: 1-cash, 2-margin

Action: 1 - buy, 2 - sell

Instrucitons - optional property and can be omitted for most cases

Responce JSON
 

Error Descriptions:

InvalidRequestCommission - commission < 0

InvalidRequestPrice - price < 0

InvalidRequestQty - quantity < 0

InvalidAvgAccountPosition - average price account (FromAccount) doesn't have a position or position quantity < quantity to allocate

"Quantity of allocations in request exceeds maximum allowed quantity. Max allowed quantity: {max_allocations_count}" - if too many allocation requests were passed. By default: int_max is the limit. You can configure it in rest service by adding  <add key="MaxAllocationsCount" value="{max_allocations_count}" /> to appSettings section.

 

  • Async batch allocations

Url: v0/{server-path}/allocate-multiple-async

HTTP Method: POST


Message DirectionHeadersFormatBodyAdditional Info (possible values)
Request

x-api-key

x-api-routing

ticket

Content-Type: application/json 

Accept: */*

JSON
AccountType: 1 - cash, 2 - margin
Action: 1 - buy, 2 - sell
Instrucitons - optional property and can be omitted for most cases
token - any token you want
Responce JSON
 

 


  • Request result of batch allocations

Url: v0/{server-path}/get-allocate-multiple-status

HTTP Method: POST


 

Message DirectionHeadersFormatBodyAdditional Info (possible values)
Request

x-api-key

x-api-routing

ticket

Content-Type: application/json 

Accept: */*

JSON
token - existing token for batch allocations
Responce JSON
 

Error Descriptions:

 

"FirstName":"your_FirstName",
"LastName":"your_LastName",
"Password":"your_password",
"Email":"Your emaill"

AccountType: 1-cash, 2-margin

Action: 1 - buy, 2 - sell

Instrucitons - optional property and can be omitted for most cases

token -

multiple-async

  • "pageNumber":1,
  • "accountId":140,
  • "pageSize":"15",

X-Api-Key

  • No labels