Coins Pro API
Coins Pro API
Coins Pro API
API Specification
Version 0.3.0
13 September, 2018
Changelog
Version 0.3.0 (13 September) - added GetDepositTickets, GetWithdrawTickets methods.
Added API keys management methods.
Table of contents
Changelog 2
URLs 5
Unauthenticated Calls 10
GetProducts 10
GetInstruments 11
Authentication 13
WebAuthenticateUser 13
GetUserAPIKeys 14
AddUserAPIKey 14
RemoveUserAPIKey 15
AuthenticateUser 15
Deposits 36
GetDepositTickets 36
Withdrawals 38
CreateWithdrawTicket 38
GetWithdrawTickets 39
Market Data 42
Overview of Level 1 and Level 2 Market Information 42
Level 1 Data 42
SubscribeLevel1 42
Level1UpdateEvent 44
UnsubscribeLevel1 45
Level 2 data 47
SubscribeLevel2 47
Level2UpdateEventB 48
UnsubscribeLevel2 49
Trades feed 51
SubscribeTrades 51
TradeDataUpdateEvent 52
UnsubscribeTrades 53
Production wss://api-cx.coins.asia/ws-api/
Staging wss://api-cx.staging.coins.technology/ws-api/
Example
{
"m":0,
"i":0,
"n":"GetProducts",
"o":"{\"OMSId":1\"}"
}
n: Function Name "n": "GetProducts" This is the name of the Remote Function that
the message is a Request or Reply to. For
instance, if you wish to make a call to the
"GetProducts" function, the Request should
contain "GetProducts" in this field, and the
Reply will also contain "GetProducts" in this
field.
20 Not Authorized
{
"result":true,
"errormsg":null,
"errorcode":0,
"detail":null
}
{
"result":false,
"errormsg":"Not Authorized",
"errorcode":20,
"detail":null
}
{
"result":false,
"errormsg":"Invalid Request",
"errorcode":100,
"detail":"OMSId must be an Integer"
}
Unsuccessful call due to operation not completing successfully
{
"result":false,
"errormsg":"Operation Failed",
"errorcode":101,
"detail":null
}
{
"result":false,
"errormsg":"Server Error",
"errorcode":102,
"detail":null
}
{
"result":false,
"errormsg":"Resource Not Found",
"errorcode":104,
"detail":null
}
Unauthenticated Calls
For all calls requiring OMSId, set OMSId = 1, also, all sections here represent separate
function names. Please read more about OMS and function names in the Message Frame
Format section.
GetProducts
Requests a list of available Products from the API.
Example
Request ->
{
"m":0,
"i":0,
"n":"GetProducts",
"o":"{\"OMSId\": 1}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
[
{
"ProductId": 1,
"Product": "BTC",
"ProductFullName": "Bitcoin",
"ProductType": "CryptoCurrency",
"DecimalPlaces": 9
},
...
]
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
GetInstruments
Example
Request ->
{
"m":0,
"i":0,
"n":"GetInstruments",
"o":"{\"OMSId\": 1}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
[
{
"InstrumentId":1,
"Symbol":"BTCUSD",
"Product1":1,
"Product1Symbol":"BTC",
"Product2":2,
"Product2Symbol":"USD",
"InstrumentType": "Standard",
},
...
]
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
InstrumentId 1 Instrument's Identifier [Integer]
You must call this in order to use any of the authenticated calls below.
Example
Request ->
{
"m":0,
"i":0,
"n":"WebAuthenticateUser",
"o":"{\"UserName\":\"User1\",\"Password\":\"Password\"}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
{
"Authenticated": true,
"SessionToken":"7d0ccf3a-ae63-44f5-a409-2301d80228bc",
"UserId": 1
}
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
AddUserAPIKey
In order to authenticate using an API key, you will need to create an ApiKey and ApiSecret
using this endpoint. Your UserId will need to be provided along with the permissions you wish
to enable in payload.
The endpoint will return a UserAPIKey classtype json string containing the APIKey and
APISecret.
Note: Please save the APIKey and APISecret values returned in a secure location. Both of
these values are needed for authentication and signature generation.
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
Possible values:
Deposit, Withdraw, Trading
RemoveUserAPIKey
Request Parameters
Attribute Name Example Description
AuthenticateUser
In order to authenticate with a key you need to use AuthenticateUser call with nonce and
generated signature.
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
Retrieves a list of account IDs for the current user. The Request should have an empty
string as the payload. Typically, each user is assigned one account.
Example
Request ->
{
"m":0,
"i":0,
"n":"GetUserAccounts",
"o":""
}
Response <- (full frame omitted, please read M
essage Frame Format)
[4]
Response Parameters
Attribute Name Example Description
GetAccountTransactions
Example
Request ->
{
"m":0,
"i":0,
"n":"GetAccountTransactions",
"o":"{\"OMSId\":1,\"AccountId\": 1,\"Depth\": 200}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
[
{
"TransactionId": 945,
"AccountId": 4,
"CR": 76,
"DR": 0,
"TransactionType": "Trade",
"ReferenceId": 232,
"ReferenceType": "Trade",
"ProductId": 2,
"Balance": 101111.1,
"TimeStamp": 1501354796418
},
...
]
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
Values:
- "Other"
- "Trade"
- "Fee"
TransactionType ReferenceType
"Other" Deposit
"Other" Withdraw
"Trade" Trade
"Fee" Trade
GetAccountPositions
Example
Request ->
{
"m":0,
"i":0,
"n":"GetAccountPositions",
"o":"{\"OMSId\":1,\"AccountId\":4}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
[{
"AccountId": 4,
"ProductSymbol": "BTC",
"ProductId": 1,
"Amount": 10497.3,
"Hold": 3.19,
"PendingDeposits": 0,
"PendingWithdraws": 0,
"TotalDayDeposits": 10500,
"TotalDayWithdraws": 0,
"TotalMonthWithdraws": 0,
}]
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
GetAccountTrades
Example
Request ->
{
"m":0,
"i":0,
"n":"GetAccountTrades",
"o":"{\"OMSId\":1,\"AccountId\":4,\"Count\":50,\"StartIndex\":0}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
[
{
"TradeId": 230,
"OrderId": 9861,
"AccountId": 4,
"ClientOrderId": 0, //Your client order id. [64 bit Integer]
"InstrumentId": 1, //Instrument Id [Integer]
"Side": "Buy", //Side [String] Values are "Buy", "Sell"
"Quantity": 2, //Quantity [Decimal]
"Price": 95, //Price [Decimal]
"Value": 190, //Value [Decimal]
"TradeTime": 1501354796418,
},
...
]
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
Market - An order used to buy or sell at the best available price. No restrictions on price or
time frame
Limit - An order to buy or sell at a specified price or better. A limit order may not be executed
if the price set is not met during the time that the order is open
StopMarket - An order to buy or sell only when an instrument reaches a set price. Once the
instrument reaches this price, the order becomes a market order.
StopLimit - An order to buy or sell only when a set price is reached. Once this price is
reached, the order becomes a limit order to buy or sell at the limit price or better.
TrailingStopMarket - An order that sets the stop price at a price with a fixed offset relative to
the market price. If the market moves and the stop price is reached, the order becomes a
market order.
TrailingStopLimit - An order that recalculates the stop price at a fixed offset relative to the
market price. It also recalculates a limit price based on a different fixed offset. If the market
reaches the stop price, the order becomes a limit order.
SendOrder
Sends a new order into the API. It is important that you are subscribed to Account Actions
(SubscribeAccountEvents) in order to see updated status events for entered orders.
Alternatively, you can also call GetOpenOrders and/or GetOrderHistory to check for the status
of your order.
Example
Request -> (full frame omitted, please read Message Frame Format)
{
"OMSId": 1,
"AccountId": 4,
"ClientOrderId": 99,
"Quantity": 1,
"DisplayQuantity": 0,
"UseDisplayQuantity": true,
"LimitPrice": 95,
"OrderIdOCO": 0,
"OrderType": 2,
"PegPriceType": 1,
"InstrumentId": 1,
"TrailingAmount": 1.0,
"LimitOffset": 2.0,
"Side": 0,
"StopPrice": 96,
"TimeInForce": 1
}
Response <- (full frame omitted, please read M
essage Frame Format)
{
"status":"Accepted",
"errormsg":"",
"OrderId": 123 // Server order id
}
Request Parameters
Attribute Name Example Description
ClientOrderId 99 Set this to your own id if you wish to use one.
It will be useful for recognizing future order
states related to this call. [64 bit Integer]
Values:
- 1 (Last)
- 2 (Bid)
- 3 (Ask)
TimeInForce 1 Values:
- 1 (Good ‘til Canceled),
- 3 (Immediate or Cancel),
- 4 (Fill or Kill)
Response Parameters
Attribute Name Example Description
Cancels an open order - Can cancel by either specifying the OrderId returned when the order
was created, or by specifying both the ClientOrderId and AccountId of the order. If AccountId
is not specified, the default user account will be used
Example
Request ->
{
"m":0,
"i":0,
"n":"CancelOrder",
"o":"{\"OMSId\":1,\"AccountId\":4,\"OrderId\":12}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
{
"status":"Processing",
"errormsg":""
"errorcode": 104, //An error code
"detail": ""
}
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
GetOrderStatus
Gets the current operating status of an order submitted to Order Management System.
Example
Request ->
{
"m":0,
"i":0,
"n":"GetOrderStatus",
"o":"{\"OMSId\":1,\"AccountId\":4,\"OrderId\":12}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
{
"Side": "Sell",
"OrderId": 9849,
"Price": 97,
"Quantity": 0.29,
"Instrument": 1,
"Account": 4,
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "FullyExecuted",
"ReceiveTime": 1532346260831,
"OrigQuantity": 1,
"QuantityExecuted": 0.71,
"OrigOrderId": 9849,
"OrigClOrdId": 0,
"RejectReason": ""
}
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
ClientOrderId 99 Set this to your own id if you wish to use one.
It will be useful for recognizing future order
states related to this call. [64 bit Integer]
RejectReason "" If the trade was rejected, this string holds the
reason [String]
GetOrderFee
Returns an estimate of the fee for a specific order and order type.
Example
Request -> (full frame omitted, please read Message Frame Format)
{
"OMSId": 1,
"AccountId": 1,
"InstrumentId": 1,
"ProductId": 1,
"Amount": 500,
"OrderType": "Market",
"MakerTaker": "Maker"
}
Response <- (full frame omitted, please read M essage Frame Format)
{
"OrderFee": 0,
"ProductId": 1
}
Request Parameters
Attribute Name Example Description
OMSId 1 Order Management System ID. Always 1.
Response Parameters
Attribute Name Example Description
GetOrderHistory
Example
Request ->
{
"m":0,
"i":0,
"n":"GetOrderHistory",
"o":"{\"OMSId\": 1,\"AccountId\": 1}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
[
{
"Side": "Sell",
"OrderId": 9849,
"Price": 97,
"Quantity": 0.29,
"Instrument": 1,
"Account": 4,
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "FullyExecuted",
"ReceiveTime": 1532346260831,
"OrigQuantity": 1,
"QuantityExecuted": 0.71,
"OrigOrderId": 9849,
"OrigClOrdId": 0,
"RejectReason": ""
},
...
]
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
ClientOrderId 99 Set this to your own id if you wish to use one.
It will be useful for recognizing future order
states related to this call. [64 bit Integer]
RejectReason "" If the trade was rejected, this string holds the
reason [String]
GetOpenOrders
Retrieves the Open Orders for specified account of current user. Keep in mind that if your
order is no longer in a working state, you will not find it using GetOpenOrders.
Example
Request ->
{
"m":0,
"i":0,
"n":"GetOpenOrders",
"o":"{\"OMSId\": 1,\"AccountId\": 1}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
[
{
"Side": "Sell",
"OrderId": 9849,
"Price": 97,
"Quantity": 0.29,
"Instrument": 1,
"Account": 4,
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "FullyExecuted",
"ReceiveTime": 1532346260831,
"OrigQuantity": 1,
"QuantityExecuted": 0.71,
"AvgPrice": 0,
"OrigOrderId": 9849,
"OrigClOrdId": 0,
"RejectReason": ""
},
...
]
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
GetDepositTickets
Get list of deposits for account.
Example
Request -> (full frame omitted, please read Message Frame Format)
{
"OMSId":1,
"AccountId":4,
"Limit":100,
"OperatorId":1
}
Response <- (full frame omitted, please read M essage Frame Format)
{
"AccountId":4,
"AssetId":4,
"AssetName":"Philippine Peso",
"Amount":23,
"OMSId":1,
"RequestCode":"178ab0fb-bbe1-4095-abf8-dca5ea4b6624",
"Status":"FullyProcessed",
"DepositInfo":"{\\"Bank Name\\": \\"Coins.ph\\",
\\"Comment\\": \\"Cash in from Coins.ph\\", \\"OrderId\\":
\\"3675137698bd4f08b4b608a398176e26\\"}",
"CreatedTimestamp":"2018-07-12T11:20:16Z",
"LastUpdateTimeStamp":"2018-07-12T11:20:16Z"
}
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
Possible values:
- New
- AdminProcessing
- Accepted
- Rejected
- SystemProcessing
- FullyProcessed
- Failed
- Pending
Withdrawals
CreateWithdrawTicket
Creates a withdrawal ticket to send funds from Coins Pro to the user’s Coins wallet.
Example
Request -> (full frame omitted, please read Message Frame Format)
{
"OMSId":1,
"ProductId":4,
"AccountId":146,
"Amount":"100"
}
Response <- (full frame omitted, please read M essage Frame Format)
{
"result":true,
"errormsg":null,
"errorcode":0
}
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
result true Result of operation, true if withdrawal ticket
was created successfully [Bool]
GetWithdrawTickets
Get list of withdrawals for account.
Example
Request -> (full frame omitted, please read Message Frame Format)
{
"OMSId":1,
"AccountId":4,
"Limit":100,
}
Response <- (full frame omitted, please read M essage Frame Format)
{
"AccountId":152,
"AssetId":5,
"AssetName":"BitcoinCash",
"Amount":0.0001,
"OMSId":1,
"RequestCode":"0d390b87-e482-48ce-81de-ac208f66817e",
"Status":"FullyProcessed",
"CreatedTimestamp":"2018-06-07T06:26:07Z",
"LastUpdateTimestamp":"2018-06-07T06:27:20Z",
}
Request Parameters
Attribute Name Example Description
Possible values:
- New
- AdminProcessing
- Accepted
- Rejected
- SystemProcessing
- FullyProcessed
- Failed
- Pending
- Pending2Fa
- AutoAccepted
- Delayed
Level 1 Data
SubscribeLevel1
Retrieves the latest Level 1 Ticker information and Subscribes User to Level 1 Market Data
updates for the specified Instrument. After subscribing, user will receive periodic
Level1UpdateEvent event information until they call UnsubscribeLevel1.
Example
Request ->
{
"m":0,
"i":0,
"n":"SubscribeLevel1",
"o":"{\"OMSId\":1,\"InstrumentId\":1}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
{
"InstrumentId": 1,
"BestBid": 0.00,
"BestOffer": 0.00,
"LastTradedPx": 0.00,
"LastTradedQty": 0.00,
"LastTradeTime": 635872032000000000,
"SessionOpen": 0.00,
"SessionHigh": 0.00,
"SessionLow": 0.00,
"SessionClose": 0.00,
"Volume": 0.00,
"CurrentDayVolume": 0.00,
"CurrentDayNumTrades": 0,
"CurrentDayPxChange": 0.0,
"Rolling24HrVolume": 0.0,
"Rolling24NumTrades": 0.0,
"Rolling24HrPxChange": 0.0,
"TimeStamp": 635872032000000000
}
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
Level1UpdateEvent
When subscribed to Level1 Market Data (after calling SubscribeLevel1), you will receive
Level1UpdateEvent messages from the server.
Example
Response <- (full frame omitted, please read M
essage Frame Format)
{
"InstrumentId": 1,
"BestBid": 0.00,
"BestOffer": 0.00,
"LastTradedPx": 0.00,
"LastTradedQty": 0.00,
"LastTradeTime": 635872032000000000,
"SessionOpen": 0.00,
"SessionHigh": 0.00,
"SessionLow": 0.00,
"SessionClose": 0.00,
"Volume": 0.00,
"CurrentDayVolume": 0.00,
"CurrentDayNumTrades": 0,
"CurrentDayPxChange": 0.0,
"Rolling24HrVolume": 0.0,
"Rolling24NumTrades": 0.0,
"Rolling24HrPxChange": 0.0,
"TimeStamp": 635872032000000000
}
Response Parameters
Attribute Name Example Description
UnsubscribeLevel1
Unsubscribes user from Level 1 Market Data updates for the specified Instrument.
Example
Request ->
{
"m":0,
"i":0,
"n":"UnsubscribeLevel1",
"o":"{\"OMSId\":1,\"InstrumentId\":1}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
{
"result": true // [Boolean]
}
//on error:
{
"result": false, // [Boolean]
"errormsg": "Error", //A message describing the error.
[String]
"errorcode": 104, //An error code
"detail": "Instrument not Found"
}
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
Retrieves the latest Level 2 Snapshot and Subscribes User to Level 2 Market Data updates for
the specified Instrument.
Example
Request ->
{
"m":0,
"i":0,
"n":"SubscribeLevel2",
"o":"{\"OMSId\":1,\"InstrumentId\":1,\"Depth\":10}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
[
[18981,0,635872032000000000,2,300000,0,300000,1,0,1],
[18982,1,635872032000000000,0,300000,1,300000,1,2,0],
...
]
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Example Description
8 1 InstrumentId [Integer]
9 0 Quantity [Decimal]
Level2UpdateEventB
When subscribed to Level 2 Market Data, you will receive Level2UpdateEvent messages from
the server.
Example
Response <- (full frame omitted, please read M
essage Frame Format)
[
[18981,0,635872032000000000,2,300000,0,95,1,0,1],
[18982,1,635872032000000000,0,300000,1,95,1,2,0],
...
]
Response Parameters
Attribute # Example Description
8 1 InstrumentId [Integer]
9 0 Quantity [Decimal]
UnsubscribeLevel2
Unsubscribes from Level 2 Market Data updates for the specified Instrument.
Example
Request ->
{
"m":0,
"i":0,
"n":"UnsubscribeLevel2",
"o":"{\"OMSId\":1,\"InstrumentId\":1}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
{
"result": true // [Boolean]
}
//on error:
{
"result": false, // [Boolean]
"errormsg": "Error" //A message describing the error. [String]
"errorcode": 104, //An error code
"detail": "Instrument not Found"
}
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
Retrieves the latest public market trades and Subscribes User to Trade updates for the
specified Instrument.
Example
Request ->
{
"m":0,
"i":0,
"n":"SubscribeTrades",
"o":"{\"OMSId\":1,\"InstrumentId\":1,\"IncludeLastCount\":100}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
[
[87,1,0.01,450.98,635872032000000000,0,1],
[88,1,0.01,450.98,635872032000000000,0,1],
[89,1,0.0368,450.98,635872032000000000,0,1],
...
]
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute # Example Description
2 1 InstrumentId [Integer]
7 63587203200000 Timestamp
0000
8 0 Direction [Integer]
Shows if this trade represents a movement of
the book price up, down, or no change.
Values:
- 0=NoChange
- 1=Uptick
- 2=Downtick
TradeDataUpdateEvent
When subscribed to Trades, you will receive TradeDataUpdateEvent messages from the
server.
Example
Response <- (full frame omitted, please read Message Frame Format)
[
[87,1,0.01,450.98,635872032000000000,0,1],
[88,1,0.01,450.98,635872032000000000,0,1],
[89,1,0.0368,450.98,635872032000000000,0,1],
...
]
Response Parameters
Attribute # Example Description
2 1 InstrumentId [Integer]
7 63587203200000 Timestamp
0000
8 0 Direction [Integer]
Shows if this trade represents a movement of
the book price up, down, or no change.
Values:
- 0=NoChange
- 1=Uptick
- 2=Downtick
UnsubscribeTrades
Unsubscribes user from Trades Market Data Feed.
Example
Request ->
{
"m":0,
"i":0,
"n":"UnsubscribeTrades",
"o":"{\"OMSId\":1,\"InstrumentId\":1}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
{
"result": true // [Boolean]
}
//on error:
{
"result": false, // [Boolean]
"errormsg": "Error" //A message describing the error. [String]
"errorcode": 104, //An error code
"detail": "Instrument not Found"
}
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
Subscribe to account-level events, such as orders, trades, deposits and withdraws. We highly
recommend that you use this subscription to track your order states.
Example
Request ->
{
"m":0,
"i":0,
"n":"SubscribeAccountEvents",
"o":"{\"OMSId\":1,\"AccountId\":1}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
{
"result": true
}
Request Parameters
Attribute Name Example Description
Response Parameters
Attribute Name Example Description
PendingDepositUpdate
When subscribed to Account Events, you will receive a PendingDepositUpdate message
when a deposit is pending on your account.
Example
Response <- (full frame omitted, please read M
essage Frame Format)
{
"AccountId": 4,
"AssetId": 1,
"TotalPendingDepositValue": 0.01
}
Response Parameters
Attribute Name Example Description
AccountPositionEvent
When subscribed to Account Events, you will receive an AccountPositionEvent any time the
balance of your account changes.
Example
Response <- (full frame omitted, please read M
essage Frame Format)
{
"AccountId":4, //Your account id number. [Integer]
"ProductSymbol":"BTC", //The Product Symbol for this balance
message. [String]
"ProductId":1, //The Product Id for this balance message.
[Integer]
"Amount":10499.1, //
"Hold":2.1, //
"PendingDeposits":0, //
"PendingWithdraws":0, //
"TotalDayDeposits":0, //
"TotalDayWithdraws":0 //
}
Response Parameters
Attribute Name Example Description
OrderStateEvent
When subscribed to Account Events, you will receive OrderState events any time the status of
an order on your account changes.
Example
Response <- (full frame omitted, please read M
essage Frame Format)
{
"Side":"Sell",
"OrderId":9849,
"Price":97,
"Quantity":1,
"Instrument":1,
"Account":4,
"OrderType":"Limit",
"ClientOrderId":0,
"OrderState":"Working",
"ReceiveTime":0,
"OrigQuantity":1,
"QuantityExecuted":0,
"ChangeReason": ""
}
Response Parameters
Attribute Name Example Description
ClientOrderId 99 Set this to your own id if you wish to use one.
It will be useful for recognizing future order
states related to this call. [64 bit Integer]
OrderTradeEvent
When subscribed to Account Events, you will receive OrderTradeEvent events any time one
of your orders results in a trade.
Example
Response <- (full frame omitted, please read M
essage Frame Format)
{
"TradeId":213,
"OrderId":9848,
"AccountId":4,
"ClientOrderId":0,
"InstrumentId":1,
"Side":"Buy",
"Quantity":0.01,
"Price":95,
"Value":0.95,
"TradeTime":635978008210426109
}
Response Parameters
NewOrderRejectEvent
When subscribed to Account Events, you will receive NewOrderRejectEvent event if your
order is rejected.
Example
Response <- (full frame omitted, please read M
essage Frame Format)
{
"AccountId": 4,
"ClientOrderId": 1234,
"Status": "Rejected",
"RejectReason": "No More Market"
}
Response Parameters
Attribute Name Example Description
RejectReason "No More Market" A message describing the reason for the
reject [String]
CancelOrderRejectEvent
When subscribed to Account Events, you will receive CancelOrderRejectEvent event if your
attempt to cancel an order is unsuccessful.
Example
Response <- (full frame omitted, please read M
essage Frame Format)
{
"AccountId": 4,
"OrderId": 1,
"OrderRevision": 0,
"OrderType": "Unknown",
"InstrumentId": 1,
"Status": "Rejected",
"RejectReason": "Order Not Found"
}
Response Parameters
Attribute Name Example Description
RejectReason "Order Not Found" A message describing the reason for the
reject. [String]
InstrumentId 4 The InstrumentId from your Cancel request.
[Integer]
MarketStateUpdate
When subscribed to Account Events, you will receive MarketStateUpdate event if the market
state is administratively altered
Example
Response <- (full frame omitted, please read M
essage Frame Format)
{
"ExchangeId":1, //
"VenueAdapterId":1, //
"VenueInstrumentId":1, //
"Action":"ReOpen", //
"PreviousStatus":"Stopped", //
"NewStatus":"Running", //
"ExchangeDateTime":"2016-04-21T21:48:22Z"
}
Response Parameters
Attribute Name Example Description
Values:
- "Running"
- "Paused"
- "Stopped"
- "Starting"