Coins Pro API
Coins Pro API
API Specification
Version 0.3.3
13 August, 2020
Changelog
Version 0.3.2 (01 June, 2020)
Updated API endpoint
Table of contents
Changelog 2
URLs 5
Unauthenticated Calls 10
GetProducts 10
GetInstruments 11
Authentication 13
GetUserAPIKeys 13
AddUserAPIKey 14
RemoveUserAPIKey 15
AuthenticateUser 15
Deposits 37
GetDepositTickets 37
Withdrawals 40
CreateWithdrawTicket 40
GetWithdrawTicket 41
GetWithdrawTickets 44
Market Data 47
Overview of Level 1 and Level 2 Market Information 47
Level 1 Data 47
SubscribeLevel1 47
Level1UpdateEvent 49
UnsubscribeLevel1 51
Level 2 data 52
SubscribeLevel2 52
Level2UpdateEvent 54
UnsubscribeLevel2 55
Trades feed 56
SubscribeTrades 56
TradeDataUpdateEvent 57
UnsubscribeTrades 58
Production wss://api.coins.asia/WSGateway/
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 type 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.
{
"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. You can find additional information 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]
GetUserAPIKeys
The endpoint will return existing APIKeys with assigned permissions. APISecret field will not
be returned.
Example
Request ->
{
"m":0,
"i":0,
"n":"GetUserAPIKeys",
"o":"{\"UserId\": 4}"
}
Response <- (full frame omitted, please read M essage Frame Format)
[
{
"UserId": 4,
"APIKey": “ab1eb50a1b0cb56a9130cdccba995a47da77a22e”,
"APISecret": "”,
"Permissions": [‘Deposit’, ‘Withdraw’],
},
...
]
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 be needed along with the permissions you wish to
enable in payload.
The endpoint will return a UserAPIKey class type 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
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
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
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
Values:
- 0=NoChange
- 1=Uptick
- 2=Downtick
[Integer]
MakerTaker 0 0 Unknown
1 Maker
2 Taker
[Integer]
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 through the API. It is important that you are subscribed to Account Actions
(SubscribeAccountEvents) in order to receive updated status events for entered orders.
Alternatively, you can also call GetOpenOrders and/or GetOrderHistory to check order status.
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]
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, 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 the 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]
ChangeReason “” [If the order has been changed, this string
value provides the reason [String]
Values:
- “Unknown”
- “NewInputAccepted”
- “NewInputRejected”
- “OtherRejected”
- “Expired”
- “Trade”
- “SystemCanceled_NoMoreMarket”
- “SystemCanceled_BelowMinimum”
- “SystemCanceled_PriceCollar”
- “SystemCanceled_MarginFailed”
- “UserModified”
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
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]
GetOpenOrders
Retrieves the Open Orders for a specified account of the 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
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]
GetDepositTickets
Get a list of deposits for an account.
Example
Request -> (full frame omitted, please read Message Frame Format)
{
"OMSId":1,
"AccountId":4,
"Limit":100,
"OperatorId":1
"StartIndex":0
}
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
Creates a withdrawal ticket to send funds from Coins Pro to the user’s Coins.ph 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
GetWithdrawTicket
Gets the current operating status of a Withdraw Ticket.
Example
Request -> (full frame omitted, please read Message Frame Format)
{
"OMSId":1,
"AccountId":4,
"RequestCode":abc12345-1234ac-abc12-8dca-abc123456,
}
Response <- (full frame omitted, please read M essage Frame Format)
{
"AssetManagerId":1,
"AccountId":1,
"AccountName":"[email protected]",
"AssetId":1,
"Amount":100,
"NotionalValue":100,
...
}
Request Parameters
Attribute Name Example Description
AccountId 1 Order Management System ID. Always 1.
Response Parameters
Attribute Name Example Description
Possible values:
- New
- AdminProcessing
- Accepted
- Rejected
- SystemProcessing
- FullyProcessed
- Failed
- Pending
- Pending2Fa
- AutoAccepted
- Delayed
GetWithdrawTickets
Get a list of withdrawals for an account.
Example
Request -> (full frame omitted, please read Message Frame Format)
{
"OMSId":1,
"AccountId":4,
"Limit":100,
“StartIndex”:0,
“OperatorId:1,
}
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
Response Parameters
Attribute Name Example Description
Possible values:
- New
- AdminProcessing
- Accepted
- Rejected
- SystemProcessing
- FullyProcessed
- Failed
- Pending
- Pending2Fa
- AutoAccepted
- Delayed
Market Data
Level 1 Data
SubscribeLevel1
Retrieves the latest Level 1 Ticker information and Subscribes the user to Level 1 Market Data
updates for the specified Instrument. After subscribing, the 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), the user 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 the user from receiving 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
Level 2 data
SubscribeLevel2
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
OMSId 1 Order Management System ID. Always 1.
Response Parameters
Attribute Example Description
8 1 InstrumentId [Integer]
9 0 Quantity [Decimal]
When subscribed to Level 2 Market Data, the user 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
[Integer]
9 1 TakerSide [Integer]
Indicates the Side of trade representing the
Taker
UnsubscribeTrades
Unsubscribes the 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
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
When subscribed to Account Events, the user will receive a PendingDepositUpdate message
when a deposit is pending to be credited into the user’s 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, the user will receive an AccountPositionEvent update
anytime the balance of their 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, the user will receive OrderState event updates anytime
the status of an order on their 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
Account 4 Your account id. [Integer]
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]
LastUpdatedTime 1588064576612 The date and time stamp of the last update
to the ticket, in POSIX format. All dates and
times are UTC.
When subscribed to Account Events, the user will receive OrderTradeEvent event updates
anytime one of their 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
MakerTaker 0 0 Unknown
1 Maker
2 Taker
[Integer]
NewOrderRejectEvent
When subscribed to Account Events, the user will receive NewOrderRejectEvent event
updates if their 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, the user will receive CancelOrderRejectEvent event
updates if the 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
rejection. [String]
InstrumentId 4 The InstrumentId from your Cancel request.
[Integer]
MarketStateUpdate
When subscribed to Account Events, the user will receive MarketStateUpdate event updates
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"
Example
Request ->
{
"m":0,
"i":0,
"n":"Ping",
"o":"{}"
}
Response <- (full frame omitted, please read M
essage Frame Format)
[
{
"msg”:”PONG”
},
]
Request Parameters
Response Parameters
Attribute Name Example Description