To access API, you have to make connection to the system using REST API
Request
api/authentication
Method
POST
Params
Param | Type | Option |
---|---|---|
username | string | required |
password | string | required |
twofacode | string | optional |
Response
{
"data" : {
"token" : "59bf5e3c-ff7d-4a60-a772-f841028ba90d",
}, {
"result" : "true",
"error" : ""
}
}
All WebSocket Calls and Replies are embedded into a JSON-Formatted Frame object containing the relevant information about the call or reply, as well as the payload.
{
"m":0,
"i":0,
"n":"function",
"o":"payload"
}
This describes the type of call the message relates to. Valid values are:
0 = Request
1 = Reply
2 = Subscribe To Event
3 = Event
4 = Unsubscribe from Event
5 = Error
This is the sequence number of the message. The Client-Side sequence number should always be an Even Number, such that your sequence number variable should always be incremented by 2 (i += 2). All messages will contain either an original sequence number (message types 0, 2, 3, 4), or will contain the ID of the request message the message is in reply to (message types 1, 5).
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 WebAuthenticateUser function, the Request should contain "WebAuthenticateUser" in this field, and the Reply will also contain "WebAuthenticateUser" in this field.
This is a JSON-formatted string containing the data being sent with the message, either as Parameters in a Request, or as the data in a Reply to a Request.
When sending a Requenst to our API using javascript, a call would look as follows:
var frame =
{
"m":0,
"i":0,
"n":"function name",
"o":""
};
var requestPayload =
{
"Parameter1":"Value",
"Parameter2":0
};
frame.o = json.Stringify(requestPayload);
WS.Send(json.Stringify(frame));
When receiving a frame from our API, use the frame to determine the context, and then unwrap the content:
var frame = json.Parse(wsMessage);
if (frame.i == 1)
{
//This is a Reply
if (frame.n == "WebAuthenticateUser")
{
var LoginReply = json.Parse(frame.o);
if (LoginReply.Authenticated)
{
var user = LoginReply.User;
}
}
}
Response payloads not returning object data and common error responses will follow pattern below:
// Successful call with no return object
{
"result":true,
"errormsg":null,
"errorcode":0,
"detail":null
}
// Unsuccessful call due authorization
{
"result":false,
"errormsg":"Not Authorized",
"errorcode":20,
"detail":null
}
// Unsuccessful call due to invalid request params
{
"result":false,
"errormsg":"Invalid Request",
"errorcode":100, // Some methods have custom codes and further detail
"detail":null // can be "OMSId must be an Integer" or similar
}
// Unsuccessful call due to operation not completing successfully
{
"result":false,
"errormsg":"Operation Failed",
"errorcode":101, // Some methods have custom codes and further detail
"detail":null
}
// Unsuccessful call due to unexpected server error
{
"result":false,
"errormsg":"Server Error",
"errorcode":102, // Some methods have custom codes and further detail
"detail":null
}
// Unsuccessful call due to missing resource (user id not in system, etc)
{
"result":false,
"errormsg":"Resource Not Found",
"errorcode":104, // Some methods have custom codes and further detail
"detail":null
}
For all calls requiring OMSId and/or OperatorId set OperatorId = 1 and/or OMSId = 1
Requests a list of available Products from the API.
{
"OMSId": 1 //OMS Identifier [Integer] Always 1
}
[
{
"OMSId": 1, //Product's OMS Identifier [Integer] Always 1
"ProductId": 1, //Product's ID Number [Integer]
"ProductSymbol": "BTC", //Product's Symbol [String]
"FullName": "Bitcoin", //Product's Full Name [String]
"ProductType": "CryptoCurrency", //Product's Type [String] Values are "NationalCurrency" and "CryptoCurrency"
"DecimalPlaces": 9 //Product's Precision [Integer]
},
...
]
Requests a list of available trading instruments (pairs) from the API.
{
"OMSId": 1 //OMS Identifier [Integer] Always 1
}
[
{
"OMSId":1, //Instrument's OMS Identifier [Integer] Always 1
"InstrumentId":1, //Instrument's Identifier [Integer]
"Symbol":"BTCUSD", //Instrument's Symbol [String]
"Product1":1, //Instrument's Product 1 Identifier [Integer]
"Product1Symbol":"BTC", //Instrument's Product 1 Symbol [String]
"Product2":2, //Instrument's Product 2 Identifier [Integer]
"Product2Symbol":"LTC", //Instrument's Product 2 Symbol [String]
"InstrumentType": "Standard", //Type of Instrument [String] "Standard"
"VenueInstrumentId":1, //Internal Use
"SortIndex":0 //Internal Use
}
]
Requests a single product's information from the API.
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"Symbol": "BTC" //Product's Symbol [String]
}
//or
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"ProductId": 1 //Product's Identifer [Integer]
}
{
"OMSId": 1, //Product's OMS Identifier [Integer] Always 1
"ProductId": 1, //Product's ID Number [Integer]
"Product": "BTC", //Product's Symbol [String]
"ProductFullName": "Bitcoin", //Product's Full Name [String]
"ProductType": "CryptoCurrency", //Product's Type [String] Values are "NationalCurrency" and "CryptoCurrency"
"DecimalPlaces": 9 //Product's Precision [Integer]
}
Requests a single instrument's information from the API.
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"Symbol": "BTCUSD" //Instrument's Symbol [String]
}
//or
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"InstrumentId": 1 //Instrument's Identifer [Integer]
}
{
"OMSId":1, //Instrument's OMS Identifier [Integer] Always 1
"InstrumentId":1, //Instrument's Identifier [Integer]
"Symbol":"BTCUSD", //Instrument's Symbol [String]
"Product1":1, //Instrument's Product 1 Identifier [Integer]
"Product1Symbol":"BTC", //Instrument's Product 1 Symbol [String]
"Product2":2, //Instrument's Product 2 Identifier [Integer]
"Product2Symbol":"LTC", //Instrument's Product 2 Symbol [String]
"InstrumentType": "Standard", //Type of Instrument [String] "Standard"
"VenueInstrumentId":1, //Internal Use
"SortIndex":0, //Internal Use
"SessionStatus": "Running", // Market Status for Instrument [String] Values are "Running", "Paused", "Stopped", "Starting"
"PreviousSessionStatus": "Paused", // Previous Market Status for Instrument [String] Values are "Running", "Paused", "Stopped", "Starting"
"SessionStatusDateTime": "2016-04-21T21:48:22Z"
}
Retrieves the latest Level 1 Ticker and Subscribes User to Level1 Market Data updates for the specified Instrument.
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"Symbol": "BTCUSD" //Instrument's Symbol [String]
}
//or
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"InstrumentId": 1 //Instrument's Identifer [Integer]
}
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"InstrumentId": 1, //Instrument's Identifier [Integer]
"BestBid": 0.00, //The current Best Bid for the Instrument. [Decimal]
"BestOffer": 0.00, //The current Best Offer for the Instrument. [Decimal]
"LastTradedPx": 0.00, //The last traded price for the Instrument. [Decimal]
"LastTradedQty": 0.00, //The last traded quantity for the Instrument. [Decimal]
"LastTradeTime": 635872032000000000, //Timestamp in .NET UTC Ticks. See code snippets for examples on converting this to other formats.
"SessionOpen": 0.00, //The Opening price. [Decimal]
"SessionHigh": 0.00, //The Highest price. [Decimal]
"SessionLow": 0.00, //The Lowest price. [Decimal]
"SessionClose": 0.00, //The Closing price. [Decimal]
"Volume": 0.00, //Volume traded. [Decimal]
"CurrentDayVolume": 0.00, //Volume traded. [Decimal]
"CurrentDayNumTrades": 0, //Number of trades for current day. [Integer]
"CurrentDayPxChange": 0.0, //Current Day price change. [Decimal]
"Rolling24HrVolume": 0.0, //Last 24 hr volume. [Decimal]
"Rolling24NumTrades": 0.0, //Last 24 number of trades. [Integer]
"Rolling24HrPxChange": 0.0, //Last 24 hr price change. [Decimal]
"TimeStamp": 635872032000000000 //Timestamp in .NET UTC Ticks. See code snippets for examples on converting this to other formats.
}
When subscribed to Level1 Market Data, you will receive Level1UpdateEvent messages from the server.
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"InstrumentId": 1, //Instrument's Identifier [Integer]
"BestBid": 0.00, //The current Best Bid for the Instrument. [Decimal]
"BestOffer": 0.00, //The current Best Offer for the Instrument. [Decimal]
"LastTradedPx": 0.00, //The last traded price for the Instrument. [Decimal]
"LastTradedQty": 0.00, //The last traded quantity for the Instrument. [Decimal]
"LastTradeTime": 635872032000000000, //Timestamp in .NET UTC Ticks. See code snippets for examples on converting this to other formats.
"SessionOpen": 0.00, //The Opening price. [Decimal]
"SessionHigh": 0.00, //The Highest price. [Decimal]
"SessionLow": 0.00, //The Lowest price. [Decimal]
"SessionClose": 0.00, //The Closing price. [Decimal]
"Volume": 0.00, //Volume traded. [Decimal]
"CurrentDayVolume": 0.00, //Volume traded. [Decimal]
"CurrentDayNumTrades": 0, //Number of trades for current day. [Integer]
"CurrentDayPxChange": 0.0, //Current Day price change. [Decimal]
"Rolling24HrVolume": 0.0, //Last 24 hr volume. [Decimal]
"Rolling24NumTrades": 0.0, //Last 24 number of trades. [Integer]
"Rolling24HrPxChange": 0.0, //Last 24 hr price change. [Decimal]
"TimeStamp": 635872032000000000 //Timestamp in .NET UTC Ticks. See code snippets for examples on converting this to other formats.
}
Unsubscribes from Level1 Market Data updates for the specified Instrument.
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"Symbol": "BTCUSD" //Instrument's Symbol [String]
}
//or
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"InstrumentId": 1 //Instrument's Identifer [Integer]
}
{
"result": true // [Boolean]
}
//on error:
{
"result": false, // [Boolean]
"errormsg": "Error" //A message describing the error. [String]
}
Retrieves the latest Level 2 Snapshot and Subscribes User to Level2 Market Data updates for the specified Instrument.
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"Symbol": "BTCUSD", //Instrument's symbol [String]
"Depth": 10 //The Depth of the book to subscribe to updates for. In this example, you would receive 10 price levels on each side of the market. [Integer]
}
//or
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"InstrumentId": 1, //Instrument's Identifer [Integer]
"Depth": 10 //The Depth of the book to subscribe to updates for. In this example, you would receive 10 price levels on each side of the market. [Integer]
}
Response Array Values:
[
[18981,0,635872032000000000,2,95,0,95,1,0,1],
[18982,1,635872032000000000,0,95,1,95,1,2,0],
...
]
When subscribed to Level2 Market Data, you will receive Level2UpdateEvent messages from the server.
Event Array Values:
[
[18981,0,635872032000000000,2,95,0,95,1,0,1],
[18982,1,635872032000000000,0,95,1,95,1,2,0],
...
]
Unsubscribes from Level 2 Market Data updates for the specified Instrument.
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"Symbol": "BTCUSD" //Instrument's Symbol [String]
}
//or
{
"OMSId": 1, //OMS Identifier [Integer] Always 1
"InstrumentId": 1 //Instrument's Identifer [Integer]
}
{
"result": true // [Boolean]
}
//on error:
{
"result": false, // [Boolean]
"errormsg": "Error" //A message describing the error. [String]
}
Retrieves the latest Trades and Subscribes User to Trade updates for the specified Instrument.
{
"OMSId":1, //OMS Identifier [Integer] Always 1
"Symbol": "BTCUSD", //Instrument's Symbol [String]
"IncludeLastCount":100 //IncludeLastCount field specifies the number of previous trades to retrieve as a snapshot. [Integer]
}
//or
{
"OMSId":1, //OMS Identifier [Integer] Always 1
"InstrumentId":1, //Instrument's Identifer [Integer]
"IncludeLastCount":100 //IncludeLastCount field specifies the number of previous trades to retrieve as a snapshot. [Integer]
}
Response Array Values:
[
[87,1,0.01,450.98,9222816249026512723,9222816249026512952,635872032000000000,0,1],
[88,1,0.01,450.98,9222816249026512723,9222816249026512974,635872032000000000,0,1],
[89,1,0.0368,450.98,9222816249026512723,9222816249026512975,635872032000000000,0,1],
...
]
When subscribed to Trades, you will receive TradeDataUpdateEvent messages from the server. Event Array Values:
[
[87,1,0.01,450.98,9222816249026512723,9222816249026512952,635872032000000000,0,1],
[88,1,0.01,450.98,9222816249026512723,9222816249026512974,635872032000000000,0,1],
[89,1,0.0368,450.98,9222816249026512723,9222816249026512975,635872032000000000,0,1],
...
]
Unsubscribes user from Trades Market Data Feed.
{
"OMSId":1, //OMS Identifier [Integer] Always 1
"Symbol": "BTCUSD" //Instrument's Symbol [String]
}
//or
{
"OMSId":1, //OMS Identifier [Integer] Always 1
"InstrumentId":1 //Instrument's Identifer [Integer]
}
{
"result": true // [Boolean]
}
//on error:
{
"result": false, // [Boolean]
"errormsg": "Error" //A message describing the error. [String]
}
You must call this in order to use any of the authenticated calls below.
Since websocket is a true TCP connection, you only need to authenticate once per session.
{
"APIKey":"", //To get an API key, click "Get New Key" on the API page, select whether you want to allow the key to perform orders and withdraws, then click "Generate Key".
"Nonce":1234, //Nonce is a regular integer number. It must increase with every request you make. A common practice is to use unix time for this parameter.
"Signature":"" //Signature is a HMAC-SHA256 encoded message containing: nonce, API Key and Client ID. The HMAC-SHA256 code must be generated using your API Secret Key. This code must be converted to it's hexadecimal representation (64 uppercase characters).
}
//or
{
"UserName":"",
"Password":""
}
{
"User":
{
"UserId":1,
"UserName":"test",
"Email":"jeff@bluebelt.asia",
"AccountId":4,
"DateTimeCreated":"2016-04-21T21:48:22Z",
"OMSId":0,
},
"Authenticated":true
}
// on failure:
{
"Authenticated": false
}
You must call this in order to use any of the authenticated calls below.
{
"UserName":"",
"Password":""
}
{
"Authenticated": true,
"SessionToken":"7d0ccf3a-ae63-44f5-a409-2301d80228bc",
"UserId": 1
}
// on failure:
{
"Authenticated": false
}
Get ticker data for populating a chart
{
"OMSId":1,
"InstrumentId":1,
"FromDate":"2016-07-18",
"ToDate":"2016-07-21",
"Interval":"60"
}
Response Array Values: Timestamp HighPrice [Decimal] LowPrice [Decimal] OpenPrice [Decimal] ClosePrice [Decimal] Volume [Decimal] Bid [Decimal] Ask [Decimal]
[[1468896617000,680,680,680,680,0.4,674.18,680],[1468900660000,674.15,674.15,674.15,674.15,9.68000000,674.18,674.2], ... ]
Get ticker data for populating a chart and subscribe to future ticks. Interval specifies how frequently to get updates and IncludeLastCount limits the number of records in history
{
"OMSId":1,
"InstrumentId":1,
"Interval":"60",
"IncludeLastCount":1000
}
Response Array Values: Timestamp HighPrice [Decimal] LowPrice [Decimal] OpenPrice [Decimal] ClosePrice [Decimal] Volume [Decimal] Bid [Decimal] Ask [Decimal]
[[1468896617000,680,680,680,680,0.4,674.18,680],[1468900660000,674.15,674.15,674.15,674.15,9.68000000,674.18,674.2], ... ]
Ticket data events emitted for active subscriptions containing data for populating a chart
Response Array Values: Timestamp HighPrice [Decimal] LowPrice [Decimal] OpenPrice [Decimal] ClosePrice [Decimal] Volume [Decimal] Bid [Decimal] Ask [Decimal]
[[1468896617000,680,680,680,680,0.4,674.18,680],[1468900660000,674.15,674.15,674.15,674.15,9.68000000,674.18,674.2], ... ]
Unsubscribe from an active ticker data subscription
{
"OMSId":1,
"InstrumentId":1
}
{
"result":true,
"errormsg":null,
"errorcode":0,
"detail":null
}
Get the available OMS's on the system you're connected to
{
"OperatorId":1
}
[{ "OMSId":1, "OMSName":"OMS 1"}]
End the current session
{}
{
"result": true
}
1st step in Google 2FA Auth process. Returns a qr code to be used for second step.
{}
{
"GoogleQRCode": "YourCode"
}
2nd step in Google 2FA Auth process. Endpoint only made available to session upon successful EnableGoogle2FA and providing the GoogleQRCode from that response.
{
"Code": "YourCode"
}
{
"Authenticated": true,
"SessionToken": "YourSessionToken"
}
Cancels pending 2FA Auth attempt.
{}
{
"result":true,
"errormsg":null,
"errorcode":0,
"detail":null
}
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.
{
"AccountId": 1,
"OMSId": 1
}
{
"result": true
}
//or
{
"result": false,
"errormsg": "Error on server"
}
When subscribed to Account Events, you will receive a PendingDepositUpdate message when a deposit is pending on your account.
{
"AccountId": 4, //Your account id number. [Integer]
"AssetId": 1, //The ProductId of the pending deposit. [Integer]
"TotalPendingDepositValue": 0.01 //The value of the pending deposit. [Decimal]
}
`
When subscribed to Account Events, you will receive an AccountPositionEvent any time the balance of your account changes.
{
"OMSId":4, //The OMSId. [Integer]
"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, //The total balance for the specified product. [Decimal]
"Hold":2.1, //The total amount of your balance that is on hold. Your Available balance for trading and withdraw is (Amount - Hold). [Decimal]
"PendingDeposits":0, //Total Deposits Pending for the specified product. [Decimal]
"PendingWithdraws":0, //Total Withdraws Pending for the specified product. [Decimal]
"TotalDayDeposits":0, //The total 24 hour deposits for the specified product. [Decimal]
"TotalDayWithdraws":0 //The total 24 hour withdraws for the specified product. [Decimal]
}
When subscribed to Account Events, you will receive OrderState events any time the status of an order on your account changes.
{
"Side":"Sell", //The side of your order. [String] Values are "Sell", "Buy", "Short"
"OrderId":9849, //The Server-Assigned Order Id. [64 bit Integer]
"Price":97, //The Price of your order. [Decimal]
"Quantity":1, //The Quantity (Remaining if partially or fully executed) of your order. [Decimal]
"Instrument":1, //The InstrumentId your order is for. [Integer]
"Account":4, //Your AccountId [Integer]
"OrderType":"Limit", //The type of order. [String] Values are "Market", "Limit", "StopMarket", "StopLimit", "TrailingStopMarket", "TrailingStopLimit"
"ClientOrderId":0, //Your client order id. [64 bit Integer]
"OrderState":"Working", //The current state of the order. [String] Values are "Working", "Rejected", "FullyExecuted", "Canceled", "Expired"
"ReceiveTime":0, //Timestamp
"OrigQuantity":1, //The original quantity of your order. [Decimal]
"QuantityExecuted":0, //The total executed quantity. [Decimal]
"AvgPrice":0, //Avergage executed price. [Decimal]
"ChangeReason":"NewInputAccepted" //The reason for the order state change. [String] Values are "NewInputAccepted","NewInputRejected","OtherRejected","Expired","Trade","SystemCanceled_BelowMinimum","SystemCanceled_NoMoreMarket","UserModified"
}
When subscribed to Account Events, you will receive OrderTradeEvent events any time one of your orders results in a trade.
{
"OMSId":1, //OMS Id [Integer]
"TradeId":213, //Trade Id [64 bit Integer]
"OrderId":9848, //Order Id [64 bit Integer]
"AccountId":4, //Your Account Id [Integer]
"ClientOrderId":0, //Your client order id. [64 bit Integer]
"InstrumentId":1, //Instrument Id [Integer]
"Side":"Buy", //Side [String] Values are "Buy", "Sell"
"Quantity":0.01, //Quantity [Decimal]
"Price":95, //Price [Decimal]
"Value":0.95, //Value [Decimal]
"TradeTime":635978008210426109, //TimeStamp
"ContraAcctId":3, //The Counterparty of the trade. The counterparty is always the clearing account. [Integer]
"OrderTradeRevision":1, //Usually 1
"Direction":"NoChange" //"Uptick", "Downtick", "NoChange"
}
When subscribed to Account Events, you will receive NewOrderRejectEvent event if your order is rejected
{
"OMSId": 1, //OMS Id [Integer] Always 1
"AccountId": 4, //Your Account Id [Integer]
"ClientOrderId": 1234, //Your Client Order Id [64 Bit Integer]
"Status": "Rejected", //Always "Rejected"
"RejectReason": "No More Market" //A message describing the reason for the reject.
}
When subscribed to Account Events, you will receive NewOrderRejectEvent event if your order is Canceled
{
"OMSId": 1, //OMS Id [Integer] Always 1
"AccountId": 4, //Your Account Id. [Integer]
"OrderId": 1, //The Order Id from your Cancel request. [64 Bit Integer]
"OrderRevision": 0, //The Revision of the Order, if it was found. [64 Bit Integer]
"OrderType": "Unknown", //The Order Type of the order, if it was found. Otherwise, "Unknown". [String]
"InstrumentId": 1, //The InstrumentId from your Cancel request. [Integer]
"Status": "Rejected", //Always "Rejected" [String]
"RejectReason": "Order Not Found" //A message describing the reason for the reject. [String]
}
When subscribed to Account Events, you will receive CancelAllOrdersRejectEvent event if all of the orders for your account are rejected
{
"OMSId": 1,
"AccountId": 4,
"InstrumentId": 0,
"Status": "Rejected",
"RejectReason": "Instrument not found."
}
When subscribed to Account Events, you will receive CancelReplaceOrderRejectEvent event if a cancel replace occurs
{
"OMSId": 1,
"AccountId": 4,
"OrderId": 9342,
"ClientOrderId": 1234,
"LimitPrice": 99.1,
"OrderIdOCO": 0,
"OrderType": "Limit",
"PegPriceType": "Bid",
"OrderIdToReplace": 9333,
"InstrumentId": 1,
"ReferencePrice": 99.1,
"Quantity": 1.0,
"Side": "Buy",
"StopPrice":0,
"TimeInForce":"GTC",
"Status":"Rejected",
"RejectReason":"Order Not Found"
}
When subscribed to Account Events, you will receive MarketStateUpdate event if the market state is administratively altered
{
"ExchangeId":1, // Exchange Id [Integer]
"VenueAdapterId":1, // Internal [Integer]
"VenueInstrumentId":1, // Instrument Id [Integer]
"Action":"ReOpen", // Market State Action [String] Values are "Pause", "Resume", "Halt", "ReOpen"
"PreviousStatus":"Stopped", // Previous Market Status for Instrument [String] Values are "Running", "Paused", "Stopped", "Starting"
"NewStatus":"Running", // Market Status for Instrument [String] Values are "Running", "Paused", "Stopped", "Starting"
"ExchangeDateTime":"2016-04-21T21:48:22Z"
}
Retrieves the current User's List of Accounts. The Request should have an empty string as the payload.
{
"OMSId": 1
}
[4] //An array of integers representing account id numbers you have access to.
Update your account info
{
"OMSID": 1,
"AccountId": 40,
"AccountName": "Primary Account",
"AccountType": "Asset", // Type of account [String] Values are "Asset", "Liability", "ProfitLoss"
"FeeGroupID": 0,
"ParentID": 0,
"RiskType": "Normal", // Risk type for this account [String] Values are "Normal", "NoRiskCheck", "NoTrading"
"VerificationLevel": 0, // Verification level for applying deposit/withdraw/trading limits
"FeeProductType": "BaseProduct", // Fee product type [String] "BaseProduct", "SingleProduct"
"FeeProduct": 0,
"RefererId": 0,
"AffiliateId": null,
"SupportedVenueIds": []
}
{
"Result": true
}
Get the AccountInfo for the requested account, if the current session is authorized to see the account information
{
"OMSId":1,
"AccountId":40
}
{
"OMSID": 1,
"AccountId": 40,
"AccountName": "Primary Account",
"AccountType": "Asset", // Type of account [String] Values are "Asset", "Liability", "ProfitLoss"
"FeeGroupID": 0,
"ParentID": 0,
"RiskType": "Normal", // Risk type for this account [String] Values are "Normal", "NoRiskCheck", "NoTrading"
"VerificationLevel": 0, // Verification level for applying deposit/withdraw/trading limits
"FeeProductType": "BaseProduct", // Fee product type [String] "BaseProduct", "SingleProduct"
"FeeProduct": 0,
"RefererId": 0,
"AffiliateId": null,
"SupportedVenueIds": []
}
Retrieves a list of recent transactions on your account.
TransactionType | ReferenceType |
---|---|
Other | Deposit |
Other | Withdraw |
Trade | Trade |
Fee | Trade |
{
"OMSId": 1,
"AccountId": 1
}
[
{
"TransactionId": 945, //The Transaction Id [64 Bit Integer]
"OMSId": 1, //OMSId [Integer]
"AccountId": 4, //Your Account Id [Integer]
"CR": 76, //The amount credited to your account. [Decimal]
"DR": 0, //The amount debited from your account. [Decimal]
"Counterparty": 3, //The Counterparty Account [Integer]
"TransactionType": "Trade", //The nature/type of the transaction. Values: "Other", "Trade", "Fee" [String]
"ReferenceId": 232, //The Id Number of the action/event object that initiated this transaction. For instance, if this was the result of a trade, this would be the TradeId. [64 bit Integer]
"ReferenceType": "Trade", //Describes the action or event that initiated this transaction. Values: "Deposit", "Withdraw", "Trade" [String]
"ProductId": 2, //Product Id [Integer]
"Balance": 101111.1 //The resulting balance after this transaction for the specified product. [Decimal]
},
{
"TransactionId": 943,
"OMSId": 1,
"AccountId": 4,
"CR": 0,
"DR": 0.8,
"Counterparty": 3,
"TransactionType": "Trade",
"ReferenceId": 232,
"ReferenceType": "Trade",
"ProductId": 1,
"Balance": 10497.3
},
...
]
Retrieves a list of Positions(Balances) on a specific account.
{
"AccountId": 4,
"OMSId": 1
}
[{
"AccountId": 4, //Your account id. [Integer]
"ProductSymbol": "BTC", //The product symbol for this record. [String]
"ProductId": 1, //The Product Id for this record. [Integer]
"Amount": 10497.3, //The Total Balance for the specified product. [Decimal]
"Hold": 3.19, //The total amount of your balance that is on hold. Your Available balance for trading and withdraw is (Amount - Hold). [Decimal]
"PendingDeposits": 0, //Total Deposits Pending for the specified product. [Decimal]
"PendingWithdraws": 0, //Total Withdraws Pending for the specified product. [Decimal]
"TotalDayDeposits": 10500, //The total 24 hour deposits for the specified product. [Decimal]
"TotalDayWithdraws": 0 //The total 24 hour withdraws for the specified product. [Decimal]
},
{
"AccountId": 4,
"ProductSymbol": "USD",
"ProductId": 2,
"Amount": 101111.1,
"Hold": 205.999999999,
"PendingDeposits": 0,
"PendingWithdraws": 0,
"TotalDayDeposits": 100500,
"TotalDayWithdraws": 0
}]
Retrieves Trade History for a specific account.
{
"OMSId": 1, //OMS Id [Integer]
"AccountId": 4, //Your Account Id [Integer]
"Count": 50 // Limit of results - defaults to 100, and max is 100 [Integer]
"StartIndex": 0 // Start Index - for pagination [Integer]
}
[
{
"OMSId": 1, //OMS Id [Integer]
"TradeId": 230, //Trade Id [64 bit Integer]
"OrderId": 9861, //Order Id [64 bit Integer]
"AccountId": 4, //Your Account Id [Integer]
"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": 635978015145675070,
"ContraAcctId": 3, //The Counterparty of the trade. The counterparty is always the clearing account. [Integer]
"OrderTradeRevision": 1, //Usually 1
"Direction": "NoChange" //"Uptick", "Downtick", "NoChange"
},
{
"OMSId": 1,
"TradeId": 229,
"OrderId": 9860,
"AccountId": 4,
"ClientOrderId": 0,
"InstrumentId": 1,
"Side": "Sell",
"Quantity": 2,
"Price": 95,
"Value": 190,
"TradeTime": 635978015145675070,
"ContraAcctId": 3,
"OrderTradeRevision": 1,
"Direction": "NoChange"
},
...
]
Retrieves Fee structure for specific Account
{
"OMSId": 1, //OMS Id [Integer]
"AccountId": 4, //Your Account Id [Integer]
}
[
{
"OMSId": 1, //OMS Id [Integer]
"AccountId": 40, //Account Id [Integer]
"InstrumentId": 1,
"FeeId": 1, //Fee Id [Integer]
"FeeAmt": .01, //Fee Amt [Decimal]
"FeeCalcType": 9861, // Method for fee calculation [String] Valus are "FlatRate" and "Percentage"
"FeeType": 4, //Your Account Id [Integer]
"LadderThreshold": 0.0,
"LadderSeconds": 1,
"IsActive": true,
"OrderType": "Limit"
}
...
]
Confirm a new users email registration - typically called via user clicking an email link sent to verify their account
{
"UserId":58,
"VerifyEmailCode":"6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String
}
{
"Verified": true/false
}
Register a new user account
{
"userInfo": {
"UserId": 0,
"UserName": "testusername",
"Email": "abc@ap.com",
"PasswordHash": "pword",
"PendingEmailCode": null,
"EmailVerified": false,
"AccountId": 0,
"DateTimeCreated": "0001-01-01T05:00:00Z",
"AffiliateId": 0,
"RefererId": 0,
"OMSId": 1,
"Use2FA": false,
"PendingCodeTime": "0001-01-01T05:00:00Z"
},
"OperatorId": 1,
"UserConfig": []
}
{ "UserId":58 }
Initial step in resetting users password. Email will be sent to user with reset link
{
"UserName":""
}
{
"result": true
}
Second step in reset password process
{
"UserId": 1,
"PendingCode": "Some special code",
"Password": "new password"
}
{
"result": true
}
Get current logged in user info
{}
{
"UserId": 58,
"UserName": "testusername",
"Email": "abc@ap.com",
"PasswordHash": "", // Never Populated
"PendingEmailCode": "", // Never Populated
"EmailVerified": true,
"AccountId": 0,
"DateTimeCreated": "2016-04-21T21:48:22Z",
"AffiliateId": 0,
"RefererId": 0,
"OMSId": 1,
"Use2FA": false,
"PendingCodeTime": "2016-07-20T19:28:44Z"
}
Set logged in user info
{
"UserId": 1,
"UserId": 58,
"UserName": "testusername",
"Email": "abc@ap.com",
"PasswordHash": "", // Ignored
"PendingEmailCode": "", // Ignored
"EmailVerified": true,
"AccountId": 4,
"DateTimeCreated": "2016-04-21T21:48:22Z",
"AffiliateId": 0,
"RefererId": 0,
"OMSId": 1,
"Use2FA": false,
"PendingCodeTime": "2016-07-21T22:56:10Z"
}
{
"UserId": 1,
"UserId": 58,
"UserName": "testusername",
"Email": "abc@ap.com",
"PasswordHash": "",
"PendingEmailCode": "",
"EmailVerified": true,
"AccountId": 4,
"DateTimeCreated": "2016-04-21T21:48:22Z",
"AffiliateId": 0,
"RefererId": 0,
"OMSId": 1,
"Use2FA": false,
"PendingCodeTime": "2016-07-21T22:56:10Z"
}
Gets current logged in users permission list
{
"OMSId": 1,
"UserId":58
}
["Trader"]
Gets all permissions availble for user
n/a
["AccountReadOnly","AddAccount","AddDepositTicketAttachment", ... ]
Gets user config keys
{
"UserId":1
}
[{
"Key": "GooglePassPhrase",
"Value": "xyz"
},
{
"Key": "2FAType",
"Value": "Google"
}]
Sets a user config key - arbitrary kvp of string, string
{
"UserId": 1,
"Config": [{
"Key": "2FAType",
"Value": "Google"
}]
}
{
"result":true,
"errormsg":null,
"errorcode":0,
"detail":null
}
Removes a user config key
{
"UserId": 58,
"Key":"2FAType"
}
{
"result":true,
"errormsg":null,
"errorcode":0,
"detail":null
}
Gets all user API Keys
{
"UserId": 1
}
[{"APIKey":"f305f77ff633b2bf303e3f5fe217831f","APISecret":"","UserId":1,"Permissions":["Trading","Withdraw","Deposit"]},{"APIKey":"de4c1f1f03d0dc62201efa316e625506","APISecret":"","UserId":1,"Permissions":["Trading","Withdraw","Deposit"]},{"APIKey":"1d5a6ca11324ddedbc309f38125edf76","APISecret":"","UserId":1,"Permissions":["Deposit"]},{"APIKey":"7c96bb14f38742aa5a5b071e932f23b3","APISecret":"","UserId":1,"Permissions":["Trading","Withdraw","Deposit"]},{"APIKey":"3f722cd0ecbcc6c9902f98863e5094ea","APISecret":"","UserId":1,"Permissions":["Trading","Withdraw"]}]
Add a user API Key
{
"APIKey": "XXX",
"APISecret": "yyy",
"UserId": 1,
"Permissions": ["Trader"]
}
{
"APIKey": "8a017d3272a04a4fe640ee9681a66b3d",
"APISecret": "fb97b6dfd00327fb601f808ae10e2ef6",
"UserId": 1,
"Permissions": ["Trader"]
}
Add a user API Key permission
{
"UserId":1,
"ApiKey":"8a017d3272a04a4fe640ee9681a66b3d",
"Permission":"Operator"
}
{
"Result": true
}
Remove a user API Key permission
{
"UserId":1,
"ApiKey":"8a017d3272a04a4fe640ee9681a66b3d",
"Permission":"Operator"
}
{
"Result": true
}
Remove a user API Key
{
"UserId":1,
"ApiKey":"8a017d3272a04a4fe640ee9681a66b3d",
}
{
"Result": true
}
Sends a new order into the API. It is important that you are subscribed to Account Actions 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. Remember that if your order is no longer in a working state, you will not find it using GetOpenOrders.
{
"AccountId": 5, //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]
"Quantity": 1, //Quantity of the Order [Decimal]
"DisplayQuantity": 0, //Quantity to Display on the Market. If your order is for 1000, and you only want to show 100 at a time in market data, set this to 100. Set to 0 to display all. [Decimal]
"LimitPrice": 95, //The limit price for this order. [Decimal].
"OrderIdOCO": 0, //If you would like to have this order cancel another on execution, set this field to the other order's server order id. Omit or set to 0 if no OCO is required. [64 Bit Integer]
"OrderType": 2, // The type of order. [Integer] Values are 1 (Market), 2 (Limit), 3 (StopMarket), 4 (StopLimit), 5 (TrailingStopMarket), 6 (TrailingStopLimit), 7 (BlockTrade)
"PegPriceType": 1, //When entering a Stop/Trailing order, set this to the type of price you would like to peg the Stop to. [Integer] Values are 1 (Last), 2 (Bid), 3 (Ask)
"InstrumentId": 1, //The Instrument Id [Integer]
"TrailingAmount": 1.0, // When entering a Trailing order, set this to the current price of the market. This ensures the trailing offset is the amount intended in a fast moving market. [Decimal]
"LimitOffset": 2.0, // When entering a Trailing Limit order, set this to offset the activation price. This allows you to activate your order away from the market. [Decimal]
"Side": 0 // 0 (Buy) or 1(Sell)
"StopPrice": 96, //The Stop Price for this order, if it is a stop order. Otherwise you may omit this field. [Decimal]
"TimeInForce": 1, // 1 (Good Till' Canceled), 3 (Immediate or Cancel), 4 (Fill or Kill)
"OMSId": 1 // OMS Id [Integer] Always 1.
}
{
"status":"Accepted",
"errormsg":"",
"OrderId": 123 // Server order id
}
Sends a modify order request to the exchange. Only the quantity of an order can be changed without canceling the order.
{
"OMSId":1, //OMS Id [Integer] Always 1.
"OrderId":0, //The server order id of the order to modify [64 bit Integer]
"InstrumentId":1, //The Instrument Id [Integer]
"PreviousOrderRevision":0, //Previous Order Revision from latest Order State. [Integer] This ensures you have the latest order state at the time this request is made.
"Quantity":0 //The new Quantity [Decimal]
}
{
"status":"Processing",
"errormsg":""
}
Cancels an open order and replaces it with a new one
{
"AccountId": 5, //Your Account Id [Integer]
"OrderIdToReplace": 1, //The Server Order Id of the order you wish to replace. [64 bit 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]
"Quantity": 1, //Quantity of the Order [Decimal]
"DisplayQuantity": 0, //Quantity to Display on the Market. If your order is for 1000, and you only want to show 100 at a time in market data, set this to 100. Set to 0 to display all. [Decimal]
"LimitPrice": 95, //The limit price for this order. [Decimal].
"OrderIdOCO": 0, //If you would like to have this order cancel another on execution, set this field to the other order's server order id. Omit or set to 0 if no OCO is required. [64 Bit Integer]
"OrderType": 2, // The type of order. [Integer] Values are 1 (Market), 2 (Limit), 3 (StopMarket), 4 (StopLimit), 5 (TrailingStopMarket), 6 (TrailingStopLimit), 7 (BlockTrade)
"PegPriceType": 1, //When entering a Stop/Trailing order, set this to the type of price you would like to peg the Stop to. [Integer] Values are 1 (Last), 2 (Bid), 3 (Ask)
"InstrumentId": 1, //The Instrument Id [Integer]
"TrailingAmount": 1.0, // When entering a Trailing order, set this to the current price of the market. This ensures the trailing offset is the amount intended in a fast moving market. [Decimal]
"LimitOffset": 2.0, // When entering a Trailing Limit order, set this to offset the activation price. This allows you to activate your order away from the market. [Decimal]
"Side": 0 // 0 (Buy) or 1(Sell)
"StopPrice": 96.6, //The Stop Price for this order, if it is a stop order. Otherwise you may omit this field. [Decimal]
"TimeInForce": 1, // 1 (Good Till' Canceled), 3 (Immediate or Cancel), 4 (Fill or Kill)
"OMSId": 1 // OMS Id [Integer] Always 1.
}
{
"status":"Processing",
"errormsg":""
}
Cancels an open order - Can cancel by either OrderId using the id returned when the order was created, or by the ClOrderId and AccountId of the order. If AccountId is not specified, the default user account will be used
{
"OMSId":1, // OMS Id [Integer].
"AccountId":0 // The account id of the order to cancel. [32 bit Integer]
"ClOrderId":0 // The client order id of the order to cancel. [64 bit Integer]
"OrderId":0 // The server order id of the order to cancel. [64 bit Integer]
}
{
"status":"Processing",
"errormsg":""
}
Cancels all of the orders for a specified Instrument/Account. Can specify the UserId or AccountId, if neither is provided, then the values default to authenticated user values. Only an Operator is allowed to cancel orders for another user or account.
{
"AccountId": 4, //Your Account Id [Integer]
"UserId": 2, //A User Id [Integer]
"OMSId": 1, //OMS Id [Integer]
"InstrumentId": 1 //Instrument Id [Integer]
}
{
"status":"Processing",
"errormsg":""
}
Gets the current operating status of an order submitted to OMS
{
"OMSId": 1,
"AccountId": 4,
"OrderId": 1 // Server order id returned in SendOrder
}
{
"Side": "Sell", //The side of your order. [String] Values are "Sell", "Buy", "Short"
"OrderId": 9849, //The Server-Assigned Order Id. [64 bit Integer]
"Price": 97, //The Price of your order. [Decimal]
"Quantity": 0.29, //The Quantity (Remaining if partially or fully executed) of your order. [Decimal]
"Instrument": 1, //The InstrumentId your order is for. [Integer]
"Account": 4, //Your AccountId [Integer]
"OrderType": "Limit", //The type of order. [String] Values are "Market", "Limit", "StopMarket", "StopLimit", "TrailingStopMarket", "TrailingStopLimit"
"ClientOrderId": 0, //Your client order id. [64 bit Integer]
"OrderState": "Working", //The current state of the order. [String] Values are "Working", "Rejected", "FullyExecuted", "Canceled", "Expired"
"ReceiveTime": 0, //Timestamp
"OrigQuantity": 1, //The original quantity of your order. [Decimal]
"QuantityExecuted": 0.71, //The total executed quantity. [Decimal]
"AvgPrice": 0, //Avergage executed price. [Decimal]
"ChangeReason": "Unknown" //For order history this will always be "Unknown" because there are no changes initiating the state.
"OrigOrderId": 9849, //The Original Server-Assigned Order Id. [64 bit Integer]
"OrigClOrdId": 001, //The Orignal Client-Designate Order Id. [64 bit Integer]
"EnteredBy": 2 //The UserId who entered the order. [Integer]
}
Get the computed fee for order execution
{
"OMSId": 1,
"AccountId": 4,
"InstrumentId": 1,
"ProductId": 1,
"Amount": 500,
"OrderType": "Market",
"MakerTaker": "Maker"
}
{
"OrderFee": 0,
"ProductId": 1
}
Retrieves a list of the last 100 orders placed on your account.
{
"OMSId": 1, //OMS Id [Integer]
"AccountId": 1 //Your account id number. [Integer]
}
[
{
"Side": "Sell", //The side of your order. [String] Values are "Sell", "Buy", "Short"
"OrderId": 9849, //The Server-Assigned Order Id. [64 bit Integer]
"Price": 97, //The Price of your order. [Decimal]
"Quantity": 0.29, //The Quantity (Remaining if partially or fully executed) of your order. [Decimal]
"Instrument": 1, //The InstrumentId your order is for. [Integer]
"Account": 4, //Your AccountId [Integer]
"OrderType": "Limit", //The type of order. [String] Values are "Market", "Limit", "StopMarket", "StopLimit", "TrailingStopMarket", "TrailingStopLimit"
"ClientOrderId": 0, //Your client order id. [64 bit Integer]
"OrderState": "Working", //The current state of the order. [String] Values are "Working", "Rejected", "FullyExecuted", "Canceled", "Expired"
"ReceiveTime": 0, //Timestamp
"OrigQuantity": 1, //The original quantity of your order. [Decimal]
"QuantityExecuted": 0.71, //The total executed quantity. [Decimal]
"AvgPrice": 0, //Avergage executed price. [Decimal]
"ChangeReason": "Unknown" //For order history this will always be "Unknown" because there are no changes initiating the state.
"OrigOrderId": 9849, //The Original Server-Assigned Order Id. [64 bit Integer]
"OrigClOrdId": 001, //The Orignal Client-Designate Order Id. [64 bit Integer]
"EnteredBy": 2, //The UserId who entered the order. [Integer]
},
{
"Side": "Buy",
"OrderId": 9848,
"Price": 95,
"Quantity": 0,
"Instrument": 1,
"Account": 4,
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "FullyExecuted",
"ReceiveTime": 0,
"OrigQuantity": 1,
"QuantityExecuted": 1,
"AvgPrice": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 9848,
"OrigClOrdId": 0,
"EnteredBy": 2
},
...
]
Retrieves the Open Orders for all accounts for the current user.
{
"OMSId": 1,
"AccountId": 1
}
[
{
"Side": "Sell", //The side of your order. [String] Values are "Sell", "Buy", "Short"
"OrderId": 9849, //The Server-Assigned Order Id. [64 bit Integer]
"Price": 97, //The Price of your order. [Decimal]
"Quantity": 0.29, //The Quantity (Remaining if partially or fully executed) of your order. [Decimal]
"Instrument": 1, //The InstrumentId your order is for. [Integer]
"Account": 4, //Your AccountId [Integer]
"OrderType": "Limit", //The type of order. [String] Values are "Market", "Limit", "StopMarket", "StopLimit", "TrailingStopMarket", "TrailingStopLimit"
"ClientOrderId": 0, //Your client order id. [64 bit Integer]
"OrderState": "Working", //The current state of the order. [String] Values are "Working", "Rejected", "FullyExecuted", "Canceled", "Expired"
"ReceiveTime": 0, //Timestamp
"OrigQuantity": 1, //The original quantity of your order. [Decimal]
"QuantityExecuted": 0.71, //The total executed quantity. [Decimal]
"AvgPrice": 0, //Avergage executed price. [Decimal]
"ChangeReason": "Unknown" //For order history this will always be "Unknown" because there are no changes initiating the state.
"OrigOrderId": 9849, //The Original Server-Assigned Order Id. [64 bit Integer]
"OrigClOrdId": 001, //The Orignal Client-Designate Order Id. [64 bit Integer]
"EnteredBy": 2, //The UserId who entered the order. [Integer]
},
{
"Side": "Sell",
"OrderId": 9849,
"Price": 97,
"Quantity": 0.29,
"Instrument": 1,
"Account": 4,
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "Working",
"ReceiveTime": 0,
"OrigQuantity": 0,
"QuantityExecuted": 0,
"AvgPrice": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 9849,
"OrigClOrdId": 1,
"EnteredBy": 2
}
]
Get required deposit info to perform a deposit
{
"OMSId":1,
"AccountId":4,
"ProductId":1
}
{
"AssetManagerId":1,
"AccountId":4,
"AssetId":4,
"ProviderId":4,
"DepositInfo":"deposit info"
}
Create a deposit ticket to be tracked by ticketing system
{
"AccountId":1,
"AssetId":1,
"Amount":100.0,
"OMSId":1,
"DepositInfo":"Result of GetDepositInfo"
}
{
"success":true,
"requestcode":"special code for future use"
}
Update a deposit ticket - typically status or amount
{
"AssetManagerId": 1, // Captured on creation, needs to be sent back to be tracked
"AccountId": 1, // Captured on creation, needs to be sent back to be tracked
"AssetId": 1, // Captured on creation, needs to be sent back to be tracked
"AssetName": "BTC", // Captured on creation, needs to be sent back to be tracked
"Amount": 100.0, // Captured on creation, needs to be sent back to be tracked
"OMSId": 1, // Captured on creation, needs to be sent back to be tracked
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String,
"RequestIP": "192.168.1.1", // Captured on creation, needs to be sent back to be tracked
"RequestUser": 1, // Captured on creation, needs to be sent back to be tracked
"RequestUserName": "testuser1", // Captured on creation, needs to be sent back to be tracked
"OperatorId": 1, // Captured on creation, needs to be sent back to be tracked
"Status":"Accepted" // Values are "New", "AdminProcessing", "Accepted", "Rejected", "SystemProcessing", "FullyProcessed", "Failed", "Pending" "FeeAmt": 0.0,
"UpdatedByUser": 1, // Captured on creation, needs to be sent back to be tracked
"UpdatedByUserName": "testuser1", // Captured on creation, needs to be sent back to be tracked
"TicketNumber": 127, // Captured on creation, needs to be sent back to be tracked
"DepositInfo": "Some important deposit info", // Captured on creation, needs to be sent back to be tracked
"CreatedTimestamp": "2016-04-21T21:48:22Z", // Captured on creation, needs to be sent back to be tracked
"LastUpdateTimeStamp": "2016-04-21T21:48:22Z" , // Captured on creation, needs to be sent back to be tracked
"Comments": [],
"Attachments": []
}
{
"result":true,
"errormsg":null,
"errorcode":0,
"detail":null
}
Get a matching deposit ticket by request code or ticket id
{
"OMSId":1,
"AccountId":4,
"RequestCode":"6D2E6447-AED7-4E5B-8759-B2F564E95FC7", // optional Guid string
"TicketId": 127 // optional
}
{
"AssetManagerId": 1,
"AccountId": 1,
"AssetId": 1,
"AssetName": "BTC",
"Amount": 100.0,
"OMSId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String,
"RequestIP": "192.168.1.1",
"RequestUser": 1,
"RequestUserName": "testuser1",
"OperatorId": 1,
"Status": "New",
"FeeAmt": 0.0,
"UpdatedByUser": 1,
"UpdatedByUserName": "testuser1",
"TicketNumber": 127,
"DepositInfo": "Some important deposit info",
"CreatedTimestamp": "2016-04-21T21:48:22Z",
"LastUpdateTimeStamp": "2016-04-21T21:48:22Z" ,
"Comments": [],
"Attachments": []
}
Gets the current state of all Deposit Tickets for an account
{
"OMSId":1,
"AccountId":4,
"Operatorid": 1
}
[
{
"AssetManagerId": 1,
"AccountId": 1,
"AssetId": 1,
"AssetName": "BTC",
"Amount": 100.0,
"OMSId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String,
"RequestIP": "192.168.1.1",
"RequestUser": 1,
"RequestUserName": "testuser1",
"OperatorId": 1,
"Status": "New",
"FeeAmt": 0.0,
"UpdatedByUser": 1,
"UpdatedByUserName": "testuser1",
"TicketNumber": 127,
"DepositInfo": "Some important deposit info",
"CreatedTimestamp": "2016-04-21T21:48:22Z",
"LastUpdateTimeStamp": "2016-04-21T21:48:22Z" ,
"Comments": [],
"Attachments": [],
},
...
]
Gets the current state of all Deposit Tickets matching provided fields. Fields are filtered with and logic based on what is included or not in query.
{
"OMSId":1,
"Operatorid": 1,
"AccountId": 4 // optional,
"Status": "New" // optional,
"TicketId": 127 // optional,
"Limit": 100 // optional,
"Username": "testuser5" // optional,
"StartTimestamp": "2016-04-21T21:48:22Z" // optional,
"EndTimestamp": "2016-11-21T21:48:22Z" // optional,
"StartTimestamp": "2016-04-21T21:48:22Z" // optional,
"Amount": 50// optional,
"AmountOperator": 1 // optional - required with amount. Values are 0: "=", 1: "amount>=value", 2: "amount<=value"
}
[
{
"AssetManagerId": 1,
"AccountId": 1,
"AssetId": 1,
"AssetName": "BTC",
"Amount": 100.0,
"OMSId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String,
"RequestIP": "192.168.1.1",
"RequestUser": 1,
"RequestUserName": "testuser1",
"OperatorId": 1,
"Status": "New",
"FeeAmt": 0.0,
"UpdatedByUser": 1,
"UpdatedByUserName": "testuser1",
"TicketNumber": 127,
"DepositInfo": "Some important deposit info",
"CreatedTimestamp": "2016-04-21T21:48:22Z",
"LastUpdateTimeStamp": "2016-04-21T21:48:22Z" ,
"Comments": [],
"Attachments": [],
},
...
]
This endpoint initiates a withdraw of funds
{
"OMSId":1,
"AccountId":18,
"ProductId":1,
"Amount":0.01,
"TemplateType":"ToExternalBitcoinAddress",
"TemplateForm":"{\"TemplateType\":\"ToExternalBitcoinAddress\",\"Comment\":\"\",\"ExternalAddress\":\"54123214\"}"
}
{
"result": true
}
Confirmation link typically sent via email
{
"UserId":1,
"VerifyCode":"7d0ccf3a-ae63-44f5-a409-2301d80228bc"
}
{
"result": true
}
This is the template field to be used in Withdraw
{
"OMSId": 1,
"ProductId": 1,
"TemplateType":"ToExternalBitcoinAddress"
}
{
"Template":"{ "TemplateType":"ToExternalBitcoinAddress", "Comment":"", "ExternalAddress":""}",
"isSuccessful":true,
"ErrorMessage":null
}
This is the available template types supported for a product
{
"OMSId": 1,
"ProductId": 1
}
{
"TemplateTypes":["ToExternalBitcoinAddress"],
"isSuccessful":true,
"ErrorMessage":null
}
Get the withdraws for an account
{
"OMSId":1,
"AccountId":4
}
[
{
"AssetManagerId": 1,
"AccountId": 1,
"AssetId": 1,
"AssetName": "BTC",
"Amount": 100.0,
"TemplateForm": "a template form",
"TemplateFormType": "a template type" // type provided by get template form types call
"OMSId": 1
},
...
]
Update a withdraw ticket - typically status or amount
{
"AssetManagerId": 1, // Captured on creation, needs to be sent back to be tracked
"AccountId": 1, // Captured on creation, needs to be sent back to be tracked
"AssetId": 1, // Captured on creation, needs to be sent back to be tracked
"AssetName": "BTC", // Captured on creation, needs to be sent back to be tracked
"Amount": 100.0, // Captured on creation, needs to be sent back to be tracked
"TemplateForm": "a template form",
"TemplateFormType": "a template type" // type provided by get template form types call
"OMSId": 1, // Captured on creation, needs to be sent back to be tracked
"RequestCode": "286340ff-af84-4975-91e0-716cb1cde589", // should be from GetWithdrawTickets call
"RequestIP": "96.227.119.72", // Captured on creation, needs to be sent back to be tracked
"RequestUserId": 18, // Captured on creation, needs to be sent back to be tracked
"RequestUserName": "keith", // Captured on creation, needs to be sent back to be tracked
"OperatorId": 1, // Captured on creation, needs to be sent back to be tracked
"Status": "Pending2Fa", // Values are "New", "AdminProcessing", "Accepted", "Rejected", "SystemProcessing", "FullyProcessed", "Failed", "Pending", "Pending2Fa", "AutoAccepted"
"FeeAmt": 0, // Captured on creation, needs to be sent back to be tracked
"UpdatedByUser": 18, // Captured on creation, needs to be sent back to be tracked
"UpdatedByUserName": "keith", // Captured on creation, needs to be sent back to be tracked
"TicketNumber": 1, // Captured on creation, needs to be sent back to be tracked
"CreatedTimestamp": "2017-03-14T23: 34: 12Z", // Captured on creation, needs to be sent back to be tracked
"LastUpdateTimestamp": "2017-03-14T23: 34: 12Z", // Captured on creation, needs to be sent back to be tracked
"Comments": [],
"Attachments": [],
"AuditLog": []
}
{
"result":true,
"errormsg":null,
"errorcode":0,
"detail":null
}
Gets the current state of all Withdraw Tickets requested for an account
{
"OMSId":1,
"AccountId":4
}
[
{
"AssetManagerId": 1,
"AccountId": 1,
"AssetId": 1,
"AssetName": "BTC",
"Amount": 100.0,
"TemplateForm": "some template form",
"TemplateFormType": "some template form type",
"OMSId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String,
"RequestIP": "192.168.1.1",
"RequestUserId": 1,
"RequestUserName": "testuser1",
"OperatorId": 1,
"Status": "New",
"FeeAmt": 0.0,
"UpdatedByUser": 1,
"UpdatedByUserName": "testuser1",
"TicketNumber": 127
"CreatedTimestamp": "2016-04-21T21:48:22Z",
"LastUpdateTimeStamp": "2016-04-21T21:48:22Z",
"Comments": [],
"Attachments": [],
"AuditLog": []
},
]
Gets the current state of all Withdraw Tickets matching provided fields. Fields are filtered with and logic based on what is included or not in query.
{
"OMSId":1,
"Operatorid": 1,
"AccountId": 4, // optional
"Status": "New", // optional
"TicketId": 127, // optional
"Limit": 100, // optional
"Username": "testuser5", // optional
"StartTimestamp": "2016-04-21T21:48:22Z", // optional
"EndTimestamp": "2016-11-21T21:48:22Z", // optional
"StartTimestamp": "2016-04-21T21:48:22Z", // optional
"Amount": 50, // optional
"AmountOperator": 1 // optional - required with amounnt. Values are 0: "=", 1: "amount>=value", 2: "amount<=value"
}
[
{
"AssetManagerId": 1,
"AccountId": 1,
"AssetId": 1,
"AssetName": "BTC",
"Amount": 100.0,
"TemplateForm": "some template form",
"TemplateFormType": "some template form type",
"OMSId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String,
"RequestIP": "192.168.1.1",
"RequestUserId": 1,
"RequestUserName": "testuser1",
"OperatorId": 1,
"Status": "New",
"FeeAmt": 0.0,
"UpdatedByUser": 1,
"UpdatedByUserName": "testuser1",
"TicketNumber": 127
"CreatedTimestamp": "2016-04-21T21:48:22Z",
"LastUpdateTimeStamp": "2016-04-21T21:48:22Z",
"Comments": [],
"Attachments": [],
"AuditLog": []
},
]
## <a id="GetWithdrawTicket"></a>GetWithdrawTicket
Gets the current state of the Withdraw Ticket matching provided fields.
### Request
```js
{
"OMSId":1,
"AccountId":4,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String,
}
[
{
"AssetManagerId": 1,
"AccountId": 1,
"AssetId": 1,
"AssetName": "BTC",
"Amount": 100.0,
"TemplateForm": "some template form",
"TemplateFormType": "some template form type",
"OMSId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String,
"RequestIP": "192.168.1.1",
"RequestUserId": 1,
"RequestUserName": "testuser1",
"OperatorId": 1,
"Status": "New",
"FeeAmt": 0.0,
"UpdatedByUser": 1,
"UpdatedByUserName": "testuser1",
"TicketNumber": 127
"CreatedTimestamp": "2016-04-21T21:48:22Z",
"LastUpdateTimeStamp": "2016-04-21T21:48:22Z",
"Comments": [],
"Attachments": [],
"AuditLog": []
}
]
Get a transfer by ID
{
"OMSId":1,
"AccountId":4,
"TransferId":125
}
{
"OMSId": 1,
"SenderAccountId": 4,
"ReceiverAccountId": 20,
"ReceiverUserName": "testuser1",
"ProductId": 1,
"Amount": 100.0,
"Notes": "Transfer sent for X"
}
Get transfers for an account
{
"OMSId":1,
"AccountId":4
}
[
{
"OMSId": 1,
"SenderAccountId": 4,
"ReceiverAccountId": 20,
"ReceiverUserName": "testuser1",
"ProductId": 1,
"Amount": 100.0,
"Notes": "Transfer sent for X"
},
...
]
This call creates a Transfer for funds of a particular product between two users. If the receiver username isn't found, a new account is created for it and an email is sent to them to sign up
{
"OMSId": 1,
"SenderAccountId": 4,
"ProductId": 1,
"Amount": 100.0,
"ReceiverUserName": "testuser5@ap.com", // should be an email
"Notes": "Starting you off with some funds!"
}
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
Confirms a pending transfer - Not currently part of workflow
{
"OMSId": 1,
"AccountId": 4,
"TransferId": 4
}
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
Cancels a pending transfer - Not currently part of workflow
{
"OMSId": 1,
"AccountId": 4,
"TransferId": 4
}
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
Request funds from an existing user in the system and sends emails to both parties
{
"OMSId": 1,
"ProductId": 2,
"Amount": 25.0,
"ReceiverUserName": "testuser5@ap.com", // this is the email of the person being requested from
"Notes": "I need some funds to get started."
}
{
"result": true,
"requestCcode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String
}
Confirms a transfer funds request and sends emails to both parties
{
"OMSId": 1,
"OperatorId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String
}
{
"result": true,
"requestCcode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String
}
Rejects a transfer funds request and sends emails to both parties
{
"OMSId": 1,
"OperatorId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String
}
{
"result": true,
"requestCcode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String
}
Gets the current state of a Request Transfer
{
"OMSId": 1,
"OperatorId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7" // Guid String
}
{
"OMSId": 1,
"OperatorId": 1,
"RequestId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7", // Guid String
"PayerUsername": "testuser5@ap.com",
"PayerAccountId": 4,
"RequestorUsername": "someone@example.com",
"RequestorAccountId": 25,
"ProductId": 1,
"ProductName": "BTC",
"Amount": 0.005,
"Notes": "I need some funds to get started.",
"Status": "Requested", // Values are "Requested", "TransferCompleted", "PayerRejected", "SystemRejected"
"CreatedTimestamp": "2016-04-21T21:48:22Z",
"LastUpdateTimestamp": "2016-04-21T21:48:22Z"
}
Gets the current state of all Request Transfers requested for an account
{
"OMSId": 1,
"OperatorId": 1,
"PayerAccountId": 25
}
[
{
"OMSId": 1,
"OperatorId": 1,
"RequestId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7", // Guid String
"PayerUsername": "testuser5@ap.com",
"PayerAccountId": 4,
"RequestorUsername": "someone@example.com",
"RequestorAccountId": 25,
"ProductId": 1,
"ProductName": "BTC",
"Amount": 0.005,
"Notes": "I need some funds to get started.",
"Status": "Requested", // Values are "Requested", "TransferCompleted", "PayerRejected", "SystemRejected"
"CreatedTimestamp": "2016-04-21T21:48:22Z",
"LastUpdateTimestamp": "2016-04-21T21:48:22Z"
},
...
]
Gets the current state of all Request Transfers requested for an account
{
"OMSId": 1,
"OperatorId": 1,
"RequestorAccountId": 25
}
[
{
"OMSId": 1,
"OperatorId": 1,
"RequestId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7", // Guid String
"PayerUsername": "testuser5@ap.com",
"PayerAccountId": 4,
"RequestorUsername": "someone@example.com",
"RequestorAccountId": 25,
"ProductId": 1,
"ProductName": "BTC",
"Amount": 0.005,
"Notes": "I need some funds to get started.",
"Status": "Requested", // Values are "Requested", "TransferCompleted", "PayerRejected", "SystemRejected"
"CreatedTimestamp": "2016-04-21T21:48:22Z",
"LastUpdateTimestamp": "2016-04-21T21:48:22Z"
},
...
]
Gets the current state of all Request Transfers matching provided fields. Fields are filtered with and logic based on what is included or not in query.
{
"OMSId": 1,
"OperatorId": 1,
"RequestorAccountId": 25 // optional
"PayerAccountId": 4 // optional
"ProductId": 1 // optional
"Amount": 5 // optional
"AmountOperator": 1 // optional - required with amount. Values are 0: "=", 1: "amount>=value", 2: "amount<=value"
"Status": 25 // optional, Values are "Requested", "TransferCompleted", "PayerRejected", "SystemRejected"
"StartTimeStamp": "2016-01-01T00:00:00Z", // Optional
"EndTimeStamp": "2016-06-01T00:00:00Z" // Optional
}
[
{
"OMSId": 1,
"OperatorId": 1,
"RequestId": 1,
"RequestCode": "6D2E6447-AED7-4E5B-8759-B2F564E95FC7", // Guid String
"PayerUsername": "testuser5@ap.com",
"PayerAccountId": 4,
"RequestorUsername": "someone@example.com",
"RequestorAccountId": 25,
"ProductId": 1,
"ProductName": "BTC",
"Amount": 0.005,
"Notes": "I need some funds to get started.",
"Status": "Requested", // Values are "Requested", "TransferCompleted", "PayerRejected", "SystemRejected"
"CreatedTimestamp": "2016-04-21T21:48:22Z",
"LastUpdateTimestamp": "2016-04-21T21:48:22Z"
},
...
]