Introduction
Websocket endpoint Global: wss://apexapi.bitazza.com/WSGateway/
Websocket endpoint Thailand: wss://apexapi.bitazza.co.th/WSGateway/
This API covers the User-category calls in version 3.3 of the Bitazza Exchange software. It includes calls required for log-in and authentication.
The calls have been organized roughly to correspond to similar functions you would find in the Bitazza Admin. For example, in the Admin you manage users in the Users function. So calls that manage users have been gathered in the Users section of the API.
Revised calls - 3.3.2 --> 3.3.3
GetAccountTrades GetTradesHistory
New fields added to response object
Old Response
[
{
"omsId": 0,
"executionId": 0,
"tradeId": 0,
"orderId": 0,
"accountId": 0,
"subAccountId": 0,
"clientOrderId": 0,
"instrumentId": 0,
"side": 0,
"quantity": 0.0,
"remainingQuantity": 0.0,
"price": 0.0,
"value": 0.0,
"tradeTime": 0,
"counterParty": null,
"orderTradeRevision": 0,
"direction": 0,
"isBlockTrade": false,
"tradeTimeMS": 0,
"fee": 0.0,
"feeProductId": 0,
"orderOriginator": 0
},
]
New Response - Additional Fields OrderType, AccountName, UserName, MakerTaker, AdapterTradeId, InsideBid, InsideBidSize, InsideAsk, InsideAskSize, IsQuote
[
{
"OMSId": 0,
"ExecutionId": 0,
"TradeId": 0,
"OrderId": 0,
"AccountId": 0,
"AccountName": "",
"SubAccountId": 0,
"ClientOrderId": 0,
"InstrumentId": 0,
"Side": "Buy",
"OrderType": "Limit"
"Quantity": 0.0,
"RemainingQuantity": 0.0,
"Price": 0.0,
"Value": 0.0,
"CounterParty": "",
"OrderTradeRevision": 0,
"Direction": 0,
"IsBlockTrade": false,
"Fee": 0.0,
"FeeProductId": 0,
"OrderOriginator": 0,
"UserName": "",
"TradeTimeMS": 0,
"MakerTaker": "Maker",
"AdapterTradeId": 0,
"InsideBid": 0,
"InsideBidSize": 0,
"InsideAsk": 0,
"InsideAskSize": 0,
"IsQuote": 0,
"TradeTime": 0
},
]
GetUserConfig User Config Values are redacted by default (can be turned off via configuration).
New Endpoints calls - 3.3.2 --> 3.3.3
GetAllUnredactedUserConfigsForUser
GetAllLedgerEntryTickets
GetUnredactedUserConfigByKey
Revised calls - 3.0.X --> 3.3.2
Generally, upper- and lowercase is not important for the key-value pairs inside a request or response. If an otherwise well formed call returns an unexpected error, check the case of the key-value pairs in the request.
AuthenticateUser
Some integer Request values are now strings
Old AuthenticateUser Request
{
"UserName": "",
"Password":""
} or
{
"APIKey": "",
"Signature": "",
"UserId":1,
"Nonce": 12345
}
New AuthenticateUser Request
{
"UserName": "",
"Password": ""
} or
{
"APIKey": "",
"Signature": "",
"UserId": "1",
"Nonce": "12345"
}
CancelAllOrders
The userId and instrumentId have been eliminated from the Request.
Old CancelAllOrders Request
{
"AccountId": 0,
"UserId": 0,
"OMSId": 0,
"InstrumentId": 0
}
New CancelAllOrders Request
{
"AccountId": 0,
"OMSId": 0
}
CancelOrder
AccountId added to Request.
Old CancelOrder Request
{
"OMSId": 0,
"OrderId": 0,
"ClientOrderId": 0
}
New CancelOrder Request
{
"OMSId": 0,
"AccountId": 0,
"OrderId": 0,
"ClientOrderId": 0
}
CancelQuote
Now separate Response objects for BidResult and AskResult in Response
Old CancelQuote Response
{
"BidResult": "",
"AskResult": ""
}
New CancelQuote Response
{
"BidResult": {
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
},
"AskResult": {
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}
}
CreateQuote
Revised Request structure; separate Response objects for BidResult and AskResult[
Old CreateQuote Request
{
"BidQuoteId": 1,
"BidRequest": "",
"AskQuoteId": 1,
"AskRequest": ""
}
New CreateQuote Request
{
"OMSId": 0,
"AccountId": 0,
"InstrumentId": 0,
"Bid": 0,
"BidQty": 0,
"Ask": 0,
"AskQty": 0,
}
Old CreateQuote Response
{
"BidQuoteId": 1,
"BidRequest": "",
"AskQuoteId": 1,
"AskRequest": ""
}
New CreateQuote Response
{
/"BidResult": {
/ /"result": true,
/ /"errormsg": "",
/ /"errorcode": 0,
/ /"detail": "",
/},
/"AskResult": {
/ /"result": true,
/ /"errormsg": "",
/ /"errorcode": 0,
/ /"detail": "",
/}
}
GetAccountInfo
accountHandle removed from Request.
Old GetAccountInfo Request
{
"omsId": 0,
"accountId": 0,
"accountHandle": ""
}
New GetAccountInfo Request
{
"omsId":0,
"accountId":0
}
GetAccountTrades
Extended Response structure
Old GetAccountTrades Response
[
{
"omsId":0,
"executionId":0,
"tradeId":0,
"orderId":0,
"accountId":0,
"subAccountId":0,
"clientOrderId":0,
"instrumentId":0,
"side":0,
"quantity":0.0,
"remainingQuantity":0.0,
"price":0.0,
"value":0.0,
"tradeTime":0
},
]
New GetAccountTrades Response
[
{
"omsId": 0,
"executionId": 0,
"tradeId": 0,
"orderId": 0,
"accountId": 0,
"subAccountId": 0,
"clientOrderId": 0,
"instrumentId": 0,
"side": 0,
"quantity": 0.0,
"remainingQuantity": 0.0,
"price": 0.0,
"value": 0.0,
"tradeTime": 0,
"counterParty": null,
"orderTradeRevision": 0,
"direction": 0,
"isBlockTrade": false,
"tradeTimeMS": 0,
"fee": 0.0,
"feeProductId": 0,
"orderOriginator": 0
},
]
GetAccountTransactions
transactionType and referenceType have changed to integer in Response.
Old GetAccountTransactions Response
[
{
{
"TransactionId": 0,
"OMSId": 0,
"AccountId": 0,
"CR": 0,
"DR": 0,
"CounterParty": 0,
"TransactionType": {
"Options": [
"Fee",
"Trade",
"Other",
"Reverse",
"Hold" ]
},
"ReferenceId": 0,
"ReferenceType": {
"Options": [
"Trade",
"Deposit",
"Withdraw",
"Transfer",
"OrderHold",
"WithdrawHold",
"DepositHold",
"MarginHold" ]
},
"ProductId": 0,
"Balance": 0,
"TimeStamp": 0,
}
]
New GetAccountTransactions Response
[
{
"transactionId":0,
"omsId":0,
"accountId":0,
"cr":0.0,
"dr":0.0,
"counterparty":0,
"transactionType":0,
"referenceId":0,
"referenceType":0,
"productId":0,
"balance":0.0,
"timeStamp":0
},
]
GetInstrument
priceIncrement added to Response
Old GetInstrument Response
{
"omsId":0,
"instrumentId":0,
"symbol":null,
"product1":0,
"product1Symbol":null,
"product2":0,
"product2Symbol":null,
"instrumentType":0,
"venueInstrumentId":0,
"venueId":0,
"sortIndex":0,
"sessionStatus":0,
"previousSessionStatus":0,
"sessionStatusDateTime":"0001-01-01T00:00:00",
"selfTradePrevention":false,
"quantityIncrement":0.0
}
New GetInstrument Response
{
"omsId": 0,
"instrumentId": 0,
"symbol": null,
"product1": 0,
"product1Symbol": null,
"product2": 0,
"product2Symbol": null,
"instrumentType": 0,
"venueInstrumentId": 0,
"venueId": 0,
"sortIndex": 0,
"sessionStatus": 0,
"previousSessionStatus": 0,
"sessionStatusDateTime": "0001-01-01T00:00:00",
"selfTradePrevention": false,
"quantityIncrement": 0.0,
"priceIncrement": 0.0
}
GetInstruments
priceIncrement added to Response
Old GetInstruments Response
[
{
"omsId":0,
"instrumentId":0,
"symbol":"",
"product1":0,
"product1Symbol":"",
"product2":0,
"product2Symbol":"",
"instrumentType":0,
"venueInstrumentId":0,
"venueId":0,
"sortIndex":0,
"sessionStatus":0,
"previousSessionStatus":0,
"sessionStatusDateTime":"0001-01-01T00:00:00",
"selfTradePrevention":false,
"quantityIncrement":0.0
},
]
New GetInstruments Response
[
{
"omsId":0 ,
"instrumentId": 0,
"symbol": "",
"product1": 0,
"product1Symbol": "",
"product2": 0,
"product2Symbol": "",
"instrumentType": 0,
"venueInstrumentId": 0,
"venueId":0,"sortIndex": 0,
"sessionStatus": 0,
"previousSessionStatus": 0,
"sessionStatusDateTime": "0001-01-01T00:00:00",
"selfTradePrevention": false,
"quantityIncrement": 0.0,
"priceIncrement": 0.0
},
]
GetOpenOrders
Expanded and reorganized Response structure
Old GetOpenOrders Response
[
{"omsId":0,
"side":0,
"orderId":0,
"price":0.0,
"quantity":0.0,
"displayQuantity":0.0,
"instrument":0,
"account":0,
"orderType":0,
"clientOrderId":0,
"orderState":0
},
]
New GetOpenOrders Response
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0.0,
"QuantityExecuted": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0.0,
"InsideAskSize": 0.0,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
},
GetOpenQuotes
Expanded and reorganized Response structure
Old GetOpenQuotes Response
{
"Bid":"",
"Ask":""
}
New GetOpenQuotes Response
{
"bid": {
"omsId": 0,
"side": 0,
"orderId": 0,
"price": 0.0,
"quantity": 0.0,
"displayQuantity": 0.0,
"instrument": 0,
"account": 0,
"orderType": 0,
"clientOrderId": 0,
"orderState": 0
},
"ask": {
"omsId": 0,
"side": 0,
"orderId": 0,
"price": 0.0,
"quantity": 0.0,
"displayQuantity": 0.0,
"instrument": 0,
"account": 0,
"orderType": 0,
"clientOrderId": 0,
"orderState": 0
}
}
GetOpenTradeReports
Expanded and reorganized Response structure
Old GetOpenTradeReports Response
[
{
"omsId":0,
"side":0,
"orderId":0,
"price":0.0,
"quantity":0.0,
"displayQuantity":0.0,
"instrument":0,
"account":0,
"orderType":0,
"clientOrderId":0,
"orderState":0
},
]
New GetOpenTradeReports Response
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0.0,
"QuantityExecuted": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0.0,
"InsideAskSize": 0.0,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
},
]
GetOrderHistory
Expanded and reorganized Response structure
Old GetOrderHistory Response
[
{
"omsId":0,
"side":0,
"orderId":0,
"price":0.0,
"quantity":0.0,
"displayQuantity":0.0,
"instrument":0,
"account":0,
"orderType":0,
"clientOrderId":0,
"orderState":0
}
]
New GetOrderHistory Response
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0.0,
"QuantityExecuted": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0.0,
"InsideAskSize": 0.0,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
},
]
GetOrderHistoryByOrderId
Expanded and reorganized Response structure
Old GetOrderHistoryByOrderId Response
[
{
"omsId":0,
"side":0,
"orderId":0,
"price":0.0,
"quantity":0.0,
"displayQuantity":0.0,
"instrument":0,
"account":0,
"orderType":0,
"clientOrderId":0,
"orderState":0
}
]
New GetOrderHistoryByOrderId Response
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0.0,
"QuantityExecuted": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0.0,
"InsideAskSize": 0.0,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
},
]
GetOrdersHistory
Expanded and reorganized Response structure
Old GetOrdersHistory Response
[
{
"omsId":0,
"side":0,
"orderId":0,
"price":0.0,
"quantity":0.0,
"displayQuantity":0.0,
"instrument":0,
"account":0,
"orderType":0,
"clientOrderId":0,
"orderState":0
}
]
New GetOrdersHistory Response
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0.0,
"QuantityExecuted": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0.0,
"InsideAskSize": 0.0,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
},
]
GetOrderStatus
Expanded and reorganized Response structure
Old GetOrderStatus Response
{
"omsId":0,
"side":0,
"orderId":0,
"price":0.0,
"quantity":0.0,
"displayQuantity":0.0,
"instrument":0,
"account":0,
"orderType":0,
"clientOrderId":0,
"orderState":0
}
New GetOrderStatus Response
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0.0,
"QuantityExecuted": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0.0,
"InsideAskSize": 0.0,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
},
]
GetTradesHistory
Extended Response structure
Old GetTradesHistory Response
[
{
"omsId":0,
"executionId":0,
"tradeId":0,
"orderId":0,
"accountId":0,
"subAccountId":0,
"clientOrderId":0,
"instrumentId":0,
"side":0,
"quantity":0.0,
"remainingQuantity":0.0,
"price":0.0,
"value":0.0,
"tradeTime":0
}
]
New GetTradesHistory Response
[
{
"omsId": 0,
"executionId": 0,
"tradeId": 0,
"orderId": 0,
"accountId": 0,
"subAccountId": 0,
"clientOrderId": 0,
"instrumentId": 0,
"side": 0,
"quantity": 0.0,
"remainingQuantity": 0.0,
"price": 0.0,
"value": 0.0,
"tradeTime": 0,
"counterParty": null,
"orderTradeRevision": 0,
"direction": 0,
"isBlockTrade": false,
"tradeTimeMS": 0,
"fee": 0.0,
"feeProductId": 0,
"orderOriginator": 0
},
]
SendOrder
Request: timeInOrder removed; quantity, PegPriceType changed to integer enumerations
Old SendOrder Request
{
"InstrumentId": 1,
"OMSId": 1,
"AccountId": 1,
"TimeInForce": 1,
"ClientOrderId": 1,
"OrderIdOCO": 0,
"TimeInOrder":0,
"UseDisplayQuantity":false,
"Side": 0,
"quantity": "1",
"OrderType": 2,
"PegPriceType": "3",
"LimitPrice": 8800
}
New SendOrder Request
{
"InstrumentId": 1,
"OMSId": 1,
"AccountId": 1,
"TimeInForce": 1,
"ClientOrderId": 1,
"OrderIdOCO": 0,
"UseDisplayQuantity": false,
"Side": 0,
"quantity": 1,
"OrderType": 2,
"PegPriceType": 3,
"LimitPrice": 8800
}
SubscribeLevel2
Request alternative available; changed to comma-separated data from numerical key-value pairs in the Response.
Old SubscribeLevel2 Request
{
"OMSId": 1,
"InstrumentId": 1,
"Depth": 10
}
New SubscribeLevel2 Request
{
"OMSId": 1,
"InstrumentId": 0
"Depth": 10
}
or
{
"OMSId": 1,
"Symbol": "BTCUSD",
"Depth": 10
}
Old SubscribeLevel2 Response
[
{
0: 1,
1: 1,
2: 1534865075981,
3: 0,
4: 6415.01,
5: 1,
6: 6399.79,
7: 1,
8: 1.49364749,
9: 0
}
]
New SubscribeLevel2 Response
[
[
0, // MDUpdateId
1, // AccountId
123,// ActionDateTime in Posix format X 1000
0, // ActionType 0 (New), 1 (Update), 2(Delete)
0.0, // LastTradePrice
0, // OrderId
0.0, //Price
0, // ProductPairCode
0.0, // Quantity
0, // Side
],
]
Old SubmitLedgerEntry Response
{
"result":true,
"errormsg":"",
"errorcode": 0,
"detail":"",
}
New SubmitLedgerEntry Response
{
"accountLedgerEntryId": 0,
"accountId": 0,
"productId": 0,
"CR_Amt": 0.0,
"DR_Amt": 0.0,
"enteredBy": 0.0,
"comments": "",
"onsSidedTransaction": false
},
Previously unrevealed calls
AddProductAttributes
InstrumentId changed to ProductId in Request
Old AddProductAttributes Request
{
"OMSId": 1,
"InstrumentId": 1,
"KeyName": key,
"KeyValue": "value"
}
New AddProductAttributes Request
{
"OMSId": 1,
"ProductId": 1,
"KeyName": key,
"KeyValue": "value"
}
AddUserInstrumentPermissionsBulk
InstrumentIds now an array in Request
Old AddUserInstrumentPermissionsBulk Request
{
"OMSId": 1,
"InstrumentId": 1,
"UserId": 1
}
New AddUserInstrumentPermissions Bulk Request
{
"OMSId": 1,
"InstrumentIds": [1,2],
"UserId": [1,2]
}
AddUserProductPermissionsBulk
ProductIds now an array in Request
Old AddUserProductPermissionsBulk Request
{
"omsid":0,
"productids":"",
"userids":""}
New AddUserProductPermissionsBulk Request
{
"omsid": 0,
"productids": [1,2],
"userids": [1,2]
}
GetEarliestTickTime
Request requires only OMSId and instrumentId
Old GetEarliestTickTime Request
{
"InstrumentId": 1,
"FromDate": date
}
New GetEarliestTickTime
{
"InstrumentId": 1,
"OMSId": 1
}
RemoveProductAttributes
InstrumentId changed to ProductId in Request
Old RemoveProductAttributes Request
{
"OMSId": 1,
"InstrumentId": 1,
"KeyName": key,
"KeyValue": "value"
}
New RemoveProductAttributes Request
{
"OMSId": 1,
"ProductId": 1,
"KeyName": "key",
"KeyValue": "value"
}
OldAddEditExchange Response
{
"Id": 1,
"RejectMessage": "",
}
New AddEditExchange Response
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": ""
}
Old GetExchangeServiceIDs Response An array of strings representing service ids.
New GetExchangeServiceIds Response Array hard coded with a single entry: "Matching Engine" json [ { "Name": "V2ExchangeCore|1", "ServiceId": "Matching Engine" "URI": null } ]
Old GetExchangeServiceIds Response A list of exchanges within a specified exchange service id.
New GetExchangeServiceIds Response Retrieves exchanges from "THE" mathcing engine as there can only ever be one as of 3.4
Old CreateAmlProviderConfig Request json { "omsId": 0, "productId": 0, "url": "", "amlProviderType": 0, "apiToken": "", "enabled": true }
New CreateAmlProviderConfig Request json { "AmlProviderType": "ChainAnalysis", "Enabled": true, "OMSId": 0, "ProductId": 1 }
Old DeleteAmlProviderConfig Request json { "omsId": 0, "productId": 0, "url": "", "amlProviderType": 0, "apiToken": "", "enabled": true }
New DeleteAmlProviderConfig Request json { "AmlProviderType": "ChainAnalysis", "Enabled": true, "OMSId": 0, "ProductId": 1 }
Old GetAmlProviderConfig Request json { "omsId": 0, "productId": 0, "url": "", "amlProviderType": 0, "apiToken": "", "enabled": true } New GetAmlProviderConfig Request json { "OMSId": 0, "ProductId": 1 } GetAmlProviderConfigsForOMS New GetAmlProviderConfigForOMS Request json { "OMSId": 0, }
3.4.1 New Endpoints
RegisterNewDevice
GetUserDevices
GetPendingFourEyeRequests
GetCompletedFourEyeRequests
ProcessPendingFourEyeRequest
GetConfigManagementSupportedServiceNames
GetServiceConfigs
GetServiceConfigByKey
UpdateServiceConfig
RevertToPreviousConfigValue
GetValidate2FARequiredEndpoints
Validate2FA
AddEditRole
DeleteRole
GetAllRoles
GetRole
AddUserRoles
RemoveUserRoles
GetUserRoles
GetAmlProviderConfigsForOMS
UpdateAmlProviderConfig
RevisedCalls 3.4.1
SendOrder
Request Payload changed for Market Buy Value - if Buy order and Value (decimal) parameter is supplied, the Market order will execute up to the value specified.
AddEditExchange
Response Payload changed:
GetExchangeServiceIds
GetExchanges
CreateAmlProviderConfig
DeleteAmlProviderConfig
GetAmlProviderConfig
Validate2FA
Behavior change, no longer has public permissions specified.
AddInstrument(DEPRECATED)
Behavior change, endpoint returns with bad request message specifying the endpoint is deprecated.
UpdateInstrument(DEPRECATED)
Behavior change, endpoint returns with bad request message specifying the endpoint is deprecated.
RemoveOperatorUser
Behavior change from “Deprecated” to “Remove Association of Operator with User"
GetOperatorUsers
Behavior change from “Deprecated” to “Getting all Operator Users”
GetOperators
Field “EmailTemplateCount” [integer] added to response.
Release 3.4.1 Incremental
Overview
Minor enhancements/features or bugfixes patched into 3.4.1. Minor changes to APIs (new fields or new APIs only)
Highligths
- Universal Wallet (AlphaPoint) Integration
- Order Completed notification for all Order Type (previously just Block Trade) support
- Confirm Transfer workflow fixes
- Confirm Market Cap support
- User Info Update Websocket Subscription
- OKTA Oauth support for Username/Verification Level mapping
- Multi-gateway level2 disconnect reconnection handling improvements
- Asset Manager Disconnect fault tolerance improvements
- Cancel Replace Reject Event serialization fix
Important or Breaking Changes
Endpoint:
GetWithdrawFormTemplateTypes, SubmitAccountLedgerEntry, GetAccountLedgerEntry,
GetAllLedgerEntryTickets, GetOpenWithdrawHolds, GetOrderStatus, Transferfunds,
GetLevel1, Level1UpdateEvent, SubscribeLevel1
GetWithdrawFormTemplateTypes
Response includes a new field:
| Key | Value |
|---|---|
| AccountProviderName | string. The name of the account provider for the template |
SubmitAccountLedgerEntry
Request supports a new field:
| Key | Value |
|---|---|
| PreventNegatives | Boolean. Instructs the OMS to reject this request if the resulting balance of the account will be negative |
Response includes a new field:
| Key | Value |
|---|---|
| Timestamp | long integer. epoch milliseconds |
GetAccountLedgerEntry
Response includes a new field:
| Key | Value |
|---|---|
| Timestamp | long integer. epoch milliseconds |
GetAllLedgerEntryTickets
Response includes a new field:
| Key | Value |
|---|---|
| Timestamp | long integer. epoch milliseconds |
GetOpenWithdrawHolds
Response includes a new field:
| Key | Value |
|---|---|
| Timestamp | long integer. epoch milliseconds previously was .net Ticks |
GetOrderStatus
Response value changed:
| When an order state is queried for and not found due to it not being processed by the system or an incorrect combination of account/order id, the response will be Resource Not Found with error code 104. It is currently Server Error and code 102 |
TransferFunds
Response value changed:
The Detail field now contains the TransferId if successful:
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": "{\\" TransferId \\ ": 1}" // serialized json
}
|
GetAllDepositTickets
Request supports a new field:
| Key | Value |
|---|---|
| IncludeComments | Boolean. include ticket comments in `Comments` field of each ticket in response |
GetAllWithdrawTickets
Request supports a new field:
| Key | Value |
|---|---|
| IncludeComments | Boolean. include ticket comments in `Comments` field of each ticket in response |
GetLevel1/Level1UpdateEvent/SubscribeLevel1
Response has new fields:
| Key | Value |
|---|---|
| CurrentNotional | decimal. current day quote volume – resets at utc midnight Rolling24HrNotional decimal – rolling 24 hours quote volume |
Background Information
This section provides important information about the Bitazza Exchange software.
Message Frame
A JSON-formatted frame object.
{
"m": 0,
"i": 0,
"n":"function name",
"o":"payload"
}
Wrap all calls in a JSON-formatted frame object. Responses from the server are similarly wrapped. The API calls are documented as payloads by function name.
| Key | Value |
|---|---|
| m message type | integer. The type of the message. One of: 0 request 1 reply 2 subscribe-to event 3 event 4 unsubscribe-from event 5 error |
| i sequence number | long integer. The sequence number identifies an individual request or
request-and-response pair, to your application. The system requires a non-zero sequence number, but the numbering scheme you use is up to you. No arbitrary sequence numbering scheme is enforced by Bitazza. Best Practices: A client-generated API call (of message types 0, 2, and 4) should: Carry an even sequence number Begin at the start of each user session Be unique within each user session. Begin with 2 (as in 2, 4, 6, 8) Message types 1 (reply), 3 (event), and 5 (error) are generated by the server. These messages echo the sequence number of the message to which they respond. See the example, following. |
| n function name | string. The function name is the name of the function being called or that the server is responding to. The server echoes your call. See the example, following. |
| o payload | Payload is a JSON-formatted string containing the data being sent with the message. Payload may consist of request parameters (key-value pairs) or response parameters. |
Example 1
Example 1
var frame =
{
"m":0,
"i":0,
"n":"function name",
"o":""
};
var requestPayload =
{
"parameter1":"value",
"parameter2":0
};
frame.o = json.Stringify(requestPayload);
// Stringify escapes the payload's quotation marks automatically.
WS.Send(json.Sringify(frame)); // WS.Send escapes the frame
When sending a request in the frame to the software using JavaScript, a call looks like Example 1.
Example 2
Example 2
var frame = json.Parse(wsMessage);
if (frame.m == 1) // message of type reply
{
//This is a reply
if (frame.n == "WebAuthenticateUser")
{
var LoginReply = json.Parse(frame.o);
if (loginReply.Authenticated)
{
var user = LoginReplay.User;
}
}
}
When receiving a frame from the software, use the frame to determine the context, and then unwrap the content, as in Example 2.
Standard response objects and common error codes
A response to an API call usually consists of a specific response, but both successful and unsuccessful responses may consist of a generic response object that verifies only that the call was received, and not that the action requested by the call took place. A generic response to an unsuccessful call provides an error code. A generic response looks like Example 3.
Example 3
Example 3
{
"result":true,
"errormsg":"",
"errorcode": 0,
"detail":"",
}
| Key | Value |
|---|---|
| result | Boolean. If the call has been successfully received by the Order Management System, result is true; otherwise it is false. |
| errormsg | string. A successful receipt of the call returns null. The errormsg
key for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. The content of this key is usually null. |
Modules
The Bitazza software consists of several modules that include the Order Management System (OMS), the matching engine, and the Asset Manager. During installation, each is assigned an ID.
The Order Management System is the mechanism that manages access to the trading venue. The OMS controls permissions, accounts, and users. The OMS must be specified in many calls.
The order book resides on the Bitazza matching engine.
A trading venue is a combination of OMS and matching engine that creates a place to access the market and trade. A venue maintains its order book and matching engine, and may access several Order Management Systems.
The Asset Manager controls the deposit and withdrawal of funds belonging to an account. These funds can be denominated in any product that the trading venue allows.
Users, Accounts, and Permissions
The Bitazza software differentiates between user and account. A user is the person who logs in; an account represents the funds and trading that the user does — much like a bank account represents funds and checks.
As with a bank account, an individual user may have multiple Exchange accounts. Similarly, multiple users may trade through a single account. There may be users who have trading access to one set of accounts that overlap (but do not duplicate) the set of accounts that another user can access. There may be a many-to-many relationship where two or more users have access to a set of accounts.
The use case for this kind of "joint tenancy" is an active trading desk where a specific individual may not always be present. If User A will not be present, User B can monitor and trade on the market. User A may wish to cancel his pending trades for a specific account or instrument, but not those of his trading partner under the same account or for the same instrument.
Permissions handle the rules that determine what a user can access and do with orders, cancellations, and the other tasks of a trading venue. Most permissions encompass tasks such as trading, depositing, or withdrawing funds; but a permission can be set for each API call for each individual in the venue.
An administrator with Operator permission sets up a user's permissions on the OMS when the user joins the trading venue, and only an administrator with Operator permission or above can change them. A full discussion of permissions is not part of this API.
Products and Instruments
In Bitazza software, a product is an asset that is tradable or paid out. A product might be a national currency, a crypto-currency, or something else such as a commodity. For example, a product might be a US Dollar or a New Zealand Dollar or a BitCoin or an ounce of gold. Transaction and withdrawal fees are denominated in products. (Products may be referred to as assets in some API calls.)
An instrument is a pair of exchanged products (or fractions of them). For example, US Dollar for BitCoin. In conventional investment parlance, a stock or a bond is called an instrument, but implicit in that is the potential exchange of one product for another (stock for dollars). Bitazza software thinks of that exchange as explicit, and separates product from instrument.
Quotes and Orders
The Bitazza API includes calls related to both quotes and orders. Quoting is not enabled for the retail end user of Bitazza software. Only registered market participants or marketmakers may quote. Your trading venue may offer quotes separately from orders.
- A quote expresses a willingness to buy or sell at a given price.
- An order is a directive to buy or sell.
In this version of the Bitazza matching engine software, quotes and orders are synonymous. They both can buy or sell. This is because the matching engine (like most matching engines) requires a "firm quote" — a guaranteed bid or ask.
For both quotes and orders, trading priority is the same, and no preference is given one over the other. In code, the matching engine flags a quote for eventual regulatory and compliance rules, but for current software operation and trade execution, quotes and orders behave equivalently.
Best Practices/Quotes and Orders
Use the order-related API calls in preference to quote-related calls unless you specifically require quote-related calls.
Time– and Date-Stamp Formats
Bitazza software uses two different time– and date-stamp formats, POSIX and Microsoft Ticks. Where the value of a time field key is an integer or long, the value is in POSIX format; when the value of a time field key is a string, it is in Microsoft Ticks format (also called datetime).
- POSIX stores date/time values as the number of seconds since 1 January 1970 (long integer).
Bitazza software often multiples this number by 1000 for the number of milliseconds since 1 January 1970.
Recognize POSIX format: POSIX format is a long integer. It is usually formatted like this:
1501603632000 - Microsoft Ticks (datetime) format represents the number of ticks that have elapsed since
00:00:00 UTC, 1 January 0001, in the Gregorian calendar. A single tick represents one hundred nanoseconds (one
ten-millionth of a second). There are 10,000 ticks in a millisecond; ten million ticks in a second. Ticks
format does not include the number of ticks attributable to leap-seconds. Recognize Ticks
format: Ticks format is a string. In Bitazza software, it is usually formatted like this:
"2018-08-17T17:57:56Z"Note that a T (for time) separates the initial date from the time. The trailing Z represents the time zone, in all cases in Bitazza software, this is UTC (also called Zulu time).
The Trading Day
Most Bitazza installations operate 24-hour computer-based trading venues. The trading day runs from UTC Midnight to UTC Midnight (essentially, London time, but without any summertime offset), regardless of the nominal location of the venue. Values such as open or close are those values as of UTC Midnight. Values for day, month, or annual periods run from UTC Midnight to UTC Midnight.
Users
These calls correspond roughly to the Users function of the Exchange Admin and Admin Guide.
Activate2FA
Category: Activation
Permissions: Public
Call Type: Synchronous
Request
{
"Code":"YourCode"
}
Completes the second half of a two-factor authentication by sending the 2FA code while registering for the exchange.
| Key | Value |
|---|---|
| Code | string. The alphanumeric code you received for authentication. |
Response
{
"Activated": true,
"Error":"ErrorMessage"
}
| Key | Value |
|---|---|
| Activated | Boolean. True if the activation code is accepted; false if not. |
| Error | string. Error message from the server. |
AddEditRole
Category: System
Permissions: Superuser, Operator, Trading
Call Type: Synchronous
Adds a new role
Request
{
"roleId": 1,
"roleName": "",
"permissions": ["",""],
}
| Key | Value |
|---|---|
| roleId | integer. Id of role |
| roleName | string. Name of role |
| permissions | string. Permissions associated with the role |
Response
The Response is standard response object
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}
| Key | Value |
|---|---|
| result | Boolean.If the call has been successfully received by the Order Management System, result is true otherwise it is false. |
| errormsg | string. A successful receipt of the call returns null.
The errormsg key for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcodes | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. |
AddUserAffiliateTag
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Associates a user affiliate tag to a user. An affiliate tag allows a user to encourage others to join the exchange and provides a way to track those new members back to the initiating user.
Request
{
"omsId":0,
"userId":0,
"affiliateId":0,
"affiliateTag":""
}
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System on which the user operates. |
| userId | integer. The user's ID. |
| affiliateId | integer. The affiliate ID. |
| affiliateTag | string. The alphanumeric tag used to identify new affiliating members. |
Response
{
"result":true,
"errormsg":"",
"errorcode":0,
"detail":""
}
| Key | Value |
|---|---|
| result | Boolean. True signifies that the server has received the request to associate the affiliate tag with a specific user (not that it has done so); false signifies an error. |
| errormsg | string. A successful response returns null; the errormsg parameter for an unsuccessful response returns one of the following messages: Not Authorized (errorcode 20), Invalid Request (errorcode 100), Operation Failed (errorcode 101), Server Error (errorcode 102), Resource Not Found (errorcode 104) |
| errorcode | integer. A successful response returns 0. An unsuccessful response returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
AddUserInstrumentPermissions
Category: User
Permissions: Operator, Company
Call Type: Synchronous
Adds permission to trade in a single instrument to a user, with the user and instrument specified by ID.
Request
{
"OMSId": 1,
"InstrumentId": 1,
"UserId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System where the user operates and the instrument resides. |
| InstrumentId | integer. The ID of the instrument the user should have permission to trade. |
| UserId | integer. The ID of the user being granted permission to trade in the instrument. |
Response
{
"result":true,
"errormsg":"",
"errorcode":0,
"detail":""
}
| Key | Value |
|---|---|
| result | Boolean. True signifies that the server has received the request to add the instrument permission to a specific user (not that it has done so); false signifies an error. |
| errormsg | string. A successful response returns null; the errormsg parameter for an unsuccessful response returns one of the following messages: Not Authorized (errorcode 20), Invalid Request (errorcode 100), Operation Failed (errorcode 101), Server Error (errorcode 102), Resource Not Found (errorcode 104) |
| errorcode | integer. A successful response returns 0. An unsuccessful response returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
AddUserInstrumentPermissionsBulk
Category: User
Permissions: Operator, Company
Call
Type: Synchronous
Adds permissions for multiple users to multiple instruments in a batch.
Request
{
"OMSId": 1,
"InstrumentIds": [1,2]
"UserId": [1,2]
}
The set of instrument IDs are granted as permission to trade to the set of user IDs.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the users operate and the instruments are traded. |
| InstrumentIds | integer array. A comma-separated array of the IDs of multiple instruments whose permission to trade is being granted to the list of users. |
| UserId | integer array. A comma-separated array of the ID of the multiple users who are being granted permission to trade in the list of instruments. |
Response
{
"result": "true",
"errormsg": "",
"errorcode": 0,
}
| Key | Value |
|---|---|
| result | Boolean. If true, the permission change was received by the server; if false, the permission change was not received by the server. A result of true does not mean that the permissions have been changed, only that they were received. |
| errormsg | string. A successful receipt of the quote returns null; the errormsg parameter
for an unsuccessful receipt returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successful receipt returns 0. An unsuccessful receipt returns on of the errorcodes shown in the errormsg list. |
AddUserProductPermissions
Category: User
Permissions: Operator, Company
Call
Type: Synchronous
Adds a single product permission to a user.
Request
{
"OMSId": 1,
"ProductId": 1,
"UserId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System where the user operates and the product trades. |
| ProductId | integer. The ID of the product whose permission to trade is being added to the user. |
| UserId | integer. The ID of the user who is gaining the permission to trade in the product. |
Response
{
"result":true,
"errormsg":null,
"errorcode":0,
"detail":null
}
A successful response means that the system has received AddUserProductPermissions, not that the product permission has been successfully added. To find out if the permission has been added, use GetUserPermissions.
| Key | Value |
|---|---|
| result | Boolean. A successful receipt returns true; an unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt returns null; the errormsg parameter for an
unsuccessful receipt returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
AddUserProductPermissionsBulk
Category: User
Permissions: Operator, Company
Call
Type: Synchronous
Adds multiple product permissions to multiple users.
Request
{
"omsid": 0,
"productids": [1,2],
"userids": [1,2]
}
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System where the users operate and the products trade. |
| productIds | integer array. A comma-separated list of the IDs of the products whose permission to trade is being added to the list of users. |
| userIds | integer array. A comma-separated list of the IDs of the users who are gaining the permissions to trade in the list of products. |
Response
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
A successful response means that the system has received AddUserProductPermissionsBulk, not that the product permissions have been successfully added. To find out if the permission has been added, use GetUserPermissions.
| Key | Value |
|---|---|
| result | Boolean. A successful receipt returns true; an unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt returns null; the errormsg parameter for an
unsuccessful receipt returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successful receipt returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
AddUserRole
Category: System
Permissions: Superuser, Operator, Trading
Call Type: Synchronous
Add a role to a given user,
Request
{
"userId": 1
"userRoleId": 2
}
| Key | Value |
|---|---|
| userId | integer. ID of user |
| userRoleId | integer. ID of role to add to user |
Response
The Response is standard response object
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}
| Key | Value |
|---|---|
| result | Boolean.If the call has been successfully received by the Order Management System, result is true otherwise it is false. |
| errormsg | string. A successful receipt of the call returns null.
The errormsg key for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcodes | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. |
Authenticate2FA
Category: Authentication
Permissions: Public
Call Type: Synchronous
Request
{
"Code": "YourCode"
}
Completes the second part of a two-factor authentication by sending the authentication token from the non-Bitazza authentication system to the Order Management System. The call returns a verification that the user logging in has been authenticated, and a token.
Here is how the two-factor authentication process works:
- Call webauthenticateuser. The response includes values for TwoFAType and TwoFAToken. For example, TwoFAType may return "Google," and the TwoFAToken then returns a Google-appropriate token (which in this case would be a QR code).
- Enter the TwoFAToken into the two-factor authentication program, for example, Google Authenticator. The authentication program returns a different token.
- Call authenticate2FA with the token you received from the two-factor authentication program (shown as YourCode in the Request example below).
| Key | Value |
|---|---|
| Code | string. Code holds the token obtained from the other authentication source. |
Response
{
"Authenticated": true,
"SessionToken": "YourSessionToken"
}
| Key | Value |
|---|---|
| Authenticated | Boolean. A successful authentication returns true. Unsuccessful returns false. |
| SessionToken | string. The SessionToken is valid during the current session for connections from the same IP address. If the connection is interrupted during the session, you can sign back in using the SessionToken instead of repeating the full two-factor authentication process. A session lasts one hour after the last-detected activity or until logout. |
To send a session token to re-establish an interrupted session:
{
"SessionToken": "YourSessionToken"
}
AuthenticateUser
Category: Authentication
Permissions: Public
CallType: Synchronous
Request
Use this request call
{
"UserName": "",
"Password": ""
}
Or you can use this request call
{
"APIKey": "28c68ac3fcfafc3d4e8d653fe57e5baf",
"Signature": "29c15c42e4fabcc9e229421e148e647903927c503ab4578ada55bb13a63a9636",
"UserId": "96",
"Nonce": "2247733562"
}
Authenticates a user for the current websocket session.
| Key | Value |
|---|---|
| Username | string. The user's assigned user name. |
| Password | string. The user's assigned password. |
or
| Key | Value |
|---|---|
| APIKey | string. This is an Bitazza-generated key used in user-identification. |
| Signature | string. A long, alphanumeric string generated by Bitazza by using the APIKey and Nonce. |
| UserId | string. The ID of the user, stated as a string. |
| Nonce | string. Any arbitrary number or random string used with the APIKey to generate a signature. |
Response
Authenticated response
{
"authenticated": true,
"user":
{ "userId": 0,
"userName": "",
"email": "",
"emailVerified": false,
"accountId": 0,
"omsId": 0,
"use2FA": false
},
"locked": false,
"requires2FA": false,
"twoFAType": "",
"twoFAToken": "",
"errormsg": ""
}
False authenticated response
{
"authenticated": false,
"locked": false,
"errormsg": "Invalid username or password"
}
| Key | Value |
|---|---|
| authenticated | Boolean. True if the user is authenticated; false otherwise. |
| user | JSON user object (below) |
| locked | Boolean. True if this affiliated user is currently locked; false otherwise. A user may be locked by trying to log in too many times in rapid succession. He must be unlocked by an admin. |
| requires2FA | Boolean. True if the user must use two-factor authentication; false otherwise. |
| twoFAType | string. Returns the type of 2FA this user requires. For example, "Google." |
| twoFAToken | string. Returns an appropriate token. In the case of Google, this is a QR code. |
| errormsg | string. A successful receipt of the call returns null. |
JSON user object:
| Key | Value |
|---|---|
| userId | integer. The ID of the user being authenticated on the exchange. |
| userName | string. The name of the user. |
| string. The email address of the user. | |
| emailVerified | Boolean. Whether the email address has been verified by the registration process or directly by an Admin. |
| accountId | integer. The ID of the account with which the user is associated (each user has a default account). |
| omsId | integer. The ID of the Order Management System with which the user and account are associated. |
| use2FA | Boolean. True if the user must use 2FA to log in; false otherwise. |
CancelUserReport
Category: Users
Permissions: Operator, Trading
Call Type: Synchronous
You can generate or schedule a variety of reports through this API on demand. This call cancels a scheduled report by its report ID. GetUserReportTickets can provide a list of GUIDs for scheduled reports.
Request
{
"UserReportId": guid-as-a-string //GUID not GUIDE
}
| Key | Value |
|---|---|
| UserReport | string. The GUID is a globally unique ID string that identifies the user report to be canceled. The Order Management System provides this ID when you create a report. |
Response
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}
The response to CancelUserReport verifies that the call was received, not that the user report has been canceled successfully. Individual event updates sent to the user show cancellations. To verify that a report has been canceled, call GetUserReportTickets or GetUserReportWriterResultRecords.
| Key | Value |
|---|---|
| result | Boolean. A successful receipt of the cancellation returns true; and unsuccessful receipt of the cancellation (an error condition) returns false. |
| errormsg | string. A successful receipt of the cancellation returns null; the errormsg parameter for an unsuccessful receipt returns one of the following messages: Not Authorized (errorcode 20, Invalid Request (errorcode 100), Operation Failed (errorcode 101), Server Error (errorcode 102), Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the cancellation returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
DeleteRole
Category: System
Permissions: Operator, Trading
Call Type: Synchronous
Remove an existing role for the given role id.
Request
{
"Id": 1,
}
| Key | Value |
|---|---|
| Id | integer. Id of role |
Response
The Response is standard response object
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}
| Key | Value |
|---|---|
| result | Boolean.If the call has been successfully received by the Order Management System, result is true otherwise it is false. |
| errormsg | string. A successful receipt of the call returns null.
The errormsg key for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcodes | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. |
EnableXP2FA
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
EnableXP2FA is a custom two-factor-authentication scheme (like Google 2FA). It generates 2FA code and has the ability to verify these codes.
Request
{
"Phone": "",
"Capability":""
}
| Key | Value |
|---|---|
| Phone | string. A 13-digit Brazilian phone number. Example: +5511965536992 |
| Capability | string. Method of validation. Possible values are: SMS Phone OTP (an app) |
Response
{
"Enabled2FA": true,
"Activate2FA":true
}
| Key | Value |
|---|---|
| Enabled2FA | Boolean. True if XP two-factor authentication is enabled; false if not. |
| Activate2FA | Boolean. True if XP two-factor authentication is to be activated; false if not. |
GetAllRoles
Category: User
Permissions: Public
Call Type: Synchronous
Gets all of the available roles in the system.
Request
{
}
No payload for GetAllRoles
Response
The Response is a list of Roles.
[
{
"roleName": "Operator",
"permissions": ["GetProducts", "GetUserConfig", "SetUserConfig"]
},
{
"roleName": "Operator2",
"permissions": ["GetActiveUserSessions", "UpdateDepositTicket", "UpdateDepositTicket"]
}
]
| Key | Value |
|---|---|
| roleName | string. Name of role |
| permissions | string. Permissions associated with the role |
GetConfigManagementSupportedServiceNames
Category: User
Permissions: Public
Call Type: Synchronous
Get the services names that are managed as part of configuration management
Request
{
}
No payload for GetConfigManagementSupportedServiceNames
Response
["Gateway", "KYCService", "OMS"]
The response is a list of services.
GetL2Snapshot
Category: User
Permissions: Public
Call Type:
Synchronous
Provides a current Level 2 snapshot of a specific instrument trading on an Order Management System to a user-determined market depth. The Level 2 snapshot allows the user to specify the level of market depth information on either side of the bid and ask.
Request
{
"OMSId": 1,
"InstrumentId": 1,
"Depth": 100
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System where the instrument is traded. |
| InstrumentId | integer. The ID of the instrument that is the subject of the snapshot. |
| Depth | integer. Depth of the market — the number of buyers and sellers at greater or lesser prices in the order book for the instrument. Defaults to 100. |
Response
[
[
0, // MDUpdateId
1, // AccountId
123,// ActionDateTime in Posix format X 1000
0, // ActionType 0 (New), 1 (Update), 2(Delete)
0.0, // LastTradePrice
0, // OrderId
0.0, //Price
0, // ProductPairCode
0.0, // Quantity
0, // Side
],
]
// This is how the response is sent:
[[0,1,123,0,0.0,0,0.0,0,0.0,0]]
The response is an array of elements for one specific instrument, the number of elements corresponding to the market depth specified in the Request. It is sent as an uncommented, comma-delimited list of numbers. The example is commented. The Level2UpdateEvent contains the same data, but is sent by the OMS whenever trades occur. To receive Level2UpdateEvents, a user must subscribe to Level2UpdateEvents.
| Key | Value |
|---|---|
| MDUpdateID | integer. Market Data Update ID. This sequential ID identifies the order in which the update was created. |
| AccountId | integer. The ID of the account trading the instrument. |
| ActionDateTime | long integer.. ActionDateTime identifies the time and date that the snapshot was taken or the event occurred, in POSIX format X 1000 (milliseconds since 1 January 1970). |
| ActionType | integer. L2 information provides price data. This value shows whether this data
is: 0 new 1 update 2 deletion |
| LastTradePrice | real. The price at which the instrument was last traded. |
| OrderId | integer. The ID of the order. |
| Price | real. Bid or Ask price for the Quantity (see Quantity below). |
| ProductPairCode | integer. ProductPairCode is the same value and used for the same purpose as InstrumentID. The two are completely equivalent. InstrumentId 47 = ProductPairCode 47. |
| Quantity | real. Quantity available at a given Bid or Ask price (see Price above). |
| Side | integer. One of: 0 Buy 1 Sell 2 Short (reserved for future use) 3 Unknown (error condition) |
GetLevel1
Category: User
Permissions: GetLevel1, Trading
Call Type: Synchronous
Provides a current Level 1 snapshot (best bid, best offer) of a specific instrument trading on an Order Management System. The Level 1 snapshot does not allow the user to specify the level of market depth information on either side of the bid and ask.
Request
{
"OMSId":1,
"InstrumentId":1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS on which the snapshot will be taken. |
| InstrumentId | integer. The ID of the instrument whose Level 1 market snapshot will be taken. |
Response
productPairCode is the same as InstrumentId. The two are synonymous and refer to the same object.
{
"exchangeId": 0,
"productPairCode": 0,
"bestBid": 0.0,
"bestOffer": 0.0,
"volume": 0.0,
"lastTradedPx": 0.0,
"lastTradedVolume": 0.0,
"lastTradeTime": 0,
"timeStamp": 0,
"bidQty": 0.0,
"askQty": 0.0,
"bidOrderCt": 0,
"askOrderCt": 0,
"sessionOpen": 0.0,
"sessionHigh": 0.0,
"sessionLow": 0.0,
"sessionClose": 0.0,
"currentDayVolume": 0.0,
"currentDayNumTrades": 0.0,
"currentDayPxChange": 0.0,
"rolling24HrVolume": 0.0,
"rolling24NumTrades": 0.0,
"rolling24HrPxChange": 0.0,
"rolling24HrPxChangePercent": 0.0
}
| Key | Value |
|---|---|
| exchangeId | integer. The ID of the exchange whose snapshot was taken. |
| productPairCode | integer. The ID of the instrument (the product pair) whose prices, bids, asks, and volumes are being reported. |
| bestBid | real. The current best bid for the instrument (product pair). |
| bestOffer | real. The current best offer for the instrument (product pair). |
| volume | real. The unit volume of the instrument traded, either during a true session (with a market open and close), or in 24-hour markets, it is the period from UTC Midnight to UTC Midnight, regardless of the nominal location of the market. |
| lastTradedPX | real. The last-traded price for the instrument. |
| lastTradedVolume | real. The last quantity that was traded. |
| lastTradeTime | real. The last time that the instrument was traded. |
| timeStamp | real. The date and time of this snapshot. |
| bidQty | real. The quantity currently being bid. |
| askQty | real. The quantity currently being asked. |
| bidOrderCt | integer. The count of bid orders. |
| askOrderCt | integer. The count of ask orders. |
| sessionOpen | real. Opening price. In markets with openings and closings, this is the opening price for the current session; in 24-hour markets, it is the price as of UTC Midnight beginning the current day. |
| sessionHigh | real. Highest price during the trading day, either during a true session (openings and closings) or UTC Midnight to UTC Midnight. |
| sessionLow | real. Lowest price during the trading day, either during a true session (openings and closings) or UTC Midnight to UTC Midnight. |
| sessionClose | real. The closing price. In markets that open and close, this is the closing price for the current or most recent session; for 24-hour markets, it is the price as of the most recent UTC Midnight. |
| currentDayVolume | real. The unit volume of the instrument that is the subject of the snapshot, either during a true session (openings and closings) or in 24-hour markets, during the period UTC Midnight to UTC Midnight. |
| currentDayNumTrades | integer. The number of trades during the current day, either during a true session (openings and closings) or in a 24-hour market the period from UTC Midnight to UTC Midnight. |
| currentDayPxChange | real. Change in price over the current session or from UTC Midnight to UTC Midnight. |
| rolling24HrVolume | real. Unit volume of the instrument over the past 24 hours, regardless of time zone. This value recalculates continuously. |
| rolling24HrNumTrades | real. Number of trades during the past 24 hours, regardless of time zone. This value recalculates continuously. |
| rolling24HrPxChange | real. Price change during the past 24 hours, regardless of time zone. This value recalculates continuously. |
| rolling24HrPxChangePercent | real. Percent change in price during the past 24 hours. |
GetOperatorUsers (DEPRECATED)
Category: System
Permissions: Operator
Call Type: Synchronous
Returns a list of users who are associated with a specific operator.
In earlier versions of the AlphaPoint Exchange, users were associated with an operator.
This is no longer the case. You should not use this call.
Request
{
"OperatorId": 1
}
| Key | Value |
|---|---|
| OperatorId | integer. The ID of the operator whose corresponding user IDs you want to return. |
Response
The Response is an array of operator IDs and the user IDs associated with them.
[
{
"operatorId": 0,
"userId": 0,
}
]
| Key | Value |
|---|---|
| operatorId | integer. The ID of the operator echoed back from the Request. |
| userId | integer. The user ID associated with that operator ID. |
GetPendingFourEyeRequests
Category: Four Eye
Permissions: Operator
Call Type: Synchronous
Retrieves pending Four Eye Requests.
Request
{
"RequestId": 1,
"RequesterUserId": 1,
"EndpointName": "",
"EndpointType": 1,
"RequestStartTime": 1531359834,
"RequestEndTime": 1551359834,
"StartIndex": 1,
"Depth": 200,
}
| Key | Value |
|---|---|
| RequestId | integer. A number assigned to identify this request. |
| RequestUserId | integer. The user ID of the user requesting the endpoint of the pending four eye requests. |
| EndpointName | string. The endpoint the user tried to call. |
| EndpointType | integer. Endpoint type for the pending four eye request. Numbers correspond to the
following endpoint types: Parallel: 1 SystemSequential: 2 UserSequential: 3 |
| RequestStartTime | integer. Returned pending four eye requests start from this epoch time. |
| RequestEndTime | integer. Returned pending four eye requests end at this epoch time. |
| StartIndex | integer. Starting index for pending four eye requests return list. |
| Depth | integer. Maximum number of pending four eye requests returned. |
Response
The Response is an array of pending Four Eyes Requests.
[
{
"RequestId": 1,
"RequesterUserId": 3
"EndpointName": ""
"Payload": ""
"EndpointType": 1
"RequestTime": 1531359834
}
]
| Key | Value |
|---|---|
| RequestId | integer. A number assigned to identify this request. |
| RequestUserId | integer. The user ID of the user requesting the endpoint of the pending four eye requests. |
| Payload | string. GetPendingFourEyeRequests request payload |
| EndpointType | integer. Endpoint type for the pending four eye request. Numbers correspond to the
following endpoint types: Parallel: 1 SystemSequential: 2 UserSequential: 3 |
| RequestTime | integer. Epoch time of call for GetPendingFourEyeRequests. |
GetCompletedFourEyeRequests
Category: Four Eye
Permissions: Operator
Call Type: Synchronous
Retrieves completed Four Eye Requests, approved or denied.
Request
{
"RequestId": 1,
"RequesterUserId": 1,
"SecondEyesUserId": "",
"EndpointName": "",
"EndpointType": 1,
"RequestStartTime": 1531359834,
"RequestEndTime": 1551359834,
"CompletedStartTime": 1551359834,
"CompletedEndTime": 1551359834,
"StartIndex": 1,
"Depth": 200,
}
| Key | Value |
|---|---|
| RequestId | integer. A number assigned to identify this request. |
| RequestUserId | integer. The user ID of the user requesting the endpoint of the pending four eye requests. |
| SecondEyesUserID | integer. The user ID of the user who reviewed the four eyes request. |
| EndpointName | string. TThe endpoint the user tried to call. |
| EndpointType | integer. Endpoint type for the pending four eye request. Numbers correspond to the
following endpoint types: Parallel: 1 SystemSequential: 2 UserSequential: 3 |
| RequestStartTime | integer. Returned pending four eye requests start from this epoch time. |
| RequestEndTime | integer. Returned pending four eye requests end at this epoch time. |
| CompletedStartTime | integer. Returned pending four eye requests start from this epoch time. |
| CompletedEndTime | integer. Returned pending four eye requests end at this epoch time. |
| StartIndex | integer. Starting index for pending four eye requests return list. |
| Depth | integer. Maximum number of pending four eye requests returned. |
Response
The Response is an array of pending Four Eyes Requests.
[
{
"RequestId": 1,
"RequesterUserId": 3
"EndpointName": ""
"Payload": ""
"EndpointType": 1
"RequestTime": 1531359834
}
]
| Key | Value |
|---|---|
| RequestId | integer. A number assigned to identify this request. |
| RequestUserId | integer. The user ID of the user requesting the endpoint of the pending four eye requests. |
| Payload | string. GetPendingFourEyeRequests request payload |
| EndpointType | integer. Endpoint type for the pending four eye request. Numbers correspond to the
following endpoint types: Parallel: 1 SystemSequential: 2 UserSequential: 3 |
| RequestTime | integer. Epoch time of call for GetPendingFourEyeRequests. |
GetRole
Category: System
Permissions: Operator, Trading
Call Type: Synchronous
Gets the specified role based on the role id passed in the payload.
Request
{
"roleId": 1
}
| Key | Value |
|---|---|
| roleId | integer. Id role |
Response
[
{
"roleName": "Operator",
"permissions": ["GetProducts", "GetUserConfig", "SetUserConfig"]
}
]
| Key | Value |
|---|---|
| roleName | string. Name of role |
| permissions | string. Permissions associated with the role |
GetServiceConfigs
Category: System
Permissions: Operator
Call Type: Synchronous
Get the configurations for a particular service.
Request
{
"ServiceName": ""
}
| Key | Value |
|---|---|
| ServiceName | string. Name of the service to get configurations from. |
Response
Returns a list of services and their configurations associated with the service name.
[
{
"ServiceName": "",
"ConfigKey": ""
"ConfigValue": ""
"ConfigValueType": ""
"PreviousConfigValue": ""
"ConfigUpdateTime": ""
"IsMaskedOnResponse": false
}
]
| Key | Value |
|---|---|
| ServiceName | string. Name of the service to get configurations from. |
| ConfigKey | string. Service name associated with the configuration. |
| ConfigValue | string. Configuration of service. |
| ConfigValueType | string. Data type of ConfigValue |
| PreviousConfigValue | string. Previous configuration of service, "void" if no previous configuration |
| ConfigUpdateTime | string. Last time that configuration was updated. |
| IsMaskedOnResponse | Boolean. Should always be false if showing up in response. |
GetServiceConfigByKey
Category: System
Permissions: Operator
Call Type: Synchronous
Get the configurations for a particular service by the configuration key.
Request
{
"ServiceName": "",
"ConfigKey": "",
}
| Key | Value |
|---|---|
| ServiceName | string. Name of the service to get configurations from. |
| ConfigKey | string. Specific service key under the service name. |
Response
Returns a list of services and their configurations associated with the service name.
[
{
"ServiceName": "",
"ConfigKey": ""
"ConfigValue": ""
"ConfigValueType": ""
"PreviousConfigValue": ""
"ConfigUpdateTime": ""
"IsMaskedOnResponse": false
}
]
| Key | Value |
|---|---|
| ServiceName | string. Name of the service to get configurations from. |
| ConfigKey | string. Service name associated with the configuration. |
| ConfigValue | string. Configuration of service. |
| ConfigValueType | string. Data type of ConfigValue |
| PreviousConfigValue | string. Previous configuration of service, "void" if no previous configuration |
| ConfigUpdateTime | string. Last time that configuration was updated. |
| IsMaskedOnResponse | Boolean. Should always be false if showing up in response. |
RevertToPreviousConfigValue
Category: System
Permissions: Operator
Call Type: Synchronous
Reverts configuration to previous value.
Request
{
"ServiceName": "",
"ConfigKey": "",
}
| Key | Value |
|---|---|
| ServiceName | string. Name of the service to get configurations from. |
| ConfigKey | string. Specific service key under the service name. |
Response
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}
The Response is a standard response object.
| Key | Value |
|---|---|
| result | Boolean. If the call has been successfully received by the Order Management System, result is true; otherwise it is false. |
| errormsg | string. A successful receipt of the call returns null.
The errormsg key for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| details | string. Message text that the system may send. |
GetUserAccountInfos
Category: User
Permissions: Operator, Trading, AccountReadOnly
Call Type: Synchronous
Returns a list of account information for all accounts belonging to the specified user.
Request
{
"OMSId": 0,
"UserId": 0,
"UserName": "",
}
| Key | Value |
|---|---|
| OMSId | integer. The Order Management System on which the user has one ore more accounts. |
| UserId | integer. The ID of the user whose accounts you want to return. |
| UserName | string. The name of the user. |
Response
Returns a JSON list of account objects; one for each account associated with the user.
{
"OMSID": 0,
"AccountId": 0,
"AccountName": "",
"AccountHandle": "",
"FirmId": "",
"FirmName": "",
"AccountType": {
"Options":[
"Asset",
"Liability",
"ProfitLoss"
]
},
"FeeGroupID": 0,
"ParentID": 0,
"RiskType": {
"Options": [
"Unknown",
"Normal",
"NoRiskCheck",
"NoTrading"
]
},
"VerificationLevel": 0,
"FeeProductType": {
"Options": [
"BaseProduct",
"SingleProduct"
]
},
"FeeProduct": 0,
"RefererId": 0,
"SupportedVenueIds": [
0
],
}
| Key | Value |
|---|---|
| OMSID | integer. The ID of the Order Management System on which the account resides. |
| AccountId | integer. The ID of the account for which information was requested. |
| AccountName | string. The name of the account. |
| AccountHandle | string. AccountHandle is a unique user-assigned name that is checked at create time by the Order Management System. |
| FirmId | string. An arbitrary identifier assigned by a trading venue operator to a trading firm as part of the initial company, user, and account set up process. For example, Smith Financial Partners might have the ID SMFP. |
| FirmName | string. A longer, non-unique version of the trading firm’s name; for example, Smith Financial Partners. |
| AccountType | string. The type of the account for which information is being returned. One of:
Asset Liability ProfitLoss Responses for this string/value pair for Market Participants are almost exclusively Asset. |
| FeeGroupID | integer. Defines account attributes relating to how fees are calculated and assessed. Set by trading venue operator. |
| ParentID | integer. Reserved for future development. |
| RiskType | string. One of: Unkown (an error condition) Normal NoRiskCheck NoTrading Returns Normal for virtually all market participants. Other types indicate account configurations assignable by the trading venue operator. |
| VerificationLevel | Integer. Verification level ID (how much verification does this account require) defined by and set by the trading venue operator for this account. |
| FeeProductType | string. One of: BaseProduct SingleProduct Transaction fees may be charged by a trading venue operator. This value shows whether fees for this account’s trades are charged in the product being traded (BaseProduct, for example BitCoin) or whether the account has a preferred fee-paying product (SingleProduct, for example USD) to use in all cases and regardless of product being traded. |
| FeeProduct | integer. The ID of the preferred fee product, if SingleProduct is the value of FeeProductType. |
| RefererId | integer. Captures the ID of the person who referred this account to the trading venue, usually for marketing purposes. |
| SupportedVenueIds | integer array. Comma-separated array. Reserved for future expansion. Currently returns 0. |
GetUserAccounts
Category: User
Permissions: Operator, Trading, AccountReadOnly
Call Type: Synchronous
Returns a list of account IDs for a given user. More than one user may be associated with a given account.
Request
{
"omsId": 0,
"userId": 0,
"userName": "",
}
| Key | Value |
|---|---|
| OMSId | integer. The Order Management System on which the user has one ore more accounts. |
| UserId | integer. The ID of the user whose accounts you want to return. |
| UserName | string. The name of the user. |
Response
The response returns list of comma-separated account IDs.
{
0, // a list of account IDs
}
GetUserAffiliateCount
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Gets a count of users who have been referred to the exchange by the identified user.
Request
{
"OMSId":1,
"UserId":1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the user operates. |
| UserId | integer. The ID of the user. |
Response
{
"Count":0
}
| Key | Value |
|---|---|
| Count | integer. The count of exchange users who have been referred to the exchange by the user identified by UserId in the request. |
GetUserAffiliateTag
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Returns an array of affiliate tags associated with the identified user. The exchange can use an affiliate tag to identify new users who join the exchange as a result of a recommendation from the identified user. A user may have multiple affiliate tags.
Request
{
"userId": 0,
"omsId": 0
}
| Key | Value |
|---|---|
| userId | integer. The ID of the user whose affiliate tag you want to retrieve. |
| omsId | integer. The ID of the Order Management System on which the user operates. |
Response
The response is an array of affiliate tag information, with an object for each affiliate tag associated with the user.
[
{
"omsId": 0,
"userId": 0,
"affiliateId": 0,
"affiliateTag": ""
},
]
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System on which the user operates. This echoes the omsId in the request. |
| userId | integer. The ID of the user whose affiliate tag is returned. Echoes the userId in the request. |
| affiliateId | integer. The ID of the affiliate. |
| affiliateTag | string. The tag that the user can share. |
GetUserConfig
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Returns an array of configuration key-value pairs for the specified user. Via Configuration this will return redacted values to minimize PII exposure. The array of key-value pairs is variable in number, as required by the Exchange. The value of both Key and Value KVPs are strings.
You can set the array of configuration pairs using SetUserConfig.
Request
{
"userId": 0,
"userName": ""
}
| Key | Value |
|---|---|
| userId | integer. The ID of the user whose configuration key-value pairs you want to return. |
| userName | string. The user name of the user whose configuration key-value pairs you want to return. |
Response
[
{
"Key": "Config1",
"Value": "Config1Val"
}
]
The Response returns an array of a variable number of elements, depending on the needs of the Exchange.
| Key | Value |
|---|---|
| Key | string. The name of the key part of the key-value pair. |
| Value | string. The value part of the key-value pair. The value must be a string. |
GetAllUnredactedUserConfigsForUser
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Gets all the unredacted configs for a user
Request
{
"userId": 0,
"userName": ""
}
| Key | Value |
|---|---|
| userId | integer. The ID of the user whose configuration key-value pairs you want to return. |
| userName | string. The user name of the user whose configuration key-value pairs you want to return. |
Response
[
{
"Key": "Config1",
"Value": "Config1Val"
}
]
The Response returns an array of a variable number of elements, depending on the needs of the Exchange.
| Key | Value |
|---|---|
| Key | string. The name of the key part of the key-value pair. |
| Value | string. The value part of the key-value pair. The value must be a string. |
GetUnredactedUserConfigByKey
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Gets an unredacted config for a user config
Request
{
"userId": 0,
"userName": ""
}
| Key | Value |
|---|---|
| userId | integer. The ID of the user whose configuration key-value pairs you want to return. |
| userName | string. The user name of the user whose configuration key-value pairs you want to return. |
Response
[
{
"Key": "Config1",
"Value": "Config1Val"
}
]
The Response returns an array of a variable number of elements, depending on the needs of the Exchange.
| Key | Value |
|---|---|
| Key | string. The name of the key part of the key-value pair. |
| Value | string. The value part of the key-value pair. The value must be a string. |
GetUserDevices
Category: System
Permissions: Operator, Trading
Call Type: Synchronous
Gets the Registered Device trail for the current session. Given the userId, action, date range or all 3
Request
{
"UserId": 1
}
| Key | Value |
|---|---|
| UserId | integer. The user ID of the user requesting user devices. |
Response
The Response is an array of devices associated with the user.
[
{
"HashCode": 1,
"Location": "location"
"DeviceName": "name"
"IPAddress": "127.0.0.0"
"UserId": 1
"IsTrusted": true
"ExpirationTime": 637020116076891148
}
]
| Key | Value |
|---|---|
| HashCode | integer. Hash code associated with the device. |
| Location | string. Location of device |
| DeviceName | string. Name of device. |
| IPAddress | string. IP address associated with the device |
| UserID | integer. User ID associated with the device |
| isTrusted | boolean. If true, device is linked with location/ip address. |
| ExpirationTime | long integer. Epoch time when device registration expires |
GetUserReportTickets
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Returns an array of user report tickets for a specific user ID. A user report ticket identifies a report requested or subscribed to by a user. Reports can run once or periodically.
Request
{
"UserId": 1
}
| Key | Value |
|---|---|
| UserId | integer. The ID of the user whose user report tickets will be returned. |
Response
The response returns an array of tickets, each ticket representing a report.
[
{
{
"RequestingUser": 0,
"OMSId": 0,
"reportFlavor": {
"Options": [
"TradeActivity",
"Transaction",
"Treasury"
]
},
"createTime": "0001-01-01T05:00:00Z",
"initialRunTime": "0001-01-01T05:00:00Z",
"intervalStartTime": "0001-01-01T05:00:00Z",
"intervalEndTime": "0001-01-01T05:00:00Z",
"RequestStatus": {
"Options": [
"Submitted",
"Validating",
"Scheduled",
"InProgress",
"Completed",
"Aborting",
"Aborted",
"UserCancelled",
"SysRetired",
"UserCancelledPending"
]
},
"ReportFrequency": {
"Options": [
"onDemand",
"Hourly",
"Daily",
"Weekly",
"Monthly",
"Annually"
]
}
"intervalDuration": 0,
"RequestId": "I2nCtvyY8UuHsoSyrLe2QA==",
"lastInstanceId": "AAAAAAAAAAAAAAAAAAAAAA==",
"accountIds": [
1
],
},
}
]
| Key | Value |
|---|---|
| RequestingUser | integer. The User ID of the person requesting the report. |
| OMSId | integer. The ID of the Order Management System on which the report was run. |
| reportFlavor | string. The type of report. One of Tradeactivity Transaction Treasury |
| createTime | string. The time and date at which the request for the report was made, Microsoft Ticks format. |
| initialRunTime | string. The time and date at which the report was first run, Microsoft Ticks format. |
| intervalStartTime | string. The start of the period that the report will cover, Microsoft Ticks format. |
| intervalEndTime | string. The end of the period that the report will cover, Microsoft Ticks format. |
| RequestStatus | string. The status of the request for the report. Each status returns one
of: Submitted Validating Scheduled InProgress Completed Aborting Aborted UserCancelled SysRetired UserCancelPending |
| ReportFrequency | string. When the report
runs: OnDemand Hourly Daily Weekly Monthly Annually |
| intervalDuration | long integer. The period that the report looks backward relative to the run date, in POSIX format. The system calculates intervalDuration between intervalStartTime and intervalEndTime and reports it in POSIX format. For example, say that you specify a 90-day start-to-end-date window for a report. The intervalDuration value returns a value equivalent to 90 days and represents the backward-looking period of the report. Say that you have set up a weekly report to look back 90 days. When the report runs again in a week's time, it again looks back 90 days -- but now those 90 days are offset by a week from the first report. |
| RequestId | string. The ID of the original request. Request IDs are long strings unique within the Order Management System. |
| lastInstanceId | string. For scheduled reports, the report ID of the most recent previously run report. This will be null for a Generate~Report call, because generated reports are all on-demand. |
| accountIds | integer array. A comma-delimited array of account IDs whose trades are reported in the trade activity report. |
GetUserRoles
Category: System
Permissions: Superuser, Operator, Trading
Call Type: Synchronous
Gets all the roles for a given user and the permissions that belong to that role. A user can have one or many roles
Request
{
"userId": 1
}
Request
The Response is a standard response object
| Key | Value |
|---|---|
| userId | integer. ID of user |
| Key | Value |
|---|---|
| result | Boolean. If the hash code and validation code have successfully verified a device, result is true; otherwise it is false; |
| errormsg | string. A successful receipt of the call returns null. The errormsg key for an
unsuccessful call returns one of the following messages:
Not Authorized (errorcode20) Invalid Response (errorcode 100) Operation Failed (errorcode101) Server Error (errorcode102) Resource Not Found (errocode 104) Operation Not Supported (errocode 106) |
| errorcode | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. |
GetUserReportWriterResultRecords
Category: User
Permissions: Operator, Trading
Call
Type: Synchronous
The call returns an array of user report writer results. The results are the details of when reports have been run and the status of each report run.
Users with Trading permission can request user report writer result records only for their own user IDs; users with Operator permission can request any user's report writer result records.
Request
{
"userId":0,
"depth":50,
"startIndex":0
}
| Key | Value |
|---|---|
| userId | integer. The ID of the user whose report writer result records will be returned. |
| depth | integer. The count of records to be returned, beginning at startIndex and working backwards into the past. For example, for a startIndex of 100 and a depth of 50 GetUserReportWriterResultRecords will return records numbered between 100 and 149, inclusive. The value of depth defaults to 50. |
| startIndex | integer. The record number at which the call starts returning records; from there, record return moves into the past. The most recent record is record 0. The value of startIndex defaults to 50. |
Response
[
{
"RequestingUser":1,
"urtTicketId":"mGzjUfylGEmqgJIxu651aQ==",
"descriptorId":"47TlpPQyTkKR4LKl9Hy1yA==",
"resultStatus":"SuccessComplete",
"reportExecutionStartTime":"2018-08-17T17:57:56Z",
"reportExecutionCompleteTime":"2018-08-17T17:57:57Z",
"reportOutputFilePathname":"",
"reportDescriptiveHeader":"TradeActivity|onDemand|2018-08-10T04:00:00.000Z|2018-08-10T05:00:00.000Z|2018-08-17T17:57:51.852Z|2018-08-17T17:57:56.840Z|0.19634 seconds"
},
]
| Key | Value |
|---|---|
| RequestingUser | Integer. ID of the user requesting the report writer result records. |
| urtTicketId | string. An alphanumeric string containing the unique report ID of the report. |
| descriptorId | string. A GUID (globally-unique identifier) that describes the report separately from the report ticket. |
| resultStatus | string. The status of each run of the reports. One of: 0 NotStarted 1 NotComplete 2 ErrorComplete 3 SuccessComplete 4 Cancelled |
| reportExecutionStartTime | string. The time that the report writer began execution, in Microsoft Ticks format. |
| reportExecutionCompleteTime | string. The time that the report writer completed the report, in Microsoft Ticks format. |
| reportOutputFilePathname | string. The pathname (location) of the report output file. |
| reportDescriptiveHeader | string. A string describing the report. |
GetValidate2FARequiredEndpoints
Category: System
Permissions: Public
Call Type: Synchronous
Gets endpoints that require 2FA Validation
Request
There is no payload for a LogOut request.
{ }
Response
["createwithdrawticket","createdepositticket","adduserpermission"]
The response is a list of endpoints, all lowercase.
LogOut
Category: Authentication
Permissions: Public
Call Type: Synchronous
LogOut ends the current websocket session.
Request
There is no payload for a LogOut request.
{ }
Response
{
"result",
"errormsg":null,
"errorcode":0,
"detail":null
}
| Key | Value |
|---|---|
| result | Boolean. A successful logout returns true; an unsuccessful logout (an error condition) returns false. |
| errormsg | string. A successful logout returns null; the errormsg parameter for an
unsuccessful logout returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Not Authorized and Resource Not Found are unlikely errors for a LogOut. |
| errorcode | integer. A successful logout returns 0. An unsuccessful logout returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
RegisterNewDevice
Category: System
Permissions: Operator, Trading
Call Type: Synchronous
RegisterNewDevice is the device register confirmation call. It will take the hashcode and validation code sent in an email to verify a device as trusted*RegisterNewDevice.*
Request
{
"HashCode": "",
"PendingEmailCode": ""
}
| Key | Value |
|---|---|
| HashCode | string. Hash code associated with the device. |
| PendingEmailCode | string. Email code to register device |
Response
{
"result":true,
"errormsg":"",
"errorcode":0,
"detail":""
}
| Key | Value |
|---|---|
| result | Boolean. If the hash code and validation code have successfully verified a device, result is true; otherwise it is false; |
| errormsg | string. A successful receipt of the call returns null. The errormsg key for an
unsuccessful call returns one of the following messages:
Not Authorized (errorcode20) Invalid Response (errorcode 100) Operation Failed (errorcode101) Server Error (errorcode102) Resource Not Found (errocode 104) Operation Not Supported (errocode 106) |
| errorcode | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. |
RemoveUserProductPermissions
Category: User
Permissions: Operator, Company
Call Type: Synchronous
Removes a single product permission from a user. A product permission is a permission to trade in the product.
Request
{
"OMSId": 1,
"ProductId": 1,
"UserId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the user operates. |
| ProductId | integer. The ID of the product whose permission you are removing from the user. |
| UserId | integer. The ID of the user for whom you are removing the product permission. |
Response
{
"result":true,
"errormsg":"",
"errorcode":0,
"detail":""
}
| Key | Value |
|---|---|
| result | Boolean. True signifies that the server has received the request to associate the affiliate tag with a specific user (not that it has done so); false signifies an error. |
| errormsg | string. A successful response returns null; the errormsg parameter
for a successful response returns on of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 102) Resource Not Found (errocode 104) |
| errorcode | integer. A successful response returns 0. An unsuccessful response returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
RemoveUserRoles
Category: System
Permissions: Superuser, Operator, Trading
Call Type: Synchronous
Removes a role role from the given user.
Request
{
"userId": 1,
"userRoleId": 2,
}
| Key | Value |
|---|---|
| userId | integer. ID of user |
| userRoleId | integer. ID of role to rmove from user |
Response
{
"result": true,
"errormsg": "",
"errorcode": 0
"detail": ""
}
| Key | Value |
|---|---|
| result | Boolean.If the call has been successfully received by the Order Management System, result is true; otherwise it is false. |
| errormsg | string. A successful receipt of the call returns null.
The errormsg key for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcodestd> | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. |
SubscribeAccountEvents
Category: User
Permissions: Operator, Trading, AccountReadOnly
Call Type: Synchronous
Subscribes the user to notifications about the status of account-level events: orders, trades, position updates, deposits, and withdrawals for a specific account on the Order Management System (OMS). The subscription reports all events associated with a given account; there is no filter at the call level to subscribe to some events and not others.
Account event information is supplied in comma-separated-value (CSV) format. For specific CSV formatting information, see the APEX Extract CSV Data Dictionary, available from Bitazza.
Request
{
"AccountId": 1,
"OMSId": 1
}
| Key | Value |
|---|---|
| AccountId | integer. The ID of the account for the logged-in user. |
| OMSId | integer. The ID of the Order Management System to which the account belongs. |
Response
{
"Subscribe": true
}
| Key | Value |
|---|---|
| Subscribe | Boolean. A successful subscription returns true; otherwise, false. |
The Events
When you call SubscribeAccountEvents, you subscribe to all of the following list of events. The Order Management System may supply them at irregular intervals and in any order; software must listen for these events. The system sends each of these events in a message frame.
AccountPositionEvent
AccountPositionEvent The balance in your account changes.
{
"OMSId":4, //The OMSId. [Integer]
"AccountId":4, // 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 in the account for the specified product. [Dec]
"Hold": 2.1, //The total amount of the 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 Withdrawals Pending for the specified product. [Decimal]
"TotalDayDeposits":0, //The total 24-hour deposits for the specified product. UTC. [Dec]
"TotalDayWithdraws":0 //The total 24-hour withdraws for the specified product. UTC [Dec]
}
Trigger: The balance in your account changes.
CancelAllOrdersRejectEvent
CancelAllOrdersRejectEvent All orders for your account are rejected.
{
"OMSId": 1, // OMS ID [Integer]
"AccountId": 4, // ID of the account being tracked [Integer]
"InstrumentId": 0, // ID of the instrument in the order [Long Integer]
"Status": "Rejected", // Accepted/Rejected [String]
"RejectReason": "Instrument not found." // Reason for rejection [String]
}
Trigger: All orders for your account are rejected.
CancelOrderRejectEvent
CancelOrderRejectEvent 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 any was found. [64 Bit Integer]
"OrderType": "Unknown", // See "Order Types" in Introduction
"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 rejection. // [String]
}
Trigger: Your order is canceled.
CancelReplaceOrderRejectEvent
CancelReplaceOrderRejectEvent Your order is rejected even if a cancel-replace order was placed.
{
"OMSId": 1, // ID of the OMS [integer]
"AccountId": 4, // ID of the account [integer]
"OrderId": 9342, // The ID of the rejected order [integer]
"ClientOrderId": 1234, // The client-supplied order ID [long integer]
"LimitPrice": 99.1, // The limit price of the order.
"OrderIdOCO": 0, // The ID of the other ordre to cancel if this is executed.
"OrderType": "Limit", // See "Order Types" in Introduction.
"PegPriceType": "Bid", // Where to peg the stop/trailing order.
"OrderIdToReplace": 9333, // The ID of the order being cancelled and replaced.
"InstrumentId": 1, // ID of the instrument traded in the order.
"ReferencePrice": 99.1, // used internally.
"Quantity": 1.0, // Quantity of the replacement order
"Side": "Buy", // Side of the order: Buy, Sell, Short (future)
"StopPrice":0, // The price at which to execute the new order.
"TimeInForce":"GTC", // Period when new order can be executed.
"Status":"Rejected", // Status of the order – always "rejected"
"RejectReason":"Order Not Found" // Reason the order was rejected.
}
Trigger: Your order is rejected even if a cancel-replace order was placed.
MarketStateUpdate
MarketStateUpdate The market state is altered administratively.
{
"ExchangeId":1, // Exchange Id [Integer]
"VenueAdapterId":1, // Internal [Integer]
"VenueInstrumentId":1, // Instrument Id on a specific venue [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"
// ISO 8601 format UTC time zone
}
Trigger: The market state is altered administratively.
NewOrderRejectEvent
NewOrderRejectEvent An order associated with your account 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.
}
Trigger: An order associated with your account is rejected.
OrderStateEvent
OrderStateEvent The status changes for an order associated with your account.
{
"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", and
// "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 in POSIX format
"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"
}
Trigger: The status changes for an order associated with your account.
OrderTradeEvent
OrderTradeEvent An order associated with your account 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", //[String] Values are "Buy", "Sell", "Short" (future)
"Quantity":0.01, //Quantity [Decimal]
"Price":95, //Price [Decimal]
"Value":0.95, //Value [Decimal]
"TradeTime":635978008210426109, // TimeStamp in Microsoft ticks format
"ContraAcctId":3,
// The Counterparty of the trade. The counterparty is always
// the clearing account. [Integer]
"OrderTradeRevision":1, //Usually 1
"Direction":"NoChange" //"Uptick", "Downtick", "NoChange"
}
Trigger: An order associated with your account results in a trade.
PendingDepositUpdate
PendingDepositUpdate Deposit 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]
"Requires2FA": false,
"TwoFAType": "",
"TwoFAToken": "",
}
Trigger: Deposit pending on your account.
SubscribeLevel1
Category: User
Permissions: Operator, Trading, Level1MarketData
Call Type: Synchronous
Retrieves the latest Level 1 Ticker information and then subscribes the user to ongoing Level 1 market data event updates for one specific instrument.
The SubscribeLevel1 call responds with the Level 1 response shown below. The OMS then periodically sends in the same format as this response Leve1UpdateEvent information when best-bid/best-offer issue, until you send the UnsubscribeLevel1 call.
Only a user with Operator permission can issue Level1MarketData permission using the call **AddUserMarketDataPermission.*
Request
You can identify the instrument with its ID or with its market symbol (string).
{
"OMSId": 1,
"InstrumentId": 0
}
Or
{
"OMSId": 1,
"Symbol": "BTCUSD"
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the instrument trades. |
| InstrumentId | integer. The ID of the instrument you’re tracking. Conditionally optional. |
| Symbol | string. The symbol of the instrument you’re tracking. Conditionally optional. |
Response
The SubscribeLevel1 response and Level1UpdateEvent both provide the same information.
{
"OMSId": 1,
"InstrumentId": 1,
"BestBid": 6423.57,
"BestOffer": 6436.53,
"LastTradedPx": 6423.57,
"LastTradedQty": 0.96183964,
"LastTradeTime": 1534862990343,
"SessionOpen": 6249.64,
"SessionHigh": 11111,
"SessionLow": 4433,
"SessionClose": 6249.64,
"Volume": 0.96183964,
"CurrentDayVolume": 3516.31668185,
"CurrentDayNumTrades": 8529,
"CurrentDayPxChange": 173.93,
"Rolling24HrVolume": 4319.63870783,
"Rolling24NumTrades": 10585,
"Rolling24HrPxChange": -0.4165607307408487,
"TimeStamp": "1534862990358"
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the instrument trades. |
| InstrumentId | integer. The ID of the instrument being tracked. |
| BestBid | real. The current best bid for the instrument. |
| BestOffer | real. The current best offer for the instrument. |
| LastTradedPx | real. The last-traded price for the instrument. |
| LastTradedQty | real. The last-traded quantity for the instrument. |
| LastTradeTime | long integer. The time of the last trade, in POSIX format. |
| SessionOpen | real. Opening price. In markets with openings and closings, this is the opening price for the current session; in 24-hour markets, it is the price as of UTC Midnight. |
| SessionHigh | real. Highest price during the trading day, either during a session with opening and closing prices or UTC midnight to UTC midnight. |
| SessionLow | real. Lowest price during the trading day, either during a session with opening and closing prices or UTC midnight to UTC midnight. |
| SessionClose | real. The closing price. In markets with openings and closings, this is the closing price for the current session; in 24-hour markets, it is the price as of UTC Midnight. |
| Volume | real. The unit volume of the instrument traded, either during a session with openings and closings or in 24-hour markets, the period from UTC Midnight to UTC Midnight. |
| CurrentDayVolume | real. The unit volume of the instrument traded either during a session with openings and closings or in 24-hour markets, the period from UTC Midnight to UTC Midnight. |
| CurrentDayNumTrades | integer. The number of trades during the current day, either during a session with openings and closings or in 24-hour markets, the period from UTC Midnight to UTC Midnight. |
| CurrentDayPxChange | real. Current day price change, either during a trading session or UTC Midnight to UTC midnight. |
| Rolling24HrVolume | real. Unit volume of the instrument during the past 24 hours, regardless of time zone. Recalculates continuously. |
| Rolling24HrNumTrades | integer. Number of trades during the past 24 hours, regardless of time zone. Recalculates continuously. |
| Rolling24HrPxChange | real. Price change during the past 24 hours, regardless of time zone. Recalculates continuously. |
| TimeStamp | long integer. The time this information was provided, in POSIX format. |
SubscribeLevel2
Category: User
Permissions: Operator, Trading, Level2MarketData
Call Type: Synchronous
Retrieves the latest Level 2 Ticker information and then subscribes the user to Level 2 market data event updates for one specific instrument. Level 2 allows the user to specify the level of market depth information on either side of the bid and ask. The SubscribeLevel2 call responds with the Level 2 response shown below. The OMS then periodically sends Level2UpdateEvent information in the same format as this response until you send the UnsubscribeLevel2 call.
Only a user with Operator permission can issue a Level2MarketData permission using the call AddUserMarketDataPermission.
Request
{
"OMSId": 1,
"InstrumentId": 0
"Depth": 10
}
or
{
"OMSId": 1,
"Symbol": "BTCUSD"
"Depth": 10
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the instrument trades. |
| InstrumentId | integer. The ID of the instrument you’re tracking. Conditionally optional. |
| Symbol | string. The symbol of the instrument you’re tracking. Conditionally optional. |
| Depth | integer. The depth of the order book. The example request returns 10 price levels on each side of the market. |
Response
[
[
0, // MDUpdateId
1, // AccountId
123,// ActionDateTime in Posix format X 1000
0, // ActionType 0 (New), 1 (Update), 2(Delete)
0.0, // LastTradePrice
0, // OrderId
0.0, //Price
0, // ProductPairCode
0.0, // Quantity
0, // Side
],
]
The response is an array of elements for one specific instrument, the number of elements corresponding to the market depth specified in the Request. It is sent as an uncommented, comma-delimited list of numbers. The example is commented.
| Key | Value |
|---|---|
| MDUpdateID | integer. Market Data Update ID. This sequential ID identifies the order in which the update was created. |
| AccountId | integer. The ID of the account trading the instrument. |
| ActionDateTime | long integer.. ActionDateTime identifies the time and date that the snapshot was taken or the event occurred, in POSIX format X 1000 (milliseconds since 1 January 1970). |
| ActionType | integer. L2 information provides price data. This value shows whether this data
is: 0 new 1 update 2 deletion |
| LastTradePrice | real. The price at which the instrument was last traded. |
| OrderId | integer. The ID of the order. |
| Price | real. Bid or Ask price for the Quantity (see Quantity below). |
| ProductPairCode | integer. ProductPairCode is the same value and used for the same purpose as InstrumentID. The two are completely equivalent. InstrumentId 47 = ProductPairCode 47. |
| Quantity | real. Quantity available at a given Bid or Ask price (see Price above). |
| Side | integer. One of: 0 Buy 1 Sell 2 Short (reserved for future use) 3 Unknown (error condition) |
SubscribeTicker
Category: User
Permissions: Operator, Trading, Level1MarketData
Call Type: Synchronous
Subscribes a user to a Ticker Market Data Feed for a specific instrument and interval. SubscribeTicker sends a response object as described below, and then periodically returns a TickerDataUpdateEvent that matches the content of the response object.
Only a user with Operator permission can issue a Level1MarketData permission using the call AddUserMarketDataPermission.
Request
{
"OMSId": 1,
"InstrumentId": 1,
"Interval": 60,
"IncludeLastCount": 100
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System |
| InstrumentId | long integer. The ID of the instrument whose information you want to track. |
| Interval | integer. Specifies in seconds how frequently to obtain ticker updates. Default is 60 — one minute. |
| IncludeLastCount | integer. The limit of records returned in the ticker history. The default is 100. |
Response
[
[1501603632000, \\DateTime - UTC - Milliseconds since 1/1/1970
2700.33, \\High
2701.2687.01, \\Low
2687.01, \\Open
2687.01, \\Close
24.86100992, \\Volume
0, \\Inside Bid Price
2870.95, \\Inside Ask Price
1], \\InstrumentId
[1501604532000,2792.73,2667.95,2687.01,2700.81,242.61340767,0,2871,0]
]
The response returns an array of objects , each object an unlabeled, comma-delimited array of numbers. The Open price and Close price are those at the beginning of the tick — the Interval time subscribed to in the request. For 24-hour exchanges, the trading day runs from UTC midnight to UTC midnight; highs, lows, opens, closes, and volumes consider that midnight-to-midnight period to be the trading day. The data order is:
- date/time UTC in milliseconds since 1/1/1970
- high
- low
- open
- close
- volume
- inside bid price
- inside ask price
- instrument ID
A typical response might look like this:
[[1510719222970.21,6943.51,6890.27,6898.41,6891.16,0,6890.98,6891.98,1,1510718681956.34]],
SubscribeTrades
Category: User
Permissions: Operator, Trading, Level1MarketData
Call Type: Synchronous
Subscribes an authenticated user to the Trades Market Data Feed for a specific instrument. Each trade has two sides: Buy and Sell.
SubscribeTrades returns the response documented here for your immediate information, then periodically sends the OrderTradeEvent documented in SubscribeAccountEvents.
Only a user with Operator permission can issue the permission Level1MarketData using the call AddUserMarketDataPermission.
Request
{
"OMSId": 1,
"InstrumentId": 1,
"IncludeLastCount": 100
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the instrument is traded. |
| InstrumentId | long integer. The ID of the instrument whose trades will be reported. |
| IncludeLastCount | integer. Specifies the number of previous trades to retrieve in the immediate snapshot. Default is 100. |
Response
Numerical keys reduce package transmission load. See Response table for an explanation.
[
{
0: 1713390,
1: 1,
2: 0.25643269,
3: 6419.77,
4: 203100209,
5: 203101083,
6: 1534863265752,
7: 2,
8: 1,
9: 0,
10: 0
}
]
The response returns an array of trades. The keys of each trade are numbers to reduce payload traffic.
| Key | Value |
|---|---|
| 0 (TradeId) | integer. The ID of this trade. |
| 1 (ProductPairCode) | integer. ProductPairCode is the same number and used for the same purpose as InstrumentID. The two are completely equivalent in value. InstrumentId 47 = ProductPairCode 47. |
| 2 (Quantity) | real. The quantity of the instrument traded. |
| 3 (Price) | real. The price at which the instrument traded. |
| 4 (Order1) | integer. The ID of the first order that resulted in the trade, either Buy or Sell. |
| 5 (Order2) | integer. The ID of the second order that resulted in the trade, either Buy or Sell. |
| 6 (Tradetime) | long integer. UTC trade time in Total Milliseconds. POSIX format. |
| 7 (Direction) | integer. Effect of the trade on the instrument’s market price. One of: 0 NoChange 1 UpTick 2 DownTick |
| 8 (TakerSide) | integer. Which side of the trade took liquidity? One of: 0 Buy 1 Sell The maker side of the trade provides liquidity by placing the order on the book (this can be a buy or a sell order). The other, taker, side takes the liquidity. It, too, can be buy-side or sell-side. |
| 9 (BlockTrade) | Boolean. Was this a privately negotiated trade that was reported to the OMS? A private trade returns 1 (true); otherwise 0 (false). Default is false. Block trades are not supported in exchange version 3.1 |
| 10 (order1ClientId or order2ClientId) | integer. The client-supplied order ID for the trade. Internal logic determines whether the program reports the order1ClientId or the order2ClientId. |
UnsubscribeLevel1
Category: User
Permissions: Operator, Trading, Level1MarketData
Call Type: Synchronous
Unsubscribes the user from a Level 1 Market Data Feed subscription.
Request
{
"OMSId": 1,
"InstrumentId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the user has subscribed to a Level 1 market data feed. |
| InstrumentId | long integer. The ID of the instrument being tracked by the Level 1 market data feed. |
Response
{
"result": true,
"errormsg": null,
"errorcode":0,
"detail": null
}
| Key | Value |
|---|---|
| result | Boolean. A successful receipt of the unsubscribe request returns true; and unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt of the unsubscribe request returns null; the
errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the unsubscribe request returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
UnsubscribeLevel2
Category: User
Permissions: Operator, Trading, Level2MarketData
Call Type: Synchronous
Unsubscribes the user from a Level 2 Market Data Feed subscription.
Request
{
"OMSId": 1,
"InstrumentId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the user has subscribed to a Level 2 market data feed. |
| InstrumentId | long integer. The ID of the instrument being tracked by the Level 2 market data feed. |
Response
{
"result": true,
"errormsg": null,
"errorcode":0,
"detail": null
}
| Key | Value |
|---|---|
| result | Boolean. A successful receipt of the unsubscribe request returns true; and unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt of the unsubscribe request returns null; the
errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the unsubscribe request returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
UnsubscribeTicker
Category: User
Permissions: Operator, Trading, Level1MarketData
Call Type: Synchronous
Unsubscribes the user from a Ticker Market Data Fee.
Request
{
"OMSId": 1,
"InstrumentId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the user has subscribed to a ticker market data feed. |
| InstrumentId | long integer. The ID of the instrument being tracked by the ticker market data feed. |
Response
{
"result": true,
"errormsg": null,
"errorcode":0,
"detail": null
}
| Key | Value |
|---|---|
| result | Boolean. A successful receipt of the unsubscribe request returns true; and unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt of the unsubscribe request returns null; the
errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the unsubscribe request returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
UnsubscribeTrades
Category: User
Permissions: Operator, Trading, Level1MarketData
Call Type: Synchronous
Unsubscribes the user from a Trades Market Data Feed
Request
{
"OMSId": 1,
"InstrumentId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the user has subscribed to a trades market data feed. |
| InstrumentId | long integer. The ID of the instrument being tracked by the trades market data feed. |
Response
{
"result": true,
"errormsg": null,
"errorcode":0,
"detail": null
}
| Key | Value |
|---|---|
| result | Boolean. A successful receipt of the unsubscribe request returns true; and unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt of the unsubscribe request returns null; the
errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the unsubscribe request returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
UpdateUserAffiliateTag
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Updates the user affiliate tag with new or revised information. An affiliate tag allows a user to encourage others to join the exchange and provides a way to track those new members back to the initiating user.
Request
{
"omsId":0,
"userId":0,
"affiliateId":0,
"affiliateTag":""
}
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System on which the user and his affiliate tag operates. |
| userId | integer. The ID of the user whose affiliate tag you are modifying. |
| affiliateId | integer. The ID of the affiliate. |
| affiliateTag | string. The alphanumeric tag used to identify new affiliating members. |
Response
{
"result":true,
"errormsg":"",
"errorcode":0,
"detail":""
}
| Key | Value |
|---|---|
| result | Boolean. A successful receipt of the unsubscribe request returns true; and unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt of the unsubscribe request returns null; the
errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the unsubscribe request returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
UpdateServiceConfig
Category: System
Permissions: Operator
Call Type: Synchronous
Get the configurations for a particular service by the configuration key.
Request
{
"ServiceName": "",
"ConfigKey": "",
"ConfigValue": ""
}
| Key | Value |
|---|---|
| ServiceName | string. Name of the service to get configurations from. |
| ConfigKey | string. Specific service key under the service name. |
| ConfigValueType | string. New updated configuration value for the service. |
Response
The Response is a standard response object.
{
"result": true,
"errormsg": "",
"errorcode": 0
"detail": ""
}
| Key | Value |
|---|---|
| result | Boolean.If the call has been successfully received by the Order Management System, result is true; otherwise it is false. |
| errormsg | string. A successful receipt of the call returns null.
The errormsg key for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcodestd> | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. |
Validate2FA
Category: System
Permissions:
Call Type: Synchronous
Validate 2FA to get access to the 2FA required endpoints
Request
{
"TFaType": "TFaType",
"Code": "YourCode",
}
| Key | Value |
|---|---|
| TFaType | string. Type of authentication |
| Code | string. Authentication code |
Response
{
"TFaAuthenticated": true,
}
| Key | Value |
|---|---|
| TFaAuthenticated | Boolean. If authenticatation is successful, returns true |
Accounts
These calls correspond roughly to the Accounts function of the Exchange Admin and Admin Guide.
GenerateTradeActivityReport
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Creates an immediate report on historical trade activity on a specific Order Management System for a list of accounts during a specified time interval.
A user with Trading permission can only generate reports for accounts with which he is associated; a user with Operator permission can generate reports for accounts associated with others.
The Trade Activity Report is delivered as a comma-separated (CSV) file. For specific CSV formatting information, see the APEX Extract CSV Data Dictionary, available from Bitazza.
Request
{
"accountIdList": [
0 // one or more Account IDs
],
"omsId": 0,
"startTime": "0001-01-01T05:00:00Z",
"endTime": "0001-01-01T05:00:00Z",
}
| Key | Value |
|---|---|
| accountIdList | integer array. A comma-delimited array of one ore more account IDs, each valid on a single Order Management System for the authenticated user. The account user may not be the only user of the account. |
| omsId | integer. The ID of the Order Management System on which the array of account IDs exist. |
| startTime | string. startTime identifies the time and date for the historic beginning of the trade activity report. |
| endTime | string. endTime identifies the time and date for the historic end of the trade activity report. |
Response
{
"RequestingUser":1,
"OMSId":1,
"reportFlavor": {
"Options": [
"TradeActivity",
"Transaction",
"Treasury"
]
},
"createTime":"2018-08-17T15:34:20Z",
"initialRunTime":"2018-08-17T15:34:20Z",
"intervalStartTime":"2019-04-10T04:00:00Z",
"intervalEndTime":"2020-04-10T04:00:00Z",
"RequestStatus": {
"Options": [
"Submitted",
"Validating",
"Scheduled",
"InProgress",
"Completed",
"Aborting",
"Aborted",
"UserCancelled",
"SysRetired",
"UserCancelledPending"
]
},
"ReportFrequency": {
"Options": [
"onDemand",
"Hourly",
"Daily",
"Weekly",
"Monthly",
"Annually"
]
},
"intervalDuration":316224000000000,
"RequestId":"Moy/IpfPA0SLUHNYt54q4w==",
"lastInstanceId":"AAAAAAAAAAAAAAAAAAAAAA==",
"accountIds":[1]
}
Similar objects are returned for Generate~Report and Schedule~Report calls. As a result, for an on-demand Generate~Report call, some string-value pairs such as initialRunTime may return the current time and ReportFrequency will always return OnDemand because the report is only generated once and on demand.
| Key | Value |
|---|---|
| RequestingUser | integer. The User ID of the person requesting the trade activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response. |
| OMSId | integer. The ID of the Order Management System on which the trade activity report will be run. |
| reportFlavor | string. The type of report to be generated. One
of: TradeActivity Transaction Treasury The reportFlavor string confirms the nature of the call. |
| createTime | string. The time and date on which the request for the trade activity report was made. |
| initialRunTime | string. The time and date at which the trade activity report was first run. |
| intervalStartTime | string. The start of the period that the report will cover. |
| intervalEndTime | string. The end of the period that the report will cover. |
| RequestStatus | string. The status of the request for the trade activity report. A Generate~Report
request will always return Submitted. Each request returns one
of: Submitted Validating Scheduled InProgress Completed Aborting Aborted UserCancelled SysRetired UserCancelled Pending |
| ReportFrequency | string. When the report runs. For a Generate~Report call, this is
always OnDemand. One of: OnDemand Hourly Daily Weekly Monthly Annually |
| intervalDuration | long integer. The period that the report covers relative to the run date. The
Generate~Report call requires a start time and an end time. The Bitazza software
calculates the difference between them as intervalDuration. For example, say that you specify a 90-day start-date-to-end-date window for a report. The intervalDuration value returns a value equivalent to 90 days. If you have called Generate~Report, that value simply confirms the length of time that the on-demand report covers. |
| RequestId | string. The ID of the original request. Request IDs are long strings unique within the Order Management System. |
| lastInstanceId | string. For scheduled reports, the report ID of the most recent previously run report. Will be null for a Generate~Report call, because generated reports are on-demand. |
| accountIds | integer array. A comma-delimited array of account IDs whose trades are reported in the trade activity report. |
GenerateTransactionActivityReport
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Generates an immediate report on account transaction activity for a list of accounts under a single Order Management System during a specified time. A user with Trading permission can only generate reports for accounts with which he is associated; a user with Operator permission can generate reports for accounts associated with others. There can be multiple users associated with an account.
The Transaction Activity Report is delivered as a comma-separated (CSV) file. For specific CSV formatting information, see the APEX Extract CSV Data Dictionary, available from Bitazza.
Request
{
"accountIdList": [
0
],
"omsId": 0,
"startTime": "0001-01-01T05:00:00Z",
"endTime": "0001-01-01T05:00:00Z",
}
| Key | Value |
|---|---|
| accountIdList | integer array. A comma-delimited array of one ore more account IDs, each valid on the same Order Management System on which the user is authenticated. |
| omsId | integer. The ID of the Order Management System on which the array of account IDs exist. |
| startTime | string. startTime identifies the time and date for the beginning of the transaction activity report, in ISO 8601 format. |
| endTime | string. endTime identifies the time and date for the end of the transaction activity report, in ISO 8601 format. |
Response
{
"RequestingUser":1,
"OMSId":1,
"reportFlavor": {
"Options": [
"TradeActivity",
"Transaction",
"Treasury"
]
},
"createTime":"2018-08-17T15:46:07Z",
"initialRunTime":"2018-08-17T15:46:07Z",
"intervalStartTime":"2019-04-10T04:00:00Z",
"intervalEndTime":"2020-04-10T04:00:00Z",
"RequestStatus": {
"Options": [
"Submitted",
"Validating",
"Scheduled",
"InProgress",
"Completed",
"Aborting",
"Aborted",
"UserCancelled",
"SysRetired",
"UserCancelledPending"
]
},
"ReportFrequency": {
"Options": [
"onDemand",
"Hourly",
"Daily",
"Weekly",
"Monthly",
"Annually"
]
},
"intervalDuration":316224000000000,
"RequestId":"+QgyhnEFqEazyZ46Q902MA==",
"lastInstanceId":"AAAAAAAAAAAAAAAAAAAAAA==",
"accountIds":[1]
}
Similar objects are returned for Generate~Report and Schedule~Report calls. As a result, for an on-demand Generate~Report call, some string-value pairs such as initialRunTime may return the current time and ReportFrequency will always return OnDemand because the report is only generated once and on demand.
| Key | Value |
|---|---|
| RequestingUser | integer. The User ID of the person requesting the transaction activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response. |
| OMSId | integer. The ID of the Order Management System on which the transaction activity report will be run. |
| reportFlavor | string. The type of report to be generated. One
of: TradeActivity Transaction Treasury The reportFlavor string confirms the nature of the call. |
| createTime | string. The time and date on which the request for the trade activity report was made. |
| initialRunTime | string. The time and date at which the trade activity report was first run. Returns the current time for a Generate~Report call. |
| intervalStartTime | string. The start of the period that the report will cover. |
| intervalEndTime | string. The end of the period that the report will cover. |
| RequestStatus | string. The status of the request for the trade activity report. A
Generate~Report request will always return Submitted. Each request returns one
of: Submitted Validating Scheduled InProgress Completed Aborting Aborted UserCancelled SysRetired UserCancelled Pending |
| ReportFrequency | string. When the report runs. For a Generate~Report call, this is
always OnDemand. OnDemand Hourly Daily Weekly Monthly Annually |
| intervalDuration | long integer. The period that the report covers relative to the run date. The
Generate~Report call requires a start time and an end time. The Bitazza software
calculates the difference between them as intervalDuration. For example, say that you specify a 90-day start-date-to-end-date window for a report. The intervalDuration value returns a value equivalent to 90 days. If you have called Generate~Report, that value simply confirms the length of time that the on-demand report covers. |
| RequestId | string. The ID of the original request. Request IDs are long strings unique within the Order Management System. |
| lastInstanceId | string. For scheduled reports, the report ID of the most recent previously run report. Will be null for a Generate~Report call, because generated reports are on-demand. |
| accountIds | integer array. A comma-delimited array of account IDs whose trades are reported in the trade activity report. |
GenerateTreasuryActivityReport
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Generates an immediate report on all company treasury activities related to the trading venue — those withdrawals, transfers, and funds movements that are unrelated to specific trades — over a specified period.
A user with Trading permission can only generate reports for accounts with which he is associated; a user with Operator permission can generate reports for accounts associated with others. There can be multiple users associated with an account.
The Trade Activity Report is delivered as a comma-separated (CSV) file. For specific CSV formatting information, see the APEX Extract CSV Data Dictionary, available from Bitazza.
Request
{
"accountIdList": [
0
],
"omsId": 0,
"startTime": "0001-01-01T05:00:00Z",
"endTime": "0001-01-01T05:00:00Z",
}
| Key | Value |
|---|---|
| accountIdList | integer array. A comma-delimited array of one ore more account IDs, each valid on a single Order Management System. For a user with Trading permission, the user must be associated with the accounts. The account user might not be the only user of the account. |
| omsId | integer. The ID of the Order Management System on which the array of account IDs exists. |
| startTime | string. startTime identifies the time and date for the historic beginning of the trade activity report. |
| endTime | string. endTime identifies the time and date for the historic end of the trade activity report |
Response
{
"RequestingUser":1,
"OMSId":1,
"reportFlavor": {
"Options": [
"TradeActivity",
"Transaction",
"Treasury"
]
},
"createTime":"2018-08-17T15:38:59Z",
"initialRunTime":"2018-08-17T15:38:59Z",
"intervalStartTime":"2019-04-10T04:00:00Z",
"intervalEndTime":"2020-04-10T04:00:00Z",
"RequestStatus": {
"Options": [
"Submitted",
"Validating",
"Scheduled",
"InProgress",
"Completed",
"Aborting",
"Aborted",
"UserCancelled",
"SysRetired",
"UserCancelledPending"
]
},
"ReportFrequency": {
"Options": [
"onDemand",
"Hourly",
"Daily",
"Weekly",
"Monthly",
"Annually"
]
},
"intervalDuration":316224000000000,
"RequestId":"adduAIKE6Ee0eGxFM+ydsg==",
"lastInstanceId":"AAAAAAAAAAAAAAAAAAAAAA==",
"accountIds":[1]
}
Similar objects are returned for Generate~Report and Schedule~Report calls. As a result, for an on-demand Generate~Report call, some string-value pairs such as initialRunTime may return the current time and ReportFrequency will always return OnDemand because the report is only generated once and on demand.
| Key | Value |
|---|---|
| RequestingUser | integer. The User ID of the person requesting the treasury activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response. |
| OMSId | integer. The ID of the Order Management System on which the transaction activity report will be run. Note capitalization change from the request. |
| reportFlavor | string. The type of report to be generated. One
of: TradeActivity Transaction Treasury The reportFlavor string confirms the nature of the call. |
| createTime | string. The time and date on which the request for the trade activity report was made. |
| initialRunTime | string. The time and date at which the trade activity report was first run. Returns the current time for a Generate~Report call. |
| intervalStartTime | string. The start of the period that the report will cover. |
| intervalEndTime | string. The end of the period that the report will cover. |
| RequestStatus | string. The status of the request for the trade activity report. A Generate~Report
request will always return Submitted. Each request returns one
of: Submitted Validating Scheduled InProgress Completed Aborting Aborted UserCancelled SysRetired UserCancelled Pending |
| ReportFrequency | string. When the report runs. For a Generate~Report call, this is
always OnDemand. OnDemand Hourly Daily Weekly Monthly Annually |
| intervalDuration | long integer. The period that the report covers relative to the run date. The
Generate~Report call requires a start time and an end time. The Bitazza software calculates the difference
between them as intervalDuration. For example, say that you specify a 90-day start-date-to-end-date window for a report. The intervalDuration value returns a value equivalent to 90 days. If you have called Generate~Report, that value simply confirms the length of time that the on-demand report covers. |
| RequestId | string. The ID of the original request. Request IDs are long strings unique within the Order Management System. |
| lastInstanceId | string. For scheduled reports, the report ID of the most recent previously run report. Will be null for a Generate~Report call, because generated reports are on-demand. |
| accountIds | integer array. A comma-delimited array of account IDs whose trades are reported in the trade activity report. |
GetAccountInfo
Category: User
Permissions: Operator, Trading,
AccountReadOnly
Call Type: Synchronous
Returns detailed information about one specific account and existing on a specific Order Management System.
Request
{
"omsId":0,
"accountId":0
}
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System on which the account exists. |
| accountId | integer. The ID of the account on the Order Management System for which information will be returned. |
Response
{
"omsid":0,
"accountId":0,
"accountName":"",
"accountHandle":"",
"firmId":"",
"firmName":"",
"accountType": {
"Options": [
"Asset", // 0
"Liability", // 1
"ProfitLoss" // 2
]
},
"feeGroupID":0,
"parentID":0,
"riskType": {
"Options": [
"Unknown", // 0
"Normal", // 1
"NoRiskCheck", // 2
"NoTrading" // 3
]
},
"verificationLevel":0,
"feeProductType": {
"Options": [
"BaseProduct", // 0
"SingleProduct" // 1
]
},
"feeProduct":0,
"refererId":0,
"loyaltyProductId":0,
"loyaltyEnabled":false,
"marginEnabled":false,
"liabilityAccountId":0,
"lendingAccountId":0,
"profitLossAccountId":0
}
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System on which the account resides. |
| accountId | integer. The ID of the account for which information was requested. |
| accountName | string. A non-unique name for the account assigned by the user. |
| accountHandle | string. accountHandle is a unique user-assigned name that is checked at create time by the Order Management System to assure its uniqueness. |
| firmId | string. An arbitrary identifier assigned by a trading venue operator to a trading firm as part of the initial company, user, and account set up process. For example, Smith Financial Partners might have the ID SMFP. |
| firmName | string. A longer, non-unique version of the trading firm’s name; for example, Smith Financial Partners. |
| accountType | integer. The type of the account for which information is being returned. One
of: Asset (0) Liability (1) ProfitLoss (2) Responses for this string/value pair for Market Participants are almost exclusively Asset. |
| feeGroupID | integer. Defines account attributes relating to how fees are calculated and assessed. Set by trading venue operator. |
| parentID | integer. Reserved for future development. |
| riskType | integer. One of: Unkown (0) (an error condition) Normal (1) NoRiskCheck (2) NoTrading (3) Returns Normal for virtually all market participants. Other types indicate account configurations assignable by the trading venue operator. |
| verificationLevel | integer. Verification level limits the amounts of deposits and withdrawals. It is defined by and set by the trading venue operator for each account and is part of the KYC ("Know Your Customer") process, which may be automated or manual. An account can earn a higher Verification Level over time. |
| feeProductType | string. One of: BaseProduct SingleProduct Trading fees may be charged by a trading venue operator. (Withdrawal fees may also be charged, but that is a separate setting dependent on product and instrument.) This value shows whether fees for this account’s trades are charged in the product being traded (BaseProduct, for example BitCoin) or whether the account has a preferred fee-paying product (SingleProduct, for example USD) to use in all cases and regardless of product being traded. |
| feeProduct | integer. The ID of the preferred fee product, if any. Defaults to 0. |
| refererId | integer. Captures the ID of the entity who referred this account to the trading venue, usually captured for marketing purposes. |
| loyaltyProductId | integer. The Loyalty Token is a parallel fee structure that replaces the general set of transaction fees. An exchange can promote activity on a specific cryptocurrency token by offering discounted transaction fees denominated in that token to customers who choose that fee structure. This key is the ID of the loyalty product chosen by the Exchange. There can be one Loyalty Token per OMS. |
| loyaltyEnabled | Boolean. If true, this account has accepted the Loyalty Token fee structure. If false, the account has not accepted it. The default setting is false. |
| marginEnabled | Boolean. If true, this account can trade on margin. If false, the account cannot trade on margin. The default is false. |
| liabilityAccountId | integer. The ID of the liability account associated with the account named in the accountId key. A liability account is necessary for this account to trade on margin. Used internally. |
| lendingAccountId | integer. The ID of the lending account associated with the account named in the accountId key. A lending account is necessary for this account to trade on margin. Used internally. |
| profitLossAccountId | integer. The ID of the profit-and-loss account associated with the account named in the accountId key. A profit-and-loss account is necessary for this account to trade on margin. Used internally. |
GetAccountLedgerEntry
Category: User
Permissions: Operator
Call Type: Synchronous
Retrieves a single ledger entry for an account by the ID of the ledger entry. You can obtain a list of ledger entry IDs for a specific account with the call GetLedgerEntriesByAccount.
Request
{
"AccountLedgerEntryId": 1
}
| Key | Value |
|---|---|
| AccountLedgerEntryId | integer. The ID of the ledger entry you want returned. |
Response
{
"AccountId": 0,
"ProductId": 0,
"CR_Amt": 0,
"DR_Amt": 0,
"EnteredBy": 0,
"Comments": null,
"OneSidedTransaction": 0,
"AccountLedgerEntryId": 0
}
The response is list of fields describing the ledger entry.
| Key | Value |
|---|---|
| AccountId | integer. The ID of the account for which the ledger entry was made. |
| ProductId | integer. The ID of the product being deposited or withdrawn. |
| CR_Amt | real. Credit entry. The amount of funds entering the account. |
| DR_Amt | real. Debit entry. The amount of funds leaving the account. |
| EnteredBy | integer. The ID of the user who made the ledger entry. |
| Comments | string. Any comment previously entered about the ledger entry. |
| oneSidedTransaction | byte. Used for a manual entry when the user must make either a deposit or a withdrawal entry. |
| AccountLedgerEntryId | long integer. The ID of this ledger entry. |
GetAccountPositions
Category: User
Permissions: Operator, Trading, AccountReadOnly
Call Type: Synchronous
Retrieves a list of positions (balances) for a specific user account running under a specific Order Management System. The trading day runs from UTC Midnight to UTC Midnight.
Users with Trading or AccountReadOnly permission must specify an account ID with which they're associated on the Order Management System. Users with Operator permission can specify other accounts.
Request
{
"AccountId":4,
"OMSId": 1
}
| Key | Value |
|---|---|
| AccountId | integer. The ID of the authenticated user’s account on the Order Management System for which positions will be returned. |
| OMSId | integer. The ID of the Order Management System to which the user belongs. A user will belong only to one OMS. |
Response
[
{
"omsId":1,
"accountId":4,
"productSymbol":"BTC",
"productId":1,
"amount":0.0,
"hold":0.0,
"pendingDeposits":0.0,
"pendingWithdraws":0.0,
"totalDayDeposits":0.0,
"totalMonthDeposits":0.0,
"totalYearDeposits":0.0,
"totalYearDepositNotional":0.0,
"totalDayWithdraws":0.0,
"totalMonthWithdraws":0.0,
"totalYearWithdraws":0.0,
"totalYearWithdrawNotional":0.0
},
{
"omsId":1,
"accountId":4,
"productSymbol":"USD",
"productId":2,
"amount":0.0,
"hold":0.0,
"pendingDeposits":0.0,
"pendingWithdraws":0.0,
"totalDayDeposits":0.0,
"totalMonthDeposits":0.0,
"totalYearDeposits":0.0,
"totalYearDepositNotional":0.0,
"totalDayWithdraws":0.0,
"totalMonthWithdraws":0.0,
"totalYearWithdraws":0.0,
"totalYearWithdrawNotional":0.0
}
]
The response returns an array of one or more positions for the account. This example response has returned two positions.
| Key | Value |
|---|---|
| omsId | Integer. The ID of the Order Management System (OMS) to which the user belongs. A user will only ever belong to one Order Management System. Note the change in capitalization from the request. |
| accountId | integer. Returns the ID of the user’s account to which the positions belong. Note the change in capitalization from the request. |
| productSymbol | string. The symbol of the product on this account’s side of the trade. For
example: BTC — BitCoin USD — US Dollar NZD — New Zealand Dollar Many other values are possible depending on the nature of the trading venue. |
| productId | integer. The ID of the product being traded. The system assigns product IDs as they are entered into the system. Use GetProduct to return information about the product by its ID. |
| amount | real. Unit amount of the product; for example, 10 or 138.5. |
| hold | real. Amount of currency held and not available for trade. A pending trade of 100 units at $1 each will reduce the amount in the account available for trading by $100 and produce a $100 hold. Amounts on hold cannot be withdrawn while a trade is pending. |
| pendingDeposits | real. Deposits accepted but not yet cleared for trade. |
| pendingWithdraws | real. Withdrawals acknowledged but not yet cleared from the account. Amounts in PendingWithdraws are not available for trade. |
| totalDayDeposits | real. Total deposits on today’s date. The trading day runs between UTC Midnight and UTC Midnight. |
| totalMonthDeposits | real. Total deposits for the month as of today's date. |
| totalYearDeposits | real. Total deposits for the year as of today's date. |
| totalYearDepositNotional | real. Yearly amount for deposit of crypto-currencies. It is usually calculated
as value = (Amount * Bid/Ask Price). 10 BitCoin each at $6700 equals $67000. |
| totalDayWithdraws | real. Total withdrawals on today’s date. The trading day runs between UTC Midnight and UTC Midnight. |
| totalMonthWithdraws | real. Total withdrawals during this month to date. The trading day runs between UTC Midnight and UTC Midnight — likewise a month begins at UTC Midnight on the first day of the month. |
| totalYearWithdraws | real. Total withdrawals during the current year to date. |
| totalYearWithdrawNotional | real. Yearly withdrawals for crypto-currencies. It is usually calculated as value = (Amount * Bid/Ask Price). 10 BitCoin each at $6700 equals $67000. |
GetLedgerEntriesByAccount
Category: User
Permissions: Operator
Call Type: Synchronous
Retrieves an array of an account's ledger entries by account ID.
Request
{
"AccountId": 1
}
| Key | Value |
|---|---|
| AccountId | integer. The ID of the account whose ledger entries you want to retrieve. |
Response
[
{
"accountId":0,
"productId":0,
"cR_Amt":0.0,
"dR_Amt":0.0,
"enteredBy":0,
"comments":null,
"oneSidedTransaction":0,
"accountLedgerEntryId":0
}
]
The response consists of an array, each element describing a ledger entry.
| Key | Value |
|---|---|
| accountId | integer. The ID of the account into which the ledger entry was made. |
| productId | integer. The ID of the product being credited or debited to the account. |
| cR_Amt | real. Credit amount. Funds entering the account. |
| dR_Amt | real. Debit amount. Funds leaving the account. |
| enteredBy | integer. The ID of the person who made the ledger entry. |
| comments | string. Any comment made on the ledger entry. |
| oneSidedTransaction | byte. Used for a manual entry when the user must make either a deposit or a withdrawal entry. |
| accountLedgerEntryId | long integer. The ID of the ledger entry for the account. |
GetTreasuryProductsForAccount
Category: User
Permissions: Operator, Trading, Withdraw,
Deposit
Call Type: Synchronous
Returns a list of product symbols (BTC, USD, etc.) upon which the account named by AccountId is allowed to execute treasury operations.
Users with Trading, Withdraw, and Deposit permission must be associated with the account named by AccountId. Users with Operator permission can request the list of treasury products for any account.
Request
{
"AccountId": 1,
"OMSId": 1
}
| Key | Value |
|---|---|
| AccountId | integer. The ID of the account whose permitted treasury products will be returned. |
| OMSId | integer. The ID of the Order Management System where the account operates. |
Response
An array of code symbol lists.
[ { "LTC", "BTC", "USD" }, ]
The response returns an array of code symbol lists.
ScheduleTradeActivityReport
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Schedules a series of trade activity reports to run for a list of accounts on a single Order Management System, starting at a specific date/time, and covering a specific time duration. The reports will run periodically until canceled.
Users with Trading permission can schedule reports for accounts with which they are associated; users with Operator permissions can schedule reports for any accounts.
Trade Activity Reports are delivered in comma-separated-value (CSV) format. For specific CSV formatting information, see the APEX Extract CSV Data Dictionary, available from Bitazza.
Request
{
"frequency": {
"Options": [
"OnDemand", // 0
"Hourly", // 1
"Daily", // 2
"Weekly", // 3
"Monthly", // 4
"Annual" // 5
]
},
"accountIdList":[1],
"omsId":1,
"beginTime":"2018-08-10T04:00:00.000Z",
"intervalDuration":10
}
| Key | Value |
|---|---|
| frequency | integer. How often the report will run. One of: 0 OnDemand 1 Hourly 2 Daily 3 Weekly 4 Monthly 5 Annually |
| accountIdList | integer array. Comma-separated integers; each element an account ID on the Order Management System whose trade activity will be reported on. All accounts must be from the same OMS. |
| omsId | integer. The ID of the Order Management System on which the accounts named in the list reside. |
| beginTime | string. The time at which the periodic reports begin; the day and time when you want reporting to start, in Microsoft Ticks format. |
| intervalDuration | integer. The length of time prior to the run time that the report covers, in days. For example, 90 for 90 days. Whatever the report's frequency, it looks back 90 days. A monthly report, for example, would look back 90 days; an annual report would look back 90 days. |
Response
{
"RequestingUser":1,
"OMSId":1,
"reportFlavor": { // enumerated string
"Options": [
"TradeActivity",
"Transaction",
"Treasury"
]
},
"createTime":"2018-08-17T17:57:51Z",
"initialRunTime":"2018-08-10T04:00:00Z",
"intervalStartTime":"2018-08-10T04:00:00Z",
"intervalEndTime":"2018-08-10T05:00:00Z",
"RequestStatus": { // enumerated string
"Options": [
"Submitted",
"Validating",
"Scheduled",
"InProgress",
"Completed",
"Aborting",
"Aborted",
"UserCancelled",
"SysRetired",
"UserCancelledPending"
]
},
"ReportFrequency": { // enumerated string
"Options": [
"onDemand",
"Hourly",
"Daily",
"Weekly",
"Monthly",
"Annually"
]
},
"intervalDuration":36000000000,
"RequestId":"mGzjUfylGEmqgJIxu651aQ==",
"lastInstanceId":"AAAAAAAAAAAAAAAAAAAAAA==",
"accountIds":[1]
}
The response returns an object confirming the settings in the call.
| Key | Value |
|---|---|
| RequestingUser | integer. The User ID of the person requesting the trade activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response. |
| OMSId | integer. The ID of the Order Management System on which the trade activity report will be run. |
| reportFlavor | enumerated string. The type of report to be generated. One
of: TradeActivity Transaction Treasury The reportFlavor string confirms the nature of the call. |
| createTime | string. The time and date on which the request for the trade activity report was made, in Microsoft Ticks format. |
| initialRunTime | string. The time and date at which the trade activity report was first run, in Microsoft Ticks format. |
| intervalStartTime | string. The start of the period that the report will cover, in Microsoft Ticks format. |
| intervalEndTime | string. The end of the period that the report will cover, in Microsoft Ticks format. |
| RequestStatus | enumerated string. The status of the request for the trade activity report. Each
request returns one
of: Submitted Validating Scheduled InProgress Completed Aborting Aborted UserCancelled SysRetired UserCancelledPending |
| ReportFrequency | enumerated string. When the report
runs: OnDemand Hourly Daily Weekly Monthly Annually |
| intervalDuration | long integer. The period that the report covers relative to the run date, in POSIX
format. The call specifies a start time and an intervalDuration. For example, say that you schedule a weekly report with a 90-day intervalDuration value. intervalDuration represents the backward-looking period of the report. When the report runs again in a week’s time, it again looks back 90 days — but now those 90 days are offset by a week from the first report. |
| RequestId | string. The ID of the original request. Request IDs are long strings unique within the Order Management System. |
| lastInstanceId | string. For scheduled reports, the report ID of the most recent previously run report. |
| accountIds | integer array. A comma-delimited array of account IDs whose trades are reported in the trade activity report. |
ScheduleTransactionActivityReport
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Schedules a series of transaction activity reports for a list of accounts on a single Order Management System, starting at a specific date/time, and covering a specific time interval (90 days, for example). The reports run periodically until canceled.
Users with Trading permission can schedule transaction activity reports only for accounts with which they are associated; users with Operator permission can schedule transaction activity reports for any account.
Transaction Activity Reports are delivered in comma-separated-value (CSV) format. For specific CSV formatting information, see the APEX Extract CSV Data Dictionary, available from Bitazza.
Request
{
"frequency": 0,
"accountIdList": [1],
"omsId": 1,
"beginTime": "2018-08-10T04:00:00.000Z",
"intervalDuration": 10
}
| Key | Value |
|---|---|
| frequency | integer: How often the report will run. Expressed as an integer that maps to this
list: 0 OnDemand 1 Hourly 2 Daily 3 Weekly 4 Monthly 5 Annually |
| accountIdList | integer array. Comma-separated integers; each element is an account ID whose transaction activity will be reported on. All accounts must be from the same OMS. |
| omsId | integer. The Order Management System on which the accounts named in the list reside. |
| beginTime | string. The time from which the transaction activities will be reported, in Microsoft Ticks format. |
| intervalDuration | integer. The length of time prior to the run time that the report covers, in days. For example, 90 means 90 days. Whenever the report runs, it looks back 90 days. |
Response
{
"RequestingUser": 1,
"OMSId": 1,
"reportFlavor": "Transaction",
"createTime": "2018-08-17T18:02:23Z",
"initialRunTime": "2018-08-10T04:00:00Z",
"intervalStartTime": "2018-08-10T04:00:00Z",
"intervalEndTime": "2018-08-10T05:00:00Z",
"RequestStatus": "Submitted",
"ReportFrequency": "Hourly",
"intervalDuration": 36000000000,
"RequestId": "I2nCtvyY8UuHsoSyrLe2QA==",
"lastInstanceId": "AAAAAAAAAAAAAAAAAAAAAA==",
"accountIds": [1]
}
Similar objects are returned for Generate~Report and Schedule~Report calls.
| Key | Value |
|---|---|
| RequestingUser | integer. The User ID of the person requesting the transaction activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response. |
| OMSId | integer. The ID of the Order Management System on which the transaction activity report will be run. |
| reportFlavor | string. The type of report to be generated. One
of: TradeActivity Transaction Treasury The reportFlavor string confirms the nature of the call. |
| createTime | string. The time and date on which the request for the transaction activity report was made, in Microsoft Ticks format. |
| initialRunTime | string. The time and date at which the transaction activity report was first run, in Microsoft Ticks format. |
| intervalStartTime | string. The start of the period that the report will cover, in Microsoft Ticks format. |
| intervalEndTime | string. The end of the period that the report will cover, in Microsoft Ticks format. |
| requestStatus | string. The status of the request for the transaction activity report. Each request
returns one
of: Submitted Validating Scheduled InProgress Completed Aborting Aborted UserCancelled SysRetired UserCancelledPending |
| ReportFrequency | string. When the report
runs: OnDemand Hourly Daily Weekly Monthly Annually |
| intervalDuration | long integer. The period that the report covers relative to the run date, in POSIX format. For example, say that you schedule a weekly report with a 90-day intervalDuration value. intervalDuration represents the backward-looking period of the report. When the report runs again in a week’s time, it again looks back 90 days — but now those 90 days are offset by a week from the first report. |
| RequestId | string. The ID of the original request. Request IDs are long strings unique within the Order Management System. |
| lastInstanceId | string. For scheduled reports, the report ID of the most recent previously run report. |
| accountIds | integer array. A comma-delimited array of account IDs whose trades are reported in the trade activity report. |
ScheduleTreasuryActivityReport
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Schedules a series of treasury activity reports for a list of accounts on a single Order Management System, starting at a specific date/time, and covering a specific time interval. Treasury activities are non-trading transactions such as deposits and withdrawals. The reports runs periodically until canceled.
A user with Trading permission may schedule reports only for accounts with which he is associated; a user with Operator permission may schedule reports for any accounts.
The Treasury Activity Report itself is delivered as a comma-separated-value (CSV) file. For specific CSV formatting information, see the APEX Extract CSV Data Dictionary, available from Bitazza.
Request
{
"frequency":0,
"accountIdList":[1],
"omsId":1,
"beginTime":"2018-08-10T04:00:00.000Z",
"intervalDuration":10
}
| Key | Value |
|---|---|
| frequency | integer. How often the report will run. A number represents one of: 0 OnDemand 1 Hourly 2 Daily 3 Weekly 4 Monthly 5 Annually |
| accountIdList | integer array. Comma-separated integers; each element is an account ID whose treasury activity will be reported on. All accounts must be from the same OMS. |
| omsId | integer. The Order Management System on which the accounts named in the list reside. |
| beginTime | string. The time from which the treasury activities will be reported, in Microsoft Ticks format. |
| intervalDuration | integer. The length of time prior to the run time that the report covers. For example, 90 days. Whenever the report runs, it looks back 90 days. |
Response
{
"RequestingUser":1,
"OMSId":1,
"reportFlavor":"Treasury",
"createTime":"2018-08-17T18:02:03Z",
"initialRunTime":"2018-08-10T04:00:00Z",
"intervalStartTime":"2018-08-10T04:00:00Z",
"intervalEndTime":"2018-08-10T05:00:00Z",
"RequestStatus":"Submitted",
"ReportFrequency":"Hourly",
"intervalDuration":36000000000,
"RequestId":"xbsVgAuUcEyTFgf/gpWB2A==",
"lastInstanceId":"AAAAAAAAAAAAAAAAAAAAAA==",
"accountIds":[1]
}
Similar objects are returned for Generate~Report and Schedule~Report calls.
| Key | Value |
|---|---|
| RequestingUser | integer. The User ID of the person requesting the treasury activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response. |
| OMSId | integer. The ID of the Order Management System on which the treasury activity report will be run. |
| reportFlavor | string. The type of report to be generated. One
of: TradeActivity Transaction Treasury The reportFlavor string confirms the nature of the call. |
| createTime | string. The time and date on which the request for the treasury activity report was made, in Microsoft Ticks format. |
| initialRunTime | string. The time and date at which the treasury activity report was first run, in Microsoft Ticks format. |
| intervalStartTime | string. The start of the period that the report will cover, in Microsoft Ticks format. |
| intervalEndTime | string. The end of the period that the report will cover, in Microsoft Ticks format. |
| requestStatus | string. The status of the request for the treasury activity report. One
of: Submitted Validating Scheduled InProgress Completed Aborting Aborted UserCancelled SysRetired UserCancelledPending |
| ReportFrequency | string. When the report runs. Note that frequency in the request is an
integer; but ReportFrequency in the response is a
string. OnDemand Hourly Daily Weekly Monthly Annually |
| intervalDuration | long integer. The period that the report covers relative to the run date, in POSIX
format. For example, say that you schedule a weekly report with a 90-day intervalDuration value. intervalDuration represents the backward-looking period of the report. When the report runs again in a week’s time, it again looks back 90 days — but now those 90 days are offset by a week from the first report. |
| RequestId | string. The ID of the original request. Request IDs are long strings unique within the Order Management System. |
| lastInstanceId | string. For scheduled reports, the report ID of the most recent previously run report. |
| accountIds | integer array. A comma-delimited array of account IDs whose trades are reported in the trade activity report. |
Trades
These calls correspond roughly to the Trades function of the Exchange Admin and Admin Guide.
GetAccountTrades
Category: User
Permissions: Operator, Trading,
AccountReadOnly
Call Type: Synchronous
Requests the details on up to 200 past trade executions for a single specific account and Order Management System, starting at index i, where i is an integer identifying a specific execution in reverse order; that is, the most recent execution has an index of 0, and increments by one as trade executions recede into the past.
Users with Trading or AccountReadOnly permission may access trade information only for accounts with which they are associated; users with Operator permission may access trade information for any account.
The operator of the trading venue determines how long to retain an accessible trading history before archiving.
Request
{
"OMSId": 0,
"AccountId":0,
"StartIndex":0,
"Count":0
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System to which the user belongs. A user will belong to only one OMS. |
| AccountId | integer. The ID of the account. |
| StartIndex | integer. The starting index into the history of trades, beginning from 0 (the most recent trade). |
| Count | integer. The number of trades to return. The system can return up to 200 trades. |
Response
[
{
"OMSId": 0,
"ExecutionId": 0,
"TradeId": 0,
"OrderId": 0,
"AccountId": 0,
"AccountName": "",
"SubAccountId": 0,
"ClientOrderId": 0,
"InstrumentId": 0,
"Side": "Buy",
"OrderType": "Limit"
"Quantity": 0.0,
"RemainingQuantity": 0.0,
"Price": 0.0,
"Value": 0.0,
"CounterParty": "",
"OrderTradeRevision": 0,
"Direction": 0,
"IsBlockTrade": false,
"Fee": 0.0,
"FeeProductId": 0,
"OrderOriginator": 0,
"UserName": "",
"TradeTimeMS": 0,
"MakerTaker": "Maker",
"AdapterTradeId": 0,
"InsideBid": 0,
"InsideBidSize": 0,
"InsideAsk": 0,
"InsideAskSize": 0,
"IsQuote": 0,
"TradeTime": 0
},
]
The response is an array of objects, each element of which represents the account’s side of a trade (either buy or sell).
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System to which the account belongs. |
| ExecutionId | integer. The ID of this account's side of the trade. Every trade has two sides. |
| TradeId | integer. The ID of the overall trade. |
| OrderId | long integer. The ID of the order causing the trade (buy or sell). |
| AccountId | integer. The ID of the account that made the trade (buy or sell). |
| AccountName | string. The Name of the account that made the trade (buy or sell). |
| SubAccountId | integer. Not currently used; reserved for future use. Defaults to 0. |
| ClientOrderId | integer. An ID supplied by the client to identify the order (like a purchase order number). The clientOrderId defaults to 0 if not supplied. |
| InstrumentId | integer. The ID of the instrument being traded. An instrument comprises two products, for example Dollars and BitCoin. |
| Side | string. One of the following potential sides of a trade: 0 Buy 1 Sell 2 Short 3 Unknown (an error condition) |
| OrderType | string. One of the following potential sides of a trade:
Market Limit BlockTrade StopMarket StopLimit TrailingStopLimit StopMarket TrailingStopMarket |
| Quantity | real. The unit quantity of this side of the trade. |
| RemainingQuantity | real. The number of units remaining to be traded by the order after this execution. This number is not revealed to the other party in the trade. This value is also known as "leave size" or "leave quantity." |
| Price | real. The unit price at which the instrument traded. |
| Value | real. The total value of the deal. The system calculates this as: unit price X quantity executed. |
| CounterParty | string. The ID of the other party in a block trade. Usually, IDs are stated as integers; this value is an integer written as a string. |
| OrderTradeRevision | integer. The revision number of this trade; usually 1. |
| Direction | integer. The effect of the trade on the instrument's market price. One
of: 0 No change 1 Uptick 2 DownTick |
| IsBlockTrade | Boolean. A value of true means that this trade was a block trade; a value of false that it was not a block trade. |
| Fee | real. Any fee levied against the trade by the Exchange. |
| FeeProductId | integer. The ID of the product in which the fee was levied. |
| OrderOriginator | integer. The ID of the user who initiated the trade. |
| UserName | integer. The UserName of the user who initiated the trade. |
| TradeTimeMS | long integer. The date and time that the trade took place, in milliseconds and POSIX format. All dates and times are UTC. |
| MakerTaker | string. One of the following potential liquidity provider of a trade:
Maker Taker |
| AdapterTradeId | integer. The ID of the adapter of the overall trade. |
| InsideBid | real. The best (highest) price level of the buy side of the book at the time of the trade. |
| InsideBidSize | real. The quantity of the best (highest) price level of the buy side of the book at the time of the trade. |
| InsideAsk | real. The best (lowest) price level of the sell side of the book at the time of the trade. |
| InsideAskSize | real. The quantity of the best (lowest) price level of the sell side of the book at the time of the trade. |
| TradeTime | long integer. The date and time that the trade took place, in C# Ticks. All dates and times are UTC. |
GetAccountTransactions
Category: User
Permissions: Trading, AccountReadOnly
Call Type: Synchronous
Returns a list of transactions for a specific account on an Order Management System. The owner of the trading venue determines how long to retain order history before archiving. The caller must be associated with the account named in AccountId.
Request
{
"OMSId": 1,
"AccountId": 1,
"Depth": 200
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System from which the account’s transactions will be returned. |
| AccountId | integer. The ID of the account for which transactions will be returned. If not specified, the call returns transactions for the default account for the logged-in user. |
| Depth | integer. The number of transactions that will be returned, starting with the most recent transaction. |
Response
[
{
"transactionId":0,
"omsId":0,
"accountId":0,
"cr":0.0,
"dr":0.0,
"counterparty":0,
"transactionType":0,
"referenceId":0,
"referenceType":0,
"productId":0,
"balance":0.0,
"timeStamp":0
},
]
The response returns an array of transaction objects. Note capitalization changes from the request.
| Key | Value |
|---|---|
| transactionId | Integer. The ID of the transaction. |
| omsId | Integer. The ID of the Order Management System under which the requested transactions took place. |
| accountId | Integer. The single account under which the transactions took place. |
| cr | real. Credit entry for the account on the order book. Funds entering an account. |
| dr | real. Debit entry for the account on the order book. Funds leaving an account. |
| counterparty | long integer. The corresponding party in a trade. |
| transactionType | integer. A number representing the type of transaction: 1 Fee 2 Trade 3 Other 4 Reverse 5 Hold 6 Rebate 7 MarginAcquisition 8 MarginRelinquish |
| referenceId | long integer. The ID of the action or event that triggered this transaction. |
| referenceType | integer. A number representing the type of action or event that triggered this
transaction. One of: 1 Trade 2 Deposit 3 Withdraw 4 Transfer 5 OrderHold 6 WithdrawHold 7 DepositHold 8 MarginHold 9 ManualHold 10 ManualEntry 11 MarginAcquisition 12 MarginRelinquish 13 MarginQuoteHold |
| productId | integer. The ID of the product on this account’s side of the transaction. For example, in a dollars-for-BitCoin transaction, one side will have the product Dollar and the other side will have the product BitCoin. Use GetProduct to return information about a product based on its ID. |
| balance | real. The balance in the account after the transaction. |
| timeStamp | long integer. Time at which the transaction took place, in POSIX format. |
GetOpenTradeReports
Category: User
Permissions: Operator, Trading,
AccountReadOnly
Call Type: Synchronous
Retrieves an array of open trade information for the account named in AccountId.
Users with Trading or AccountReadOnly permission must be associated with the named account; users with Operator permission can retrieve open trade reports on any account.
Request
{
"OMSId": 1,
"AccountId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the account operates. |
| AccountId | integer. The ID of the account whose open trade information will be returned. |
Response
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0.0,
"QuantityExecuted": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0.0,
"InsideAskSize": 0.0,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
},
]
The call GetOpenTradeReports returns an array containing all four types of orders for the named account. The call returns an empty array if there are no open trades for the account.
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell 2 Short 3 Unknown (an error condition) |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each Order Management System. |
| Price | real. The price at which the buy or sell has been ordered. |
| Quantity | real. The quantity of the product to be bought or sold. |
| DisplayQuantity | real. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| orderType | string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| ClientOrderId | integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 Fully Executed. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format. |
| ReceiveTimeTicks | long integer. Time stamp of the order in POSIX format. |
| OrigQuantity | real. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | real. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| AvgPrice | real. The average executed price for the instrument in the order. |
| CounterPartyId | integer. The ID of the other party in an off-market trade. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One
of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified |
| OrigOrderId | integer. If the order has been changed, this is the ID of the original order. |
| OrigClOrdId | integer. If the order has been changed, this is the ID of the original client order ID. |
| EnteredBy | integer. The user ID of the person who entered the order. |
| IsQuote | Boolean. If this order is a quote, the value for IsQuote is true, else false. |
| InsideAsk | real. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | real. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | real. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | real. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | real. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | Boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancelation reason. |
| OMSId | integer. The ID of the Order Management System on which the order took place. |
GetTickerHistory
Category: User
Permissions: Public
Call Type: Synchronous
Requests a ticker history (high, low, open, close, volume, bid, ask, ID) of a specific instrument from a given date to the present. You will need to format the returned data per your requirements.
Because permission is Public, any user can retrieve the ticker history for any instrument on the OMS.
Request
{
"InstrumentId": 1,
"Interval": 60,
"FromDate": "2018-07-18",
"ToDate": "2018-07-19",
"OMSId":1
}
| Key | Value |
|---|---|
| InstrumentId | integer. The ID of a specific instrument. The current Order Management System is assumed. |
| Interval | integer. The time between ticks, in seconds. For example, a value of 60 returns ticker array elements between FromDate to ToDate in 60-second increments. |
| FromDate | string. Oldest date from which the ticker history will start, in Micrisoft Ticks format. The report moves toward ToDate from this point. |
| ToDate | string. Most recent date, at which the ticker history will end, in Microsoft Ticks format. |
| OMSId | integer. The ID of the Order Management System where the ticker history comes from. |
Response
The response is an array of arrays of comma-separated, but unlabeled, numbers. This sample shows comments applied to identify the data being returned (comments are not part of the response; the second array shows how the data actually is reported):
[
[
1501603632000, \\DateTime - UTC - Milliseconds since 1/1/1970 - POSIX format
2700.33, \\High
2687.01, \\Low
2687.01, \\Open
2687.01, \\Close
24.86100992, \\Volume
0, \\Inside Bid Price
2870.95, \\Inside Ask Price
1 \\InstrumentId
],
[1501604532000,2792.73,2667.95,2687.01,2700.81,242.61340767,0,2871,0],
]
The response returns an array of arrays dating from the FromDate value of the request to the ToDate. The data are returned oldest-date first. The data returned in the arrays are not labeled.
GetTradesHistory
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Retrieves a list of trades for a specified account, order ID, user, instrument, or starting and ending time stamp. The returned list begins at start index i, where i is an integer identifying a specific trade in reverse order; that is, the most recent trade has an index of 0. “Depth” is the count of trades to report backwards from StartIndex.
Users with Trading permission can retrieve trade history for accounts with which they are associated; users with Operator permission can retrieve trade history for any account.
Request
All values in the request other than omsId are optional.
{
"omsId": 0,
"accountId": 0,
"instrumentId": 0,
"tradeId": 0,
"orderId": 0,
"userId": 0,
"startTimestamp": 0,
"endTimestamp": 0,
"depth": 100,
"startIndex": 0,
"executionId": 0
}
| Key | Value |
|---|---|
| omsId | Integer. The ID of the Order Management System on which the trades took place. If no other values are specified, GetTradesHistory returns the trades associated with the default account for the logged-in user on this Order Management System. Required key and value. |
| accountId | Integer. The account ID that made the trades. If no account ID is supplied, the system assumes the default account for the logged-in user making the call. |
| instrumentId | long integer. The ID of the instrument whose trade history is reported. If no instrument ID is included, the system returns trades for all instruments associated with the account ID and OMS. |
| tradeId | integer. The ID of a specific trade. If you specify TradeId, GetTradesHistory can return all states for a single trade. |
| orderId | integer. The ID of the order resulting in the trade. If specified, the call returns all trades associated with the order. |
| userId | integer. The ID of the logged-in user. If not specified, the call returns trades associated with the users belonging to the default account for the logged-in user of this OMS. |
| startTimeStamp | long integer. The historical date and time at which to begin the trade report, in POSIX format. If not specified, reverts to the start date of this account on the trading venue. |
| endTimeStamp | long integer. Date at which to end the trade report, in POSIX format. |
| depth | integer. In this case, the count of trades to return, counting from the StartIndex. If Depth is not specified, returns all trades between BeginTimeStamp and EndTimeStamp, beginning at StartIndex. |
| startIndex | integer. The starting index into the history of trades, from 0 (the most recent trade) and moving backwards in time. If not specified, defaults to 0. |
| executionId | integer. The ID of the individual buy or sell execution. If not specified, returns all. |
Response
[
{
"OMSId": 0,
"ExecutionId": 0,
"TradeId": 0,
"OrderId": 0,
"AccountId": 0,
"AccountName": "",
"SubAccountId": 0,
"ClientOrderId": 0,
"InstrumentId": 0,
"Side": "Buy",
"OrderType": "Limit"
"Quantity": 0.0,
"RemainingQuantity": 0.0,
"Price": 0.0,
"Value": 0.0,
"CounterParty": "",
"OrderTradeRevision": 0,
"Direction": 0,
"IsBlockTrade": false,
"Fee": 0.0,
"FeeProductId": 0,
"OrderOriginator": 0,
"UserName": "",
"TradeTimeMS": 0,
"MakerTaker": "Maker",
"AdapterTradeId": 0,
"InsideBid": 0,
"InsideBidSize": 0,
"InsideAsk": 0,
"InsideAskSize": 0,
"IsQuote": 0,
"TradeTime": 0
},
]
The response is an array of objects, each element of which represents the account’s side of a trade (either buy or sell).
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System to which the account belongs. |
| ExecutionId | integer. The ID of this account's side of the trade. Every trade has two sides. |
| TradeId | integer. The ID of the overall trade. |
| OrderId | long integer. The ID of the order causing the trade (buy or sell). |
| AccountId | integer. The ID of the account that made the trade (buy or sell). |
| AccountName | string. The Name of the account that made the trade (buy or sell). |
| SubAccountId | integer. Not currently used; reserved for future use. Defaults to 0. |
| ClientOrderId | integer. An ID supplied by the client to identify the order (like a purchase order number). The clientOrderId defaults to 0 if not supplied. |
| InstrumentId | integer. The ID of the instrument being traded. An instrument comprises two products, for example Dollars and BitCoin. |
| Side | string. One of the following potential sides of a trade: 0 Buy 1 Sell 2 Short 3 Unknown (an error condition) |
| OrderType | string. One of the following potential sides of a trade:
Market Limit BlockTrade StopMarket StopLimit TrailingStopLimit StopMarket TrailingStopMarket |
| Quantity | real. The unit quantity of this side of the trade. |
| RemainingQuantity | real. The number of units remaining to be traded by the order after this execution. This number is not revealed to the other party in the trade. This value is also known as "leave size" or "leave quantity." |
| Price | real. The unit price at which the instrument traded. |
| Value | real. The total value of the deal. The system calculates this as: unit price X quantity executed. |
| CounterParty | string. The ID of the other party in a block trade. Usually, IDs are stated as integers; this value is an integer written as a string. |
| OrderTradeRevision | integer. The revision number of this trade; usually 1. |
| Direction | integer. The effect of the trade on the instrument's market price. One
of: 0 No change 1 Uptick 2 DownTick |
| IsBlockTrade | Boolean. A value of true means that this trade was a block trade; a value of false that it was not a block trade. |
| Fee | real. Any fee levied against the trade by the Exchange. |
| FeeProductId | integer. The ID of the product in which the fee was levied. |
| OrderOriginator | integer. The ID of the user who initiated the trade. |
| UserName | integer. The UserName of the user who initiated the trade. |
| TradeTimeMS | long integer. The date and time that the trade took place, in milliseconds and POSIX format. All dates and times are UTC. |
| MakerTaker | string. One of the following potential liquidity provider of a trade:
Maker Taker |
| AdapterTradeId | integer. The ID of the adapter of the overall trade. |
| InsideBid | real. The best (highest) price level of the buy side of the book at the time of the trade. |
| InsideBidSize | real. The quantity of the best (highest) price level of the buy side of the book at the time of the trade. |
| InsideAsk | real. The best (lowest) price level of the sell side of the book at the time of the trade. |
| InsideAskSize | real. The quantity of the best (lowest) price level of the sell side of the book at the time of the trade. |
| TradeTime | long integer. The date and time that the trade took place, in C# Ticks. All dates and times are UTC. |
OMS Orders
These calls correspond roughly to the OMS Orders function of the Exchange Admin and Admin Guide.
CancelAllOrders
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Cancels all open matching orders for the specified account on an Order Management System.
A user with Trading permission can cancel orders for himselfd; a user with Operator permissions can cancel orders for any account, instrument, or user.
Request
{
"AccountId": 0,
"OMSId": 0
}
| Key | Value |
|---|---|
| AccountId | integer. The account for which all orders are being canceled. Conditionally optional. |
| OMSId | integer. The Order Management System under which the account operates. Required. |
Response
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": ""
}
The Response is a standard response object.
| Key | Value |
|---|---|
| result | Boolean. If the call has been successfully received by the Order Management System, result is true; otherwise it is false. |
| errormsg | string. A successful receipt of the call returns null. The errormsg
key for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. |
CancelOrder
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Cancels an open order that has been placed but has not yet been fully executed.
A user with Trading permission can cancel an order only for an account with which he is associated; a user with Operator permission can cancel an order for any account.
Request
{
"OMSId": 0,
"AccountId": 0, // conditionally optional
"ClientOrderId": 0, // conditionally optional
"OrderId": 0, // conditionally optional
}
The OMS ID and the Order ID precisely identify the order you wish to cancel. The Order ID is unique across an OMS.
If you specify the OMS ID and the Account ID, you must also specify at least the Client Order ID. The OMS is unable to identify the order using only the OMS ID and the Client Order ID, as the Client Order ID may not be unique.
| Key | Value |
|---|---|
| OMSId | integer. The Order Management System on which the order exists. Required. |
| AccountId | integer. The ID of the account under which the order was placed. Conditionally optional. |
| ClientOrderId | long integer. A user-assigned ID for the order (like a purchase-order number assigned by a company). ClientOrderId defaults to 0. Conditionally optional. |
| OrderId | long integer. The order to be canceled. Conditionally optional. |
Response
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}
The response to CancelOrder verifies that the call was received, not that the order has been canceled successfully. Individual event updates to the user show order cancellation. To verify that an order has been canceled, call GetOrderStatus or GetOpenOrders.
| Key | Value |
|---|---|
| result | Boolean. Returns true if the call to cancel the order has been successfully received, otherwise returns false. |
| errormsg | string. A successful receipt of a call to cancel an order returns null; the
errormsg parameter for an unsuccessful call to cancel an order returns one of the following
messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successfully received call to cancel an order returns 0. An unsuccessfully received call to cancel an order returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. The contents of this parameter are usually null. |
CancelQuote
Category: User
Permissions: Operator, Marketmaker
Call Type: Synchronous
Cancels a quote that has not been executed yet.
Request
{
"omsId": 0,
"accountId": 0,
"instrumentId": 0,
"bidQuoteId": 0,
"askQuoteId": 0
}
You must identify the quote to be canceled by both BidQuoteId and AskQuoteId, which were supplied by the system when the quote was created. You can optionally identify the canceled quote using AccountId and InstrumentId. If the call does not include AccountId, the call assumes the default AccountId for the logged-in user; if the call does not include InstrumentId, the call operates on any instruments quoted by the account.
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System where the quote was requested. Required. |
| accountId | integer. The ID of the account that requested the quote. Conditionally optional. |
| instrumentId | long integer. The ID of the instrument being quoted. Conditionally optional. |
| bidQuoteId | integer. The ID of the bid quote. Required. |
| askQuoteId | integer. The ID of the ask quote. Required. |
Response
{
"BidResult": "{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}",
"AskResult": "{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}"
}
Returns two json objects, one for Bid and one for Ask.
The response to CancelQuote verifies that the call was received, not that the quote has been canceled successfully. Individual event updates to the user show quotes as they cancel. To verify that a quote has been canceled, use GetOpenQuotes.
| Key | Value |
|---|---|
| BidResult | object. Returns a response object for Bid (see below). |
| AskResult | object. Returns a response object for Ask. |
Objects for both BidResult and AskResult:
| Key | Value |
|---|---|
| result | Boolean. A successful receipt of the cancelation returns true; and unsuccessful receipt of the cancelation (an error condition) returns false. |
| errormsg | string. A successful receipt of the cancelation returns null; the
errormsg parameter for an unsuccessful receipt returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successful receipt of the cancelation returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
CancelReplaceOrder
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
CancelReplaceOrder is a single API call that both cancels an existing order and replaces it with a new order. Canceling one order and replacing it with another also cancels the order’s priority in the order book. You can use ModifyOrder to preserve priority in the book; but ModifyOrder only allows a reduction in order quantity.
Request
{
"omsId":0,
"orderIdToReplace":0,
"clientOrdId":0,
"orderType":0,
"side":0,
"accountId":0,
"instrumentId":0,
"useDisplayQuantity":false,
"displayQuantity":0.0,
"limitPrice":0.0,
"stopPrice":0.0,
"referencePrice":0.0,
"pegPriceType":0,
"timeInForce":0,
"orderIdOCO":0,
"quantity":0.0
}
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System on which the order is being canceled and replaced by another order. |
| orderIdToReplace | long integer. The ID of the order to replace with this order. |
| clientOrderId | long integer. A user-assigned ID for the new, replacement order (like a purchase-order number assigned by a company). This ID is useful for recognizing future states related to this order. If unspecified, ClientOrderId defaults to 0. |
| orderType | integer. An integer representing the type of the replacement order: 0 Unknown 1 Market 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| side | integer. An integer representing the side of the replacement order: 0 Buy 1 Sell 2 Short 3 Unknown (error condition) |
| accountId | integer. The ID of the account under which the original order was placed and the new order will be placed. |
| instrumentId | integer. The ID of the instrument being traded. |
| useDisplayQuantity | Boolean. The display quantity is the quantity of a product shown to the market to buy or sell. A larger quantity may be wanted or available, but it may disadvantageous to display it when buying or selling. The display quantity is set when placing an order (using SendOrder or CancelReplaceOrder for instance). If you enter a Limit order with reserve, you must set useDisplayQuantity to true. |
| displayQuantity | real. The quantity of a product that is available to buy or sell that is publicly displayed to the market. |
| limitPrice | real. The price at which to execute the new order, if the new order is a limit order. |
| stopPrice | real. The price at which to execute the new order, if the order is a stop order. |
| referencePrice | real. The reference price of the instrument in the order. |
| pegPriceType | integer. An integer that represents the type of price you set in a stop/trailing order
to "peg the stop." 0 Unknown (error condition) 1 Last 2 Bid 3 Ask 4 Midpoint |
| timeInForce | integer. An integer that represents the period during which the new order is
executable. One of: 0 Unknown (error condition) 1 GTC (good 'til canceled, the default) 2 OPG (execute as close to opening price as possible) 3 IOC (immediate or canceled) 4 FOK (fill or kill — fill the order immediately, or cancel it immediately) 5 GTX (good 'til executed) 6 GTD (good 'til date) |
| orderIdOCO | integer. One Cancels the Other — If the order being canceled in this call is order A, and the order replacing order A in this call is order B, then OrderIdOCO refers to an order C that is currently open. If order C executes, then order B is canceled. You can also set up order C to watch order B in this way, but that will require an update to order C. |
| quantity | real. The amount of the order (either buy or sell). |
Response
{
"replacementOrderId": 1234,
"replacementClOrdId": 1561,
"origOrderId": 5678,
"origClOrdId": 91011,
}
The response returns the new replacement order ID and echoes back any replacement client ID you have supplied, along with the original order ID and the original client order ID.
| Key | Value |
|---|---|
| replacementOrderId | integer. The order ID assigned to the replacement order by the server. |
| replacementClOrdId | long integer. Echoes the contents of the clientOrderId value from the request. |
| origOrderId | integer. Echoes orderIdToReplace, which is the original order you are replacing. |
| origClOrdId | long integer. Provides the client order ID of the original order (not specified in the requesting call). |
CreateQuote
Category: User
Permissions: Operator, MarketMaker
Call Type: Synchronous
TK call and response may change
Creates a quote. A quote expresses a willingness to buy or sell at a given price. Both a quote and an order will execute. Only a user with Operator or MarketMaker permission can create a quote.
Request
{
"OMSId": 0,
"AccountId": 0,
"InstrumentId": 0,
"Bid": 0,
"BidQty": 0,
"Ask": 0,
"AskQty": 0,
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the quote is being created. Required. |
| AccountId | integer. The ID of the account in which the quote is being created. If the call provides no AccountId, the system assumes the default account ID for the logged-in user on the OMS. |
| InstrumentId | long integer. The ID of the instrument being quoted. Required. |
| Bid | real. The bid price. Required. |
| BidQty | real. The quantity of the bid. Required. |
| Ask | real. The ask price. Required. |
| AskQty | real. The quantity of the ask. Required. |
Response
{
"BidResult": {
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
},
"AskResult": {
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}
}
| Key | Value |
|---|---|
| BidResult | object. Returns a response object for Bid (see below). |
| AskResult | object. Returns a response object for Ask. |
Objects for both BidResult and AskResult:
| Key | Value |
|---|---|
| result | Boolean. A successful receipt of the cancelation returns true; and unsuccessful receipt of the cancelation (an error condition) returns false. |
| errormsg | string. A successful receipt of the cancelation returns null; the
errormsg parameter for an unsuccessful receipt returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successful receipt of the cancelation returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
GetOpenOrders
Category: User
Permissions: Operator, Trading, AccountReadOnly
Call Type: Synchronous
Returns an array of 0 or more orders that have not yet been filled (open orders) for a single account on a specific Order Management System. The call returns an empty array if an account has no open orders.
A user with Trading or AccountReadOnly permission must be associated with the account named by AccountId; a user with Operator permissoin can get open orders for any account.
Request
{
"OMSId": 1
"AccountId":4,
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System to which the user belongs. A user will belong only to one OMS. |
| AccountId | integer. The ID of the authenticated user’s account. |
Response
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0.0,
"QuantityExecuted": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0.0,
"InsideAskSize": 0.0,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
},
]
The call GetOpenOrders returns an array containing both buy-side and a sell-side open orders for the named account. The call returns an empty array if there are no open orders for the account.
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell 2 Short 3 Unknown (an error condition) |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each Order Management System. |
| Price | real. The price at which the buy or sell has been ordered. |
| Quantity | real. The quantity of the product to be bought or sold. |
| DisplayQuantity | real. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| orderType | string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| ClientOrderId | integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 Fully Executed. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| OrigQuantity | real. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | real. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| AvgPrice | real. The average executed price for the instrument in the order. |
| CounterPartyId | integer. The ID of the other party in an off-market trade. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One
of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified |
| OrigOrderId | integer. If the order has been changed, this is the ID of the original order. |
| OrigClOrdId | integer. If the order has been changed, this is the ID of the original client order ID. |
| EnteredBy | integer. The user ID of the person who entered the order. |
| IsQuote | Boolean. If this order is a quote, the value for IsQuote is true, else false. |
| InsideAsk | real. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | real. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | real. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | real. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | real. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | Boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancelation reason. |
| OMSId | integer. The ID of the Order Management System on which the order took place. |
GetOpenQuotes
Category: User
Permissions: Operator, MarketMaker
Call
Type: Synchronous
Returns the current bid and ask quotes for a given instrument ID and account ID.
Request
{
"omsId": 0,
"accountId": 0,
"instrumentId": 0,
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System where the instrument is traded whose quote may be open. |
| AccountId | integer. The ID of the account whose open quotes will be returned. |
| InstrumentId | integer. The ID of the instrument being quoted. |
Response
{
"bid": {
"omsId": 0,
"side": 0,
"orderId": 0,
"price": 0.0,
"quantity": 0.0,
"displayQuantity": 0.0,
"instrument": 0,
"account": 0,
"orderType": 0,
"clientOrderId": 0,
"orderState": 0
},
"ask": {
"omsId": 0,
"side": 0,
"orderId": 0,
"price": 0.0,
"quantity": 0.0,
"displayQuantity": 0.0,
"instrument": 0,
"account": 0,
"orderType": 0,
"clientOrderId": 0,
"orderState": 0
}
}
Returns a JSON object comprising a bid and an ask object. Both object comprise the same key-value pairs.
| Key | Value |
|---|---|
| bid | Bid object (see below) |
| ask | Ask object (see below) |
Bid and Ask objects differ only in the values for the keys.
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System containing the open quotes. |
| side | integer. One of: 0 Buy 1 Sell 2 Short 3 Unknown (error condition) |
| orderId | long integer. The ID of this quote. Quotes and orders are both executable, but only Operators and MarketMakers may quote. |
| price | real. Price of the Bid/Ask quote. |
| quantity | real. Quantity of the Bid/Ask quote. |
| displayQuantity | real. The quantity available to buy or sell that is publicly displayed to the market. To display a DisplayQuantity value, an order must be a Limit order with a reserve. |
| instrument | integer. The ID of the instrument being quoted. |
| account | integer. The ID of the account quoting the instrument. |
| orderType | integer. A number describing the type of order (or in this case, quote). One
of: 0 Unknown 1 Market 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| cientOrderId | long integer. A user-assigned ID for the quote (like a purchase-order number assigned by a company). ClientOrderId defaults to 0. |
| orderState | integer. A number describing the current state of the order. One
of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 FullyExecuted An open quote will probably have an OrderState of Working. |
GetOrderFee
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Returns an estimate of the transaction fee for a specific order side, instrument, and order type. Fees are set and calculated by the operator of the trading venue.
The exchange generally deducts fees from the "receiving" side of the trade (although an operator can modify this). There are two products in every trade (and in every instrument); for example, the instrument BTCUSD comprises a BitCoin product and a US dollar product. Placing a buy order on the book causes fees to be deducted from Product 1, in this case, BitCoin; placing a sell order causes fees to be deducted from Product 2, in this case, US dollar.
A user with Trading permission can get fee estimates for any account that user is associated with and for any instrument or product that that account can trade; a user with Operator permission can get fee estimates for any account, instrument, or product.
Request
{
"omsId":0,
"accountId":0,
"instrumentId":0,
"productId":0,
"amount":0.0,
"price":0.0,
"orderType":0,
"makerTaker":0,
"side":0
}
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System on which the trade would take place. |
| accountId | integer. The ID of the account requesting the fee estimate. |
| instrumentId | integer. The proposed instrument against which a trading fee would be charged. |
| productId | integer. The ID of the product (currency) in which the fee will be denominated. |
| amount | real. The quantity of the proposed trade for which the Order Management System would charge a fee. |
| price | real. The price at which the proposed trade would take place. Supply your price for a limit order; the exact price is difficult to know before execution. |
| orderType | integer.. The type of the proposed order. One of: 0 Unknown 1 Market 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| makerTaker | integer. Depending on the venue, there may be different fees for a maker (one who
places the order on the books, either buy or sell) or taker (one who accepts the order, either buy or
sell). If the user places a large order that is only partially filled, he is a partial maker. 0 Unknown 1 Maker 2 Taker |
| side | integer. One of: 0 Buy 1 Sell 2 Short 3 Unknown |
Response
{
"OrderFee": 0.01,
"ProductId": 1
}
| Key | Value |
|---|---|
| OrderFee | real. The estimated fee for the trade as described. The minimum value is 0.01. |
| ProductId | integer. The ID of the product (currency) in which the fee is denominated. |
GetOrderHistory
Category: User
Permissions: Trading, AccountReadOnly
Call Type: Synchronous
Returns a complete list of all orders, both open and executed, for a specific account on the specified Order Management System. The account named in the request must be associated with the calling user.
Request
{
"OMSId": 1,
"AccountId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System where the orders were placed. |
| AccountId | integer. The ID of the account whose orders will be returned |
Response
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0.0,
"QuantityExecuted": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0.0,
"InsideAskSize": 0.0,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
},
]
The call GetOrderHistory returns an array containing both buy-side and a sell-side orders for the named account. The call returns an empty array if there are no open orders for the account.
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell 2 Short 3 Unknown (an error condition) |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each Order Management System. |
| Price | real. The price at which the buy or sell has been ordered. |
| Quantity | real. The quantity of the product to be bought or sold. |
| DisplayQuantity | real. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| orderType | string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| ClientOrderId | integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 Fully Executed. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| OrigQuantity | real. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | real. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| AvgPrice | real. The average executed price for the instrument in the order. |
| CounterPartyId | integer. The ID of the other party in an off-market trade. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One
of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified |
| OrigOrderId | integer. If the order has been changed, this is the ID of the original order. |
| OrigClOrdId | integer. If the order has been changed, this is the ID of the original client order ID. |
| EnteredBy | integer. The user ID of the person who entered the order. |
| IsQuote | Boolean. If this order is a quote, the value for IsQuote is true, else false. |
| InsideAsk | real. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | real. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | real. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | real. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | real. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | Boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancelation reason. |
| OMSId | integer. The ID of the Order Management System on which the order took place. |
GetOrderHistoryByOrderId
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Retrieves the full order history of a specific order by its order ID, including any changes.
A user with Trading permission can retrieve an order history only for the user's accounts and instruments; a user with Operator permission can retrieve all accounts and instruments.
Request
{
"omsId": 0,
"orderId": 0
}
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System where the account's order history resides. |
| orderId | long integer. The ID of the of the order whose history you want to return. |
Response
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0.0,
"QuantityExecuted": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0.0,
"InsideAskSize": 0.0,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
},
]
The call GetOrderHistoryByOrderId returns an array containing all four types of orders for the named account. The call returns an empty array if there are no orders for the account.
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell 2 Short 3 Unknown (an error condition) |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each Order Management System. |
| Price | real. The price at which the buy or sell has been ordered. |
| Quantity | real. The quantity of the product to be bought or sold. |
| DisplayQuantity | real. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| orderType | string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| ClientOrderId | integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 Fully Executed. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| OrigQuantity | real. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | real. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| AvgPrice | real. The average executed price for the instrument in the order. |
| CounterPartyId | integer. The ID of the other party in an off-market trade. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One
of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified |
| OrigOrderId | integer. If the order has been changed, this is the ID of the original order. |
| OrigClOrdId | integer. If the order has been changed, this is the ID of the original client order ID. |
| EnteredBy | integer. The user ID of the person who entered the order. |
| IsQuote | Boolean. If this order is a quote, the value for IsQuote is true, else false. |
| InsideAsk | real. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | real. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | real. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | real. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | real. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | Boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancelation reason. |
| OMSId | integer. The ID of the Order Management System on which the order took place. |
GetOrdersHistory
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Retrieves an array of multiple orders (hence, GetOrdersHistory with plural Orders) for the specified account, order ID, user, instrument, or time stamp. The history starts at index i, where i is an integer identifying a specific order (the most recent order has an index of 0). “Depth” is the count of trades to report backwards from startIndex. All values in the call other than OMSId are optional.
For example, if depth = 200 and startIndex = 0, the history returns 200 orders into the past starting with the most recent (0) order. If depth = 200 and startIndex = 100, the history returns 200 orders into the past starting at 100 orders in the past.
The owner of the trading venue determines how long to retain order history before archiving.
A user with Trading permission can retrieve a history only for accounts with which the user is associated; a user with Operator permission can retrieve a history for any user or account.
Request
{
"omsId": 0,
"accountId": 0,
"clientOrderId": 0,
"originalOrderId": 0,
"originalClientOrderId": 0,
"userId": 0,
"instrumentId": 0,
"startTimestamp": 0,
"endTimestamp": 0,
"depth": 100,
"startIndex": 0
}
All values other than OMSId are optional. If account ID is not supplied, the Exchange assumes the default account of the user issuing the call.
| Key | Value |
|---|---|
| omsId | Integer. The ID of the Order Management System on which the orders took place. Required. If no other values are specified, the call returns the orders associated with the default account for the logged-in user on this Order Management System. |
| accountId | Integer. The account ID that made the trades. A user with Trading permission must be associated with this account, although other users also can be associated with the account. If no account ID is supplied, the system assumes the default account for the logged-in user. |
| clientOrderId | long integer. A user-assigned ID for the order (like a purchase-order number assigned by a company). clientOrderId defaults to 0. |
| originalOrderId | long integer. The original ID of the order. If specified, the call returns changed orders associated with this order ID. |
| originalClientOrderId | long integer. If the order has been changed, shows the original client order ID, a value that the client can create (much like a purchase order). |
| userId | integer. The ID of the user whose account orders will be returned. If not specified, the call returns the orders of the logged-in user. |
| instrumentId | long integer. The ID of the instrument named in the order. If not specified, the call returns orders for all instruments traded by this account. |
| startTimestamp | long integer. Date and time at which to begin the orders history, in POSIX format. |
| endTimestamp | long integer. Date and time at which to end the orders report, in POSIX format. |
| depth | integer. In this case, the count of orders to return, counting from the StartIndex. If not specified, returns all orders between BeginTimeStamp and EndTimeStamp, beginning at StartIndex and working backwards. |
| startIndex | integer. The starting index into the order history, from 0 (the most recent trade) and moving backwards in time. If not specified, defaults to 0. |
Response
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0.0,
"QuantityExecuted": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0.0,
"InsideAskSize": 0.0,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
},
]
The call GetOrdersHistory returns an array containing all four types of orders for the named account. The call returns an empty array if there are no orders for the account.
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell 2 Short 3 Unknown (an error condition) |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each Order Management System. |
| Price | real. The price at which the buy or sell has been ordered. |
| Quantity | real. The quantity of the product to be bought or sold. |
| DisplayQuantity | real. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| orderType | string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| ClientOrderId | integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 Fully Executed. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| OrigQuantity | real. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | real. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| AvgPrice | real. The average executed price for the instrument in the order. |
| CounterPartyId | integer. The ID of the other party in an off-market trade. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One
of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified |
| OrigOrderId | integer. If the order has been changed, this is the ID of the original order. |
| OrigClOrdId | integer. If the order has been changed, this is the ID of the original client order ID. |
| EnteredBy | integer. The user ID of the person who entered the order. |
| IsQuote | Boolean. If this order is a quote, the value for IsQuote is true, else false. |
| InsideAsk | real. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | real. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | real. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | real. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | real. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | Boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancelation reason. |
| OMSId | integer. The ID of the Order Management System on which the order took place. |
GetOrderStatus
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Retrieves the status information for a single order.
A user with Trading permission can retrieve status information for accounts and orders with which the user is associated; a user with Operator permission can retreive status information for any account or order ID.
Request
{
"omsId": 0,
"accountId": 0,
"orderId": 0,
}
| Key | Value |
|---|---|
| omsId | Integer. The ID of the Order Management System on which the order was placed. |
| accountId | integer. The ID of the account under which the order was placed. |
| orderId | integer. The ID of the order whose status will be returned. |
Response
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0.0,
"QuantityExecuted": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0.0,
"InsideAskSize": 0.0,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
},
]
The call GetOrderStatus returns an array containing both buy-side and a sell-side open orders for the named account. The call returns an empty array if there are no open orders for the account.
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell 2 Short 3 Unknown (an error condition) |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each Order Management System. |
| Price | real. The price at which the buy or sell has been ordered. |
| Quantity | real. The quantity of the product to be bought or sold. |
| DisplayQuantity | real. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| orderType | string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| ClientOrderId | integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 Fully Executed. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| OrigQuantity | real. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | real. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| AvgPrice | real. The average executed price for the instrument in the order. |
| CounterPartyId | integer. The ID of the other party in an off-market trade. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One
of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified |
| OrigOrderId | integer. If the order has been changed, this is the ID of the original order. |
| OrigClOrdId | integer. If the order has been changed, this is the ID of the original client order ID. |
| EnteredBy | integer. The user ID of the person who entered the order. |
| IsQuote | Boolean. If this order is a quote, the value for IsQuote is true, else false. |
| InsideAsk | real. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | real. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | real. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | real. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | real. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | Boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancelation reason. |
| OMSId | integer. The ID of the Order Management System on which the order took place. |
ModifyOrder
Category: User
Permissions: Operator, Trading
Call Type: Synchronous
Reduces an order’s quantity without losing priority in the order book. An order’s quantity can only be reduced. The other call that can modify an order — CancelReplaceOrder — resets order book priority, but you can use it to increase an order.
Request
{
"OMSId": 0,
"OrderId": 0,
"InstrumentId": 0,
"PreviousOrderRevision": 0,
"Quantity": 0
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System where the original order was placed. |
| OrderId | long integer. The ID of the order to be modified. The ID was supplied by the server when the order was created. |
| InstrumentId | integer. The ID of the instrument traded in the order. |
| PreviousOrderRevision | integer. The order revision number at the time you make the modification order. This ensures that you have the latest order state at the time you make the request. |
| Quantity | real. The new quantity of the order. This value can only be reduced from a previous quantity. |
Response
{
"result": false,
"errormsg": "",
"errorcode": 0,
"detail": "",
}
The response acknowledges the successful receipt of your request to modify an order; it does not indicate that the order has been modified. To find if an order has been modified, check using GetOpenOrders and GetOrderHistory.
| Key | Value |
|---|---|
| result | Boolean. The successful receipt of a modify order request returns true; otherwise, returns false. This is the acknowledgment of receipt of the request to modify, not a confirmation that the modification has taken place. |
| errormsg | string. A successful receipt of a modify request returns null; the
errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. The receipt of a successful request to modify returns 0. An unsuccessful request returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
SendOrder
Category: User
Permissions: Operator, Trading
Call Type: Asynchronous
Creates an order.
Anyone submitting an order should also subscribe to the various market data and event feeds, or call GeOpenOrders or GetOrderStatus to monitor the status of the order. If the order is not in a state to be executed, GetOpenOrders will not return it.
A user with Trading permission can create an order only for those accounts and instruments with which the user is associated; a user with Operator permissions can create an order for any account and instrument.
Request
{
"InstrumentId": 1,
"OMSId": 1,
"AccountId": 1,
"TimeInForce": 1,
"ClientOrderId": 1,
"OrderIdOCO": 0,
"UseDisplayQuantity": false,
"Side": 0,
"quantity": 1,
"OrderType": 2,
"PegPriceType": 3,
"LimitPrice": 8800
}
| Key | Value |
|---|---|
| InstrumentId | integer. The ID of the instrument being traded. |
| OMSId | integer. The ID of the Order Management System where the instrument is being traded. |
| AccountId | integer. The ID of the account placing the order. |
| TimeInForce | integer. An integer that represents the period during which the new order is
executable. One of: 0 Unknown (error condition) 1 GTC (good 'til canceled, the default) 2 OPG (execute as close to opening price as possible) 3 IOC (immediate or canceled) 4 FOK (fill-or-kill — fill immediately or kill immediately) 5 GTX (good 'til executed) 6 GTD (good 'til date) |
| ClientOrderId | long integer. A user-assigned ID for the order (like a purchase-order number assigned by a company). This ID is useful for recognizing future states related to this order. ClientOrderId defaults to 0. |
| OrderIdOCO | long integer. The order ID if One Cancels the Other — If this order is order A, OrderIdOCO refers to the order ID of an order B (which is not the order being created by this call). If order B executes, then order A created by this call is canceled. You can also set up order B to watch order A in the same way, but that may require an update to order B to make it watch this one, which could have implications for priority in the order book. See CancelReplaceOrder and ModifyOrder. |
| UseDisplayQuantity | Boolean. If you enter a Limit order with a reserve, you must set UseDisplayQuantity to true. |
| Side | integer. A number representing on of the following potential sides of a trade. One
of: 0 Buy 1 Sell 2 Short 3 unknown (an error condition) |
| Quantity | real. The quantity of the instrument being ordered. |
| OrderType | integer. A number representing the nature of the order. One of: 0 Unknown 1 Market 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade. |
| PegPriceType | integer. When entering a stop/trailing order, set PegPriceType to an integer
that corresponds to the type of price that pegs the stop: 1 Last 2 Bid 3 Ask 4 Midpoint |
| LimitPrice | real. The price at which to execute the order, if the order is a Limit order. |
Response
{
"status": "Accepted",
"errormsg": "",
"OrderId": 123 // Server order id
}
| Key | Value |
|---|---|
| status | string. If the order is accepted by the system, it returns "Accepted," if not
it returns "Rejected." Accepted Rejected |
| errormsg | string. Any error message the server returns. |
| OrderId | long integer. The ID assigned to the order by the server. This allows you to track the order. |
SubmitBlockTrade
Category: User
Permissions: Operator
Call Type: Asynchronous
Reports an off-market trade has occurred between two parties.
Once reported, you can follow the trade using GetAccountTrades or GetTradesHistory.
Request
{
"accountId":0,
"counterPartyId":null,
"omsId":0,
"clientOrderId":0,
"quantity":0.0,
"limitPrice":0.0,
"instrumentId":0,
"timestamp":0,
"side":0,
"lockedIn":false
}
| Key | Value |
|---|---|
| accountId | integer. The ID of the account making the report of the block trade. |
| counterPartyId | Integer. The ID of the other party in the off-market trade. |
| omsId | integer. The ID of the Order Management System where the block trade is to be reported. |
| clientOrderId | long integer. The client-provided ID for the trade (much like a client-provided purchase order number). |
| quantity | real. The quantity on the instrument that was traded. |
| limitPrice | real. The price at which to execute the block trade. |
| instrumentId | integer. The ID of the instrument being traded. |
| timestamp | long integer. The time that the block trade was submitted, in POSIX format. |
| side | integer. A number that represents the side of the transaction associated with
accountId. One of: 0 Buy 1 Sell 2 Short 3 Unknown (error condition) |
| lockedIn | Boolean. True if both parties to the block trade agree that one of the parties will report the trade for both sides. Otherwise, false. |
Response
{
"status":"Accepted",
"errormsg":"",
"OrderId": 22
}
| Key | Value |
|---|---|
| status | string. If the order is accepted by the system, it returns "Accepted," if
not, it returns "Rejected." One of: Accepted Rejected |
| errormsg | string. Any error message that the server returns. |
| OrderId | long integer. The ID assigned to the order by the server. This allows you to track the order later. |
UpdateQuote
Category: User
Permissions: Operator, MarketMaker
Call Type: Synchronous
Updates an existing quote. Quoting is not enabled for the retail end user of the Bitazza software. Only registered market participants or market makers may quote.
Request
{
"OMSId": 0,
"AccountId": 0,
"InstrumentId": 0,
"BidQuoteId": 0,
"Bid": 0,
"BidQTY": 0,
"AskQuoteId": 0,
"Ask": 0,
"AskQTY": 0,
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System where the quote is located. |
| AccountId | integer. The ID of the account whose quote will be updated. |
| InstrumentId | long integer. The ID of the instrument whose quote is being updated. |
| BidQuoteId | integer. The ID of the original bid quote being updated. |
| Bid | real. The new amount of the bid quote. |
| BidQTY | real. The new quantity of the bid quote. |
| AskQuoteId | integer. The ID of the original ask quote being updated. |
| Ask | real. The new amount of the ask quote. |
| AskQTY | real. The new quantity of the ask quote. |
Response
{
"BidResult": {
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
},
"AskResult": {
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}
}
| Key | Value |
|---|---|
| BidResult | object. Returns a response object for Bid (see below). |
| AskResult | object. Returns a response object for Ask. |
Objects for both BidResult and AskResult:
| Key | Value |
|---|---|
| result | Boolean. A successful receipt of the update returns true; and unsuccessful receipt of the update (an error condition) returns false. |
| errormsg | string. A successful receipt of the update returns null; the errormsg
parameter for an unsuccessful receipt returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successful receipt of the update returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
Products
These calls correspond roughly to the Products function of the Exchange Admin and Admin Guide.
AddProductAttributes
Category: User
Permissions: Operator, Company
Call Type: Synchronous
Adds a single key-value pair product attribute to a product.
Request
{
"OMSId": 1,
"ProductId": 1,
"KeyName": key,
"KeyValue": "value"
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System where the product is traded. |
| ProductId | integer. The ID of the product whose attributes are being set. |
| KeyName | string. The key portion of the key-value pair attribute being set. |
| KeyValue | string. The value portion of the key-value pair attribute being set. |
Response
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": ""
}
The response shows that the system has received the request to add product attributes, not that the attributes have been added. To see if an attribute has successfully been added, use GetProductAttributes.
| Key | Value |
|---|---|
| result | Boolean. A successful receipt of the request returns true; and unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt of the request returns null; the
errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successful receipt of the request returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
GetAmlProviderConfig
Category: System
Permissions: Operator
Call Type: Synchronous
Returns an AML ("anti-money laundering") provider configuration.
All key-value pairs of the Request are required.
Request
{
"OMSId": 0,
"ProductId": 1,
}
| Key | Value |
|---|---|
| OmsId | integer. The Order Management System on which the anti-money laundering service will function. |
| ProductId | integer. The ID of the product for which this AML service provider will function. Each product ID may have its own AML service provider. |
Response
{
"omsId": 0,
"productId": 0,
"url": "",
"amlProviderType": 0,
"apiToken": "",
"enabled": true,
}
| Key | Value |
|---|---|
| omsId | integer. The Order Management System on which the anti-money laundering service functions. |
| productId | integer. The ID of the product for which this AML service provider functions. Each product ID may have its own AML service provider. |
| url | stringThe URL address of the AML service provider. |
| amlProviderType | integer. There are three AML configuration settings, or types:
|
| apiToken | string. The nature of the product. One of: 0 Unknown (an error condition) 1 NationalCurrency 2 CryptoCurrency 3 Contract |
| enabled | Boolean. If true the AML configuration is active for this product. If false, the configuration is not live. |
GetAmlProviderConfigForOms
Category: System
Permissions: Operator
Call Type: Synchronous
Returns an AML ("anti-money laundering") provider configuration.
All key-value pairs of the Request are required.
Request
{
"OMSId": 0,
}
| Key | Value |
|---|---|
| OmsId | integer. The Order Management System on which the anti-money laundering service will function. |
Response
{
"omsId": 0,
"productId": 0,
"url": "",
"amlProviderType": 0,
"apiToken": "",
"enabled": true,
}
| Key | Value |
|---|---|
| omsId | integer. The Order Management System on which the anti-money laundering service functions. |
| productId | integer. The ID of the product for which this AML service provider functions. Each product ID may have its own AML service provider. |
| url | stringThe URL address of the AML service provider. |
| amlProviderType | integer. There are three AML configuration settings, or types:
|
| apiToken | string. The nature of the product. One of: 0 Unknown (an error condition) 1 NationalCurrency 2 CryptoCurrency 3 Contract |
| enabled | Boolean. If true the AML configuration is active for this product. If false, the configuration is not live. |
GetProduct
Category: User
Permissions: Public
Call Type: Synchronous
Retrieves the details about a specific product on the trading venue. A product is an asset that is tradable or paid out.
Request
{
"OMSId": 1,
"ProductId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System that includes the product. |
| ProductId | long integer. The ID of the product on the specified Order Management System. |
Response
{
"omsId":0,
"productId":0,
"product":null,
"productFullName":null,
"productType":0,
"decimalPlaces":0.0,
"tickSize":0.0,
"noFees":false
}
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System that offers the product. |
| productId | long integer. The ID of the product. |
| product | string. “Nickname” or shortened name of the product. For example, NZD (New Zealand Dollar). |
| productFullName | string. Full and official name of the product. For example, New Zealand Dollar. |
| productType | string. The nature of the product. One of: 0 Unknown (an error condition) 1 NationalCurrency 2 CryptoCurrency 3 Contract |
| decimalPlaces | integer. The number of decimal places in which the product is divided. The maximum is 8. For example, US Dollars are divided into 100 units, or 2 decimal places. Other products may be different. Burundi Francs use 0 decimal places and the Rial Omani uses 3. |
| tickSize | real. The smallest increment in which the product may trade. |
| noFees | Boolean. Shows whether trading the product incurs transaction fees. The default is false; that is, if NoFees is false, transaction fees will be incurred. If NoFees is true, no fees are incurred. |
GetProductAttributes
Category: User
Permissions: Operator, Company
Call Type: Synchronous
Retrieves the set of key-value attributes for a product.
Request
{
"OMSId": 1,
"ProductId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System where the product is listed. |
| ProductId | Integer. The ID of the product whose attributes the call returns. |
Response
[
{
"omsId":0,
"productId":0,
"keyName":"",
"keyValue":""
},
]
The response returns an array of information about the key-value pair attributes associated with the product.
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System returning the product attributes. |
| productId | integer. The ID of the product whose attributes are being returned. |
| keyName | string. The key portion of the key-value pair that describes the attribute. |
| keyValue | string. The value portion of the key-value pair that describes the attribute. |
GetProducts
Category: User
Permissions: Public
Call Type: Synchronous
Returns an array of products and currencies available on the exchange. A product is an asset that is tradable or paid out.
Request
{
"OMSId": 1,
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System for which the array of available products and currencies will be returned. |
Response
[
{
"omsId":0,
"productId":0,
"product":"",
"productFullName":"",
"productType":0,
"decimalPlaces":0.0,
"tickSize":0.0,
"noFees":false
},
]
The response returns an array of objects, one object for each product available on the Order Management System.
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System that offers the product. |
| productId | long integer. The ID of the product. |
| product | string. “Nickname” or shortened name of the product. For example, NZD (New Zealand Dollar). |
| productFullName | string. Full and official name of the product. For example, New Zealand Dollar. |
| productType | integer. A number describing the nature of the product. One of: 0 Unknown (an error condition) 1 NationalCurrency 2 CryptoCurrency 3 Contract |
| decimalPlaces | integer. The number of decimal places in which the product is divided. The maximum is 8. For example, US Dollars are divided into 100 units, or 2 decimal places. Other products may be different. Burundi Francs use 0 decimal places and the Rial Omani uses 3. |
| tickSize | real. The smallest increment in which the product can trade. |
| noFees | Boolean. Shows whether trading the product incurs transaction fees. The default is false; that is, if NoFees is false, transaction fees will be incurred. If NoFees is true, no fees are incurred. |
RemoveProductAttributes
Category: User
Permissions: Operator, Company
Call Type: Synchronous
Removes a single key-value pair that describes an attribute of a single product.
Request
{
"OMSId": 1,
"ProductId": 1,
"KeyName": "key",
"KeyValue": "value"
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the product is available. |
| ProductId | integer. The ID of the product whose key-value pair attribute will be removed. |
| KeyName | string. The Key portion of the key-value pair attribute to be removed. |
| KeyValue | string. The Value portion of the key-value pair attribute to be removed. |
Response
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": ""
}
A successful response indicates only that the product attribute removal request was received by the server, not that a successful removal took place. To see if the product attribute was removed, use GetProductAttributes.
| Key | Value |
|---|---|
| result | Boolean. A successful response returns true; an unsuccessful response (an error condition) returns false. |
| errormsg | string. A successful response returns null; the errormsg parameter for an
unsuccessful response returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successful response returns 0. An unsuccessful response returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
Instruments
These calls correspond roughly to the Instruments function of the Exchange Admin and Admin Guide.
AddInstrumentAttributes
Category: User
Permissions: Operator, Company
Call Type: Synchronous
Adds a single key-value pair attribute to a specific instrument available on the exchange.
TK Would like a sample attribute that can be added to an instrument.
Request
{
"OMSId": 1,
"InstrumentId": 1,
"KeyName": "key",
"KeyValue": "value"
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the instrument is traded. |
| InstrumentId | integer. The ID of the instrument to which you are adding the attribute. |
| KeyName | string. The key portion of the key-value pair that forms the attribute. |
| KeyValue | string. The value portion of the key-value pair that forms the attribute. |
Response
{
"result":true,
"errormsg":"",
"errorcode":0,
"detail":""
}
A successful response indicates only that the instrument attribute add request was received by the server, not that a successful addition took place. To see if the instrument attribute was added, use GetInstrumentAttributes.
| Key | Value |
|---|---|
| result | Boolean. A successful response returns true; an unsuccessful response (an error condition) returns false. |
| errormsg | string. A successful response returns null; the errormsg parameter for an
unsuccessful response returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful response returns 0. An unsuccessful response returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
GetInstrument
Category: User
Permissions: Public
Call Type:
Synchronous
Retrieves the details of a specific instrument from the Order Management System of the trading venue. An instrument is a pair of exchanged products (or fractions of them) such as US dollars and BitCoin.
Request
{
"OMSId": 1,
"InstrumentId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the instrument is traded. |
| InstrumentId | integer. The ID of the instrument. |
Response
{
"omsId": 0,
"instrumentId": 0,
"symbol": null,
"product1": 0,
"product1Symbol": null,
"product2": 0,
"product2Symbol": null,
"instrumentType": 0,
"venueInstrumentId": 0,
"venueId": 0,
"sortIndex": 0,
"sessionStatus": 0,
"previousSessionStatus": 0,
"sessionStatusDateTime": "0001-01-01T00:00:00",
"selfTradePrevention": false,
"quantityIncrement": 0.0,
"priceIncrement": 0.0
}
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System on which the instrument is traded. |
| instrumentId | integer. The ID of the instrument. |
| symbol | string. Trading symbol of the instrument, for example BTCUSD. |
| product1 | integer. The ID of the first product comprising the instrument. |
| product1Symbol | string. The symbol for Product 1 on the trading venue. For example, BTC. |
| product2 | integer. The ID of the second product comprising the instrument. |
| product2Symbol | string. The symbol for Product 2 on the trading venue. For example, USD. |
| instrumentType | integer. A number representing the type of the instrument. All instrument types
currently are standard, an exchange of one product for another (or unknown, an error
condition), but this may expand to new types in the future. 0 Unknown (an error condition) 1 Standard |
| venueInstrumentId | integer A venue instrument is created at the exchange level as an instrument "template" for adding new instruments to the exchange. This is the ID of the venue instrument behind the instrument being requested. |
| venueId | integer. The ID of the trading venue on which the instrument trades. |
| sortIndex | integer. The numerical position in which to sort the returned list of instruments on a visual display. Since this call returns information about a single instrument, SortIndex should return 0. |
| sessionStatus | integer. Is the market for this instrument currently open and operational? Returns one
of: 0 Unknown 1 Running 2 Paused 3 Stopped 4 Starting |
| previousSessionStatus | string. What was the previous session status for this instrument? One of: 0 Unknown 1 Running 2 Paused 3 Stopped 4 Starting |
| sessionStatusDateTime | string. The time and date at which the session status was reported, in Microsoft Ticks format. |
| selfTradePrevention | Boolean. An account that is trading with itself still incurs fees. If this instrument prevents an account from trading the instrument with itself, the value returns true; otherwise defaults to false. |
| quantityIncrement | real. The smallest tradeable increment of the instrument. For example, for BTCUSD, the quantity increment might be 0.0005, but for ETHUSD, the quantity increment might be 50. |
| priceIncrement | real. The smallest amount by which the instrument can rise or fall in the market. |
GetInstrumentAttributes
Category: User
Permissions: Operator, Company
Call
Type: Synchronous
Retrieves an array of instrument attributes.
Request
{
"OMSId": 1,
"InstrumentId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the instrument is traded. |
| InstrumentId | integer. The ID of the instrument whose attributes will be returned. |
Response
[
{
"omsId":0,
"instrumentId":0,
"keyName":"keyValue":""
},
]
The response returns an array, each element of which identifies the OMS, the instrument, and a single attribute value by name.
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System on which the instrument is traded. |
| instrumentId | integer. The ID of the instrument whose attributes are being returned. |
| keyName | string. The name of the attribute that is returned in keyValue. |
GetInstruments
Category: User
Permissions: Public
Call Type:
Synchronous
Retrieves a list of instruments available on the exchange. An instrument is a pair of exchanged products (or fractions of them) such as US dollars and BitCoin.
Request
{
"OMSId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the instruments are available. |
Response
[
{
"omsId":0 ,
"instrumentId": 0,
"symbol": "",
"product1": 0,
"product1Symbol": "",
"product2": 0,
"product2Symbol": "",
"instrumentType": 0,
"venueInstrumentId": 0,
"venueId":0,"sortIndex": 0,
"sessionStatus": 0,
"previousSessionStatus": 0,
"sessionStatusDateTime": "0001-01-01T00:00:00",
"selfTradePrevention": false,
"quantityIncrement": 0.0,
"priceIncrement": 0.0
},
]
The response for GetInstruments is an array of objects listing all the instruments available on the Order Management System.
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System on which the instrument is traded. |
| instrumentId | integer. The ID of the instrument. |
| symbol | string. Trading symbol of the instrument, for example BTCUSD. |
| product1 | integer. The ID of the first product comprising the instrument. |
| product1Symbol | string. The symbol for Product 1 on the trading venue. For example, BTC. |
| product2 | integer. The ID of the second product comprising the instrument. |
| product2Symbol | string. The symbol for Product 2 on the trading venue. For example, USD. |
| instrumentType | integer. A number representing the type of the instrument. All instrument types
currently are standard, an exchange of one product for another (or unknown, an error
condition), but this may expand to new types in the future. 0 Unknown (an error condition) 1 Standard |
| venueInstrumentId | integer A venue instrument is created at the exchange level as an instrument "template" for adding new instruments to the exchange. This is the ID of the venue instrument behind the instrument being requested. |
| venueId | integer. The ID of the trading venue on which the instrument trades. |
| sortIndex | integer. The numerical position in which to sort the returned list of instruments on a visual display. Since this call returns information about a single instrument, SortIndex should return 0. |
| sessionStatus | integer. Is the market for this instrument currently open and operational? Returns one
of: 0 Unknown 1 Running 2 Paused 3 Stopped 4 Starting |
| previousSessionStatus | string. What was the previous session status for this instrument? One of: 0 Unknown 1 Running 2 Paused 3 Stopped 4 Starting |
| sessionStatusDateTime | string. The time and date at which the session status was reported, in Microsoft Ticks format. |
| selfTradePrevention | Boolean. An account that is trading with itself still incurs fees. If this instrument prevents an account from trading the instrument with itself, the value returns true; otherwise defaults to false. |
| quantityIncrement | real. The smallest tradeable increment of the instrument. For example, for BTCUSD, the quantity increment might be 0.0005, but for ETHUSD, the quantity increment might be 50. |
| priceIncrement | real. The amount by which the instrument can rise or fall in the market. |
RemoveInstrumentAttributes
Category: User
Permissions: Operator, Company
Call
Type: Synchronous
Removes a single attribute key-value pair from an instrument.
Request
{
"OMSId": 1,
"InstrumentId": 1,
"KeyName": "key"
}
There is no need to specify the value of the attribute name.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System where the instrument is available. |
| InstrumentId | integer. The ID of the instrument whose attribute you want to remove. |
| KeyName | string. The name portion of the key-value attribute you want to remove. |
Response
{
"result":true,
"errormsg":"",
"errorcode":0,
"detail":""
}
A successful response indicates only that the instrument attribute remove request was received by the server, not that a successful removal took place. To see if the instrument attribute was removed, use GetInstrumentAttributes.
| Key | Value |
|---|---|
| result | Boolean. A successful response returns true; an unsuccessful response (an error condition) returns false. |
| errormsg | string. A successful response returns null; the errormsg parameter for an
unsuccessful response returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful response returns 0. An unsuccessful response returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
Tickets
These calls correspond roughly to the Tickets function of the Exchange Admin and Admin Guide.
Deposit and Withdraw Templates
Templates provide a set of information about banking tasks during deposits and withdrawals in the form of specific key-value pairs. Each template has a name. There are different templates for different types of deposit and withdrawal, determined by the product or asset (BitCoin, Monero, US Dollar, etc.), the specific bank or other Account Provider, and the information that the Account Provider requires for the transaction.
Most templates are used for withdrawals.
Example 1 and 2 are two example templates.
Template Example 1
"TemplateformType": "Standard",
{
"Full Name": "John Smith",
"Language": "en",
"Comment": "",
"BankAddress": "123 Fourth St.",
"BankAccountNumber": "12345678",
"BankAccountName": "John Smith & Sons",
"Swiftcode": "ABCDUSA1"
}
Template Example 2
"TemplateFormType": "TetherRPCWithdraw",
{
"TemplateType": "TetherRPCWithdraw",
"Comment": "TestWithdraw",
"ExternalAddress": "ms6C3pKAAr8gRCcnVebs8VRkVrjcvqNYv3"
}
The content of the template depends on the Account Provider that you use for deposits and withdrawals. The Account Provider does not supply the template per se (they do, however, determine the fields that are in the template). The template is specific to each Account Provider.
To determine which withdrawal template types are available to you, call GetWithdrawTemplateTypes.
CancelWithdraw
Category: System
Permissions: Withdraw
Call Type:
Synchronous
Cancels a pending withdrawal.
Only users with Withdraw permission can cancel their own pending withdrawals. An admin (a user with Operator permission) may cancel a withdraw, but is more likely to reject a withdraw.
Request
{
"OMSId": 1,
"UserId": 1,
"AccountId": 1,
"RequestCode": "Request Code GUID"
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System where the original withdraw ticket was created. |
| UserId | integer. The user ID of the user canceling the withdrawal. |
| AccountId | integer. The ID of the account from which the withdraw was made. |
| RequestCode | string. The globally unique ID (GUID) that identifies the specific withdraw that is
being canceled. You can obtain the RequestCode for a specific withdrawal by calling GetWithdraws with the account ID and looking for the withdrawCode value that corresponds to this pending withdrawal. |
Response
{
"result": true,
"errormsg": "Operation Failed",
"errorcode": 101,
"detail": "Withdraw Ticket not found for OmsId, AccountId, RequestCode"
}
The response indicates that the system has received the CancelWithdraw Request, not that the withdraw ticket has been canceled. You can check the status of a withdraw ticket by using GetWithdrawTicket.
| Key | Value |
|---|---|
| result | Boolean. A successful receipt of the withdraw ticket cancellation request returns true; an unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt of the withdraw ticket cancellation request returns
null; the errormsg field for an unsuccessful request returns one of the following
messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the withdraw ticket cancellation request returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
CreateDepositTicket
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
CreateDepositTicket records a deposit ticket for deposits of fiat money (non-crypto national currencies, for example). Crypto-currencies, such as BitCoin or Monero are handled by a different deposit mechanism described in GetDepositInfo.
The ticketing mechanism of the Order Management System tracks deposits and withdrawals, interacting with the Asset Manager.
Request
{
"assetManagerId": 0,
"accountId": 0,
"assetId": 0,
"assetName": null,
"amount": 0.0,
"omsId": 0,
"requestCode": null,
"requestIP": null,
"requestUser": 0,
"requestUserName": null,
"operatorId": 0,
"Status": 0,
"feeAmt": 0.0,
"updatedByUser": 0,
"updatedByUserName": null,
"ticketNumber": 0,
"depositInfo": "",
"createdTimestamp": "0001-01-01T00:00:00",
"lastUpdateTimeStamp": "0001-01-01T00:00:00",
"comments": null,
"attachments": null
}
| Key | Value |
|---|---|
| assetManagerId | integer. The ID of the system's asset manager module, usually 1. |
| accountId | integer. The account receiving the deposit. |
| assetId | integer. The ID of the asset being deposited. An asset is functionally the same as a product; you can obtain a list of products/assets available on the Exchange by using GetProducts. |
| assetName | string. The short name of the asset being deposited. For example, USD (US Dollars) or BTC (BitCoin). |
| amount | real. The quantity of the asset being deposited. This is not the monetary value of the asset. For example, 2.5 BitCoins is 2.5. |
| omsId | integer. The ID of the Order Management System where the deposit is being made, usually 1. |
| requestCode | string. A requestCode is a globally unique ID assigned by the system. Leave the value for this string null when issuing the CreateDepositTicket call; the Response returns the value for the requestCode, which you may need for other calls. |
| requestIp | string. The IP address from which the calling user makes the deposit ticket request. |
| requestUser | integer. The user ID of the user making the deposit ticket request. |
| requestUserName | string. The user name of the user making the deposit ticket request, for example, jsmith. |
| operatorId | integer. The ID of the trading venue operator. |
| status | integer. The current status of the deposit, stated as a number. A new deposit will always have a status of 0. |
| feeAmt | real. The amount of any fee for the deposit. |
| updatedByUser | integer. If the deposit ticket has been updated, this field contains the user ID of the user who updated the ticket. Because CreateDepositTicket creates the ticket, it is unlikely to have been updated yet; this value should be 0. |
| updatedByUserName | string. If the deposit ticket has been updated, this field contains the name of the user who updated the ticket. Because CreateDepositTicket creates the ticket, it is unlikely to have been updated yet; this value should be an empty string (null). |
| ticketNumber | long integer. A number assigned by the calling user to identify this deposit ticket, much as a purchase order identifies an order. |
| depositInfo | object. Leave this string as empty: " ". |
| createdTimeStamp | string. The time and date stamp for when the deposit ticket was created, in Microsoft Ticks format. All time and date stamps are given as UTC. |
| lastUpdateTimeStamp | string. The time and date stamp for the last update to the deposit ticket after it was created. Because CreateDepositTicket creates the ticket, it is unlikely that it has been updated, and this string should be empty. |
| comments | string. Any comments appended to the deposit ticket. |
| attachments | string. Any attachments appended to the deposit ticket. |
Response
{
"success": true,
"requestcode": "866f21fe-3461-41d1-91aa-5689bc38503f",
}
The successful response to CreateDepositTicket is a Boolean true value and a request code to allow tracking the ticket. To view and confirm ticket contents, use the call GetDepositTicket.
| String | Value |
|---|---|
| success | Boolean. Returns true if the system has created the deposit ticket successfully; otherwise returns false. |
| requestcode | string. A globally-unique ID (GUID) that identifies this specific deposit ticket. |
An unsuccessful response to CreateDepositTicket is a standard response object that includes an error code and error message, as explained in "Standard response objects and common error codes" in Background Information.
CreateWithdrawTicket
Category: System
Permissions: Operator, Withdraw
Call
Type: Synchronous
Initiates the withdrawal of funds from an account. You can use CreateWithdrawTicket for both cryptocurrency and fiat (national) currencies. The call transfers funds to an external account through a third-party Account Provider accredited by the Exchange.
A user with Withdraw permission can create a withdraw ticket only for an account with which they're associated; a user with Operator permission can create a withdraw ticket for any account.
Request
{
"OMSId": 1,
"AccountId": 1,
"ProductId": 1,
"Amount": 100.00,
"TemplateForm": {},
"TemplateType": "Template Form Type"
}
Part of the process of withdrawing an asset (product) is to specify the withdrawal template that sends the asset to the correct destination, usually an Account Provider. The content of templates varies from Account Provider to Account Provider. Get a list of templates available to you by calling GetWithdrawTemplateTypes. For more information on templates, see "Deposit and withdraw templates" at the beginning of the Tickets section.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System from which the withdrawal is being made. |
| AccountId | integer. The ID of the account from which the asset is being withdrawn. |
| ProductId | integer. The ID of the product (or asset) begin withdrawn; the terms are used interchangeably. |
| Amount | real. The number of units or fractions of units of the asset being withdrawn (not the asset's monetary value). For example. 2.5 BitCoin or 2000.00 US Dollars. |
| TemplateForm | object. The contents of the template form vary from Account Provider to Account Provider, depending on the asset being withdrawn and the identity of the Account Provider. See Example 1, below. |
| TemplateType | string. The name of the withdrawal template that controls the destination of the asset being withdrawn. To get a list of withdrawal templates that are available to you, call GetWithdrawTemplateTypes. |
Example 1
Example 1: a typical withdrawal template
{
"TemplateType": "ToExternalBitCoinAddress",
"Comment": "",
"ExternalAddress": "54123214"
}
Example 1 shows a typical withdrawal template.
Response
The Response
{
"result": true,
"errormsg": "Invalid Request",
"errorcode": 100,
"detail": "Insufficient Balance"
}
The response to CreateWithdrawTicket is a standard response object confirming receipt or non-receipt of the information, and does not confirm the ticket per se. To view and confirm the ticket was created properly, use the call GetWithdrawTicket.
| Key | Value |
|---|---|
| result | Boolean. Field is true if the call has been successfully received by the Order Management System; otherwise false. |
| errormsg | string. A successful receipt of the call returns null. The errormsg
value for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errocode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Often null. |
GetAccountDepositTransactions
Category: User
Permissions: Trading, AccountReadOnly
Call
Type: Synchronous
Obtains a list of deposits for the account.
Users with Trading and AccountReadOnly permission can return deposit transactions only from an account with which they are associated.
The owner of the trading venue determines how long to retain transaction history before archiving.
Request
{
"OMSId": 1,
"AccountId": 1,
"Depth": 200
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the account transactions took place. |
| AccountId | integer. The ID of the account whose transactions will be returned. |
| Depth | integer. The count of deposit transactions to be returned. Defaults to 200. |
Response
[
{
"transactionId": 0,
"omsId": 0,
"accountId": 0,
"cr": 0.0,
"dr": 0.0,
"counterparty": 0,
"transactionType": 0,
"referenceId": 0,
"referenceType": 0,
"productId": 0,
"balance": 0.0,
"timeStamp": 0
},
]
The response returns an array of transaction objects.
| Key | Value |
|---|---|
| transactionId | Integer. The ID of the transaction. |
| omsId | Integer. The ID of the Order Management System under which the requested transactions took place. |
| accountId | Integer. The single account under which the transactions took place. |
| cr | real. Credit entry for the account on the order book. Funds entering an account. |
| dr | real. Debit entry for the account on the order book. Funds leaving an account. |
| counterparty | long integer. The corresponding party in a trade. |
| transactionType | integer. A number representing the type of transaction: 1 Fee 2 Trade 3 Other 4 Reverse 5 Hold 6 Rebate 7 MarginAcquisition 8 MarginRelinquish |
| referenceId | long integer. The ID of the action or event that triggered this transaction. |
| referenceType | integer. A number representing the type of action or event that triggered this
transaction. One of: 1 Trade 2 Deposit 3 Withdraw 4 Transfer 5 OrderHold 6 WithdrawHold 7 DepositHold 8 MarginHold 9 ManualHold 10 ManualEntry 11 MarginAcquisition 12 MarginRelinquish 13 MarginQuoteHold |
| productId | integer. The ID of the product in which the deposit was made. Use GetProduct to return information about a product based on its ID. |
| balance | real. The balance in the account after the transaction. |
| timeStamp | long integer. Time at which the transaction took place, in POSIX format. |
GetAccountWithdrawTransactions
Category: User
Permissions: Trading, AccountReadOnly
Call
Type: Synchronous
Obtains a list of withdrawals for an account.
Users with Trading and AccountReadOnly permission can return withdrawal transactions only from an account with which they are associated.
The owner of the trading venue determines how long to retain transaction history before archiving.
Request
{
"OMSId": 1,
"AccountId": 1,
"Depth": 200
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the account transactions took place. |
| AccountId | integer. The ID of the account whose transactions will be returned. |
| Depth | integer. The count of withdrawal transactions to be returned. Defaults to 200. |
Response
[
{
"transactionId":0,
"omsId":0,
"accountId":0,
"cr":0.0,
"dr":0.0,
"counterparty":0,
"transactionType":0,
"referenceId":0,
"referenceType":0,
"productId":0,
"balance":0.0,
"timeStamp":0
},
]
The response returns an array of transaction objects.
| Key | Value |
|---|---|
| transactionId | Integer. The ID of the transaction. |
| omsId | Integer. The ID of the Order Management System under which the requested transactions took place. |
| accountId | Integer. The single account under which the transactions took place. |
| cr | real. Credit entry for the account on the order book. Funds entering an account. |
| dr | real. Debit entry for the account on the order book. Funds leaving an account. |
| counterparty | long integer. The corresponding party in a trade. |
| transactionType | integer. A number representing the type of transaction: 1 Fee 2 Trade 3 Other 4 Reverse 5 Hold 6 Rebate 7 MarginAcquisition 8 MarginRelinquish |
| referenceId | long integer. The ID of the action or event that triggered this transaction. |
| referenceType | integer. A number representing the type of action or event that triggered this
transaction. One of: 1 Trade 2 Deposit 3 Withdraw 4 Transfer 5 OrderHold 6 WithdrawHold 7 DepositHold 8 MarginHold 9 ManualHold 10 ManualEntry 11 MarginAcquisition 12 MarginRelinquish 13 MarginQuoteHold |
| productId | integer. The ID of the product that was withdrawn. Use GetProduct to return information about a product based on its ID. |
| balance | real. The balance in the account after the transaction. |
| timeStamp | long integer. Time at which the transaction took place, in POSIX format. |
GetAllLedgerEntryTickets
Category: System
Permissions: Operator
Call Type:
Synchronous
Retrieves an account ledger entries by optional parameters
Only a user with Operator permission can issue GetAllLedgerEntryTickets.
Request
{
"OMSId": 1,
"OperatorId": 1,
"StartIndex": 0,
"Limit": 0
}
The values for OMSId is required; the key-value pairs StartIndex and Limit are optional. You can include StartIndex, Limit, or both.
| Key | Value |
|---|---|
| OMSId | integer. REQUIRED The ID of the Order Management System on which the ledger entries were created. |
| AccountId | integer. OPTIONAL The ID of the Account for which the ledger entries were created. |
| UserId | integer. OPTIONAL The ID of the User for which the ledger entries were created. |
| ProductId | integer. OPTIONAL The ID of the Product for which the ledger entries were created. |
| StartIndex | integer. OPTIONAL The earliest location in the series of ledger entries at which to begin returning tickets. Tickets are returned from that location forward (that is, from then toward now). The most recent deposit ticket is ticket 0. If you do not include a StartIndex key and value in your request, tickets from the beginning of the Exchange will be returned (subject to Limit.) |
| Limit | integer. OPTIONAL The count of deposit tickets you want returned. For example, if you set the value of Limit to 50, a maximum of 50 ledger entries will be returned. That maximum may be further restricted by the position of StartIndex. For example, if your StartIndex is only ten tickets back, and you include a Limit value of 50, you're still only going to get ten tickets. |
Response
[
{
"accountLedgerEntryId": 0,
"accountId": 0,
"productId": 0,
"CR_Amt": 0.0,
"DR_Amt": 0.0,
"enteredBy": 0.0,
"comments": "",
"onsSidedTransaction": false
},
]
The Response returns an array of ledger entries matching the criteria set in the Request.
| Key | Value |
|---|---|
| accountLedgerEntryId | integer. The ID of the Ledger Entry |
| accountId | integer. The ID of the product into which the deposit was made. |
| assetId | integer. The ID of the asset (product) deposited. This may be cryptocurrency or fiat (national) currency. |
| productId | string. The short name of the asset being deposited, for example USD (US Dollars), BTC (BitCoin), etc. |
| CR_Amt | real. The Credit amount of the ledger entry. |
| DR_Amt | real. The Debit amount of the ledger entry. |
| comments | string. The Comments entered at time of creation. |
| onsSidedTransaction | boolean. One-sided (false by default). |
GetAllDepositTickets
Category: System
Permissions: Operator
Call Type:
Synchronous
Returns an array of all deposit tickets on the specified Order Management System. All deposit tickets from all accounts and all users are returned from the start of the Exchange to the present, subject only to the restrictions set by the StartIndex and Limit values.
Only a user with Operator permission can issue GetAllDepositTickets.
Request
{
"OMSId": 1,
"OperatorId": 1,
"StartIndex": 0,
"Limit": 0
}
The values for OMSId and OperatorId are required; the key-value pairs StartIndex and Limit are optional. You can include StartIndex, Limit, or both.
| Key | Value |
|---|---|
| OMSId | integer. REQUIRED The ID of the Order Management System on which the deposit tickets were created. |
| OperatorId | integer. REQUIRED The user ID of the user with Operator permission who is issuing the GetAllDepositTickets call. |
| StartIndex | integer. OPTIONAL The earliest location in the series of deposit tickets at which to begin returning tickets. Tickets are returned from that location forward (that is, from then toward now). The most recent deposit ticket is ticket 0. If you do not include a StartIndex key and value in your request, tickets from the beginning of the Exchange will be returned (subject to Limit.) |
| Limit | integer. OPTIONAL The count of deposit tickets you want returned. For example, if you set the value of Limit to 50, a maximum of 50 deposit tickets will be returned. That maximum may be further restricted by the position of StartIndex. For example, if your StartIndex is only ten tickets back, and you include a Limit value of 50, you're still only going to get ten tickets. |
Response
[
{
"assetManagerId": 0,
"accountId": 0,
"assetId": 0,
"assetName": null,
"amount": 0.0,
"omsId": 0,
"requestCode": "",
"requestIP": "",
"requestUser": 0,
"requestUserName": "",
"operatorId": 0,
"Status": 0,
"feeAmt": 0.0,
"updatedByUser": 0,
"updatedByUserName": "",
"ticketNumber": 0,
"depositInfo": {
"Full Name": "John Smith",
"language": "en",
"Bank Name": "Rubber City Bank"
},
"createdTimestamp": "0001-01-01T00:00:00",
"lastUpdateTimeStamp": "0001-01-01T00:00:00",
"comments": null,
"attachments": null
},
]
The Response returns an array of deposit tickets matching the criteria set in the Request.
| Key | Value |
|---|---|
| assetManagerId | integer. The ID of the Asset Manager module that handled the deposit. |
| accountId | integer. The ID of the account into which the deposit was made. |
| assetId | integer. The ID of the asset (product) deposited. This may be cryptocurrency or fiat (national) currency. |
| assetName | string. The short name of the asset being deposited, for example USD (US Dollars), BTC (BitCoin), etc. |
| amount | real. The unit quantity of asset being deposited. For example, 2.5 BitCoin or 2018.17 US Dollars. |
| omsId | integer. The ID of the Order Management System through which the asset was deposited. |
| requestCode | string. A globally unique ID (GUID) that identifies the deposit ticket on the Exchange. |
| requestIP | string. The IP address from which the deposit was received, for example 127.0.0.1. |
| requestUser | integer. The user ID of the user making the deposit. |
| requestUserName | string. The user name of the user making the deposit, for example, jsmith. |
| operatorId | integer. The user ID of the human admin (operator) who accepted, rejected or placed the ticket in the Pending status. Operators set the status of fiat currency deposits; cryptocurrency deposits are handled automatically. |
| Status | integer. The current status of the deposit ticket. Some of these statuses are valid
only for cryptocurrency deposits and some are valid for fiat currency deposits. Some of these statuses are
used by Bitazza internally, yet they may appear on returned Deposit Ticket
information. Deposit ticket statuses: 0 New (new ticket awaiting operator review) 1 AdminProcessing (An admin is looking at the ticket) 2 Accepted (An admin accepts the ticket) 3 Rejected (Admin rejects the ticket) 4 SystemProcessing (automatic processing; an unlikely status for a deposit) 5 FullyProcessed (the deposit has concluded) 6 Failed (the deposit failed for some reason) 7 Pending (Account Provider has set status to pending) 8 Confirmed (Account Provider confirms the deposit) 9 AmlProcessing (anti-money-laundering process underway) 10 AmlAccepted (anti-money-laundering process successful) 11 AmlRejected (deposit did not stand up to anti-money-laundering process) 12 AmlFailed (anti-money-laundering process failed/did not complete) 13 LimitsAccepted (deposit meets limits for fiat or crypto asset) 14 LimitsRejected (deposit does not meet limits for fiat or crypto asset) |
| feeAmt | real. The fee assessed by the Exchange for making the deposit, if any. Such a fee normally is assessed in the asset being deposited. |
| updatedByUser | integer. The user ID of the person who made the most recent update to the deposit ticket. This user should be an admin (Operator). |
| updatedByUserName | string. The user name of the person (admin/Operator) who made the most recent update to the deposit ticket. |
| ticketNumber | integer. Number of the ticket on the Exchange. |
| depositInfo | object. A set of key-value pairs that holds information about the source of funds being deposited. This information was entered when the deposit ticket was created, as required by the Account Provider. It can vary from Account Provider to Account Provider. |
| createdTimeStamp | string. The date and time that the deposit ticket was created, in Microsoft Ticks format. All dates and times are UTC. |
| lastupdateTimeStamp | string. The date and time stamp that the deposit ticket last was updated, in Microsoft Ticks format. All dates and times are UTC. |
| comments | string. Any comment appended to the deposit ticket. |
| attachments | string. Any attachment to the deposit ticket. |
GetAllDepositRequestInfoTemplates
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Returns an array of all templates available to the caller that describe a deposit form for a specific product.
An Account Provider may require specific deposit information. Deposit templates answer than need.
Request
{
"OMSId": 1,
"ProductId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the product is traded. |
| ProductId | integer. The ID of the product to be deposited. |
Response
[
{
"Template": {
"ProviderType": "BitcoinRpc",
"Template": "{}",
"ProcessInfo": "",
"UseGetDepositWorkflow": true,
"DepositWorkflow": "CryptoWallet"
},
"result": true,
"errormsg": null,
"statuscode": 0
},
]
The Response is an array of information for templates appropriate to the product specified in the Request and available to the caller, along with fields that show whether the Response successfully returned the Template information. The key-value pairs of the inner Template object vary from Account Provider to Account Provider.
Template object
| Key | Value |
|---|---|
| ProviderType | String. The type of asset handled by the Account Provider. Possible values
are: BitcoinRpc BitGoRpc Internal Accounting WsAccountingProvider EthereumERC20 EthereumRPC |
| Template | JSON object. The key-value pairs of Template vary from Account Provider to Account Provider. |
| ProcessInfo | String. The ProcessInfo string varies with the Account Provider and the asset being deposited. In a generic deposit template, the ProcessingInfo key-value pair is empty; in other cases it is an address for processing the deposit. |
| UseGetDepositWorkflow | Boolean. A true value causes the deposit to use the deposit workflow named in DepositWorkflow. A false value causes the deposit not to use that defined workflow. |
| DepositWorkflow | String. A set of defined workflows for this template. The workflows are defined and
named during the installation of the Exchange. Choices
are: CryptoWallet ManualDeposit MerchantForm MerchantRedirect Custom |
Response fields
| Key | Value |
|---|---|
| result | Boolean. If the call has been successfully received by the Order Management System, returns true, otherwise returns false. |
| errormsg | String. A successful receipt of the call returns null. The errormsg
key for an unsuccessful call can return: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| statusCode | integer. If result is false, statusCode can return:
32 Not Authorized 33 Asset_Manager_Not_Found If no Account Provider is located, statusCode returns null. |
GetAllWithdrawTickets
Category: System
Permissions: Operator
Call Type:
Synchronous
Returns an array of all withdrawal tickets from the specified Order Management System. All withdrawal tickets from all accounts and all users are returned from the start of the Exchange to the present, subject only to the restrictions set by the StartIndex and Limit values.
The user must have Operator permission to issue GetAllWithdrawTickets. A similar call, GetWithdrawTickets can be used with Operator or Trading permissions, and returns withdraw tickets from a single account.
Request
{
"OMSId": 1,
"OperatorId": 1,
"StartIndex": 0,
"Limit": 1
}
The key-value pairs StartIndex and Limit are optional. The oldest ticket is ticket 0. This differs from other calls where the newest ticket or transaction is 0. The value of StartIndex is a pointer into the stream of withdrawal tickets, and the value of Limit shows how far into the past (towards ticket 0) to return tickets. For example, if there are 1500 current tickets (oldest ticket 0 through newest ticket 1499), StartIndex = 100, and Limit = 100; then GetAllWithdrawTickets would return ticket numbers 1399 through 1300.
| Key | Value |
|---|---|
| OMSId | integer. REQUIRED The ID of the Order Management System where the withdraw tickets were created. |
| OperatorId | integer. REQUIRED The ID of the admin (operator) requesting GetAllWithdrawTickets. |
| StartIndex | integer. OPTIONAL The location in the series of withdrawal tickets at which to begin returning tickets. Tickets are returned from that location towards ticket 0 (the oldest ticket). If you do not include a StartIndex key and value in the request, all tickets will be returned (subject to the value of Limit.) |
| Limit | integer. OPTIONAL The count of withdrawal tickets you want returned. For example, if you set the value of Limit to 50, a maximum of 50 withdrawal tickets will be returned. That maximum may be further restricted by the position of StartIndex. For example, if your StartIndex is only ten tickets from ticket 0, and you include a Limit value of 50, you're still only going to get ten tickets. |
Response
[
{
"assetManagerId": 0,
"accountId": 0,
"assetId": 0,
"assetName": "",
"amount": 0.0,
"templateForm": "{
“TemplateType”: “TetherRPCWithdraw”,
“Comment”: “TestWithdraw”,
“ExternalAddress”: “ms6C3pKAAr8gRCcnVebs8VRkVrjcvqNYv3”,
}",
"templateFormType": "TetherRPCWithdraw",
"omsId": 0,
"requestCode": "490b4fa3-53fc-44f4-bd29-7e16be86fba3",
"requestIP": "",
"requestUserId": 0,
"requestUserName": "",
"operatorId": 0,
"Status": 0,
"feeAmt": 0.0,
"updatedByUser": 0,
"updatedByUserName": "",
"ticketNumber": 0,
"createdTimestamp": "0001-01-01T00:00:00",
"lastUpdateTimestamp": "0001-01-01T00:00:00",
"Comments": "[
{
"commentId": 0,
"enteredBy": 0,
"enteredDateTime": "0001-01-01T00:00:00",
"comment": "",
"operatorId": 0,
"omsId": 0,
"ticketCode": "",
"ticketId": 0
}
]",
"Attachments": "[
{
"attachmentId": 0,
"submittedByUserId": 0,
"submittedByUserName": "",
"uploadDate": "0001-01-01T00:00:00",
"uploadIP": "",
"ticketNumber": 0
}
]",
"AuditLog": "[]"
}
]
GetAllWithdrawTickets returns an array of withdrawal ticket information. The sample Comments and Attachments objects are documented separately below.
| Key | Value |
|---|---|
| assetManagerId | integer. The ID of the Asset Manager through which the withdrawal was made. |
| accountId | integer. The ID of the account that made the withdrawal. |
| assetId | integer. The ID of the asset (product) that was withdrawn. Withdrawal fees (if any) are usually assessed in the same asset that was withdrawn. |
| assetName | string. The short name of the asset. For example, BTC for BitCoin or USD for US Dollars. |
| amount | real. The number of units or fractions of units of the asset that were withdrawn (not the asset's monetary value). For example, 2.5 BitCoin or 2018.00 US Dollars. |
| templateForm | JSON string object. The contents of the template form vary from Account Provider to Account Provider depending on the asset being withdrawn and the identity of the Account Provider. The Response returns this information as a string. The fields shown here are just examples. |
| templateFormType | string. The name of the template being used. Templates vary from Account Provider to Account Provider. |
| omsId | integer. The ID of the Order Management System on which the withdrawal was made. |
| requestCode | string. A globally unique identifier (GUID) that identifies this specific withdrawal. |
| requestIP | string. The IP address from which the withdrawal was initiated. |
| requestUserId | integer. The user ID of the user who submitted the withdrawal. |
| requestUserName | string. The user name of the user who submitted the withdrawal. For example, jsmith. |
| operatorId | integer. The ID of the administrator (operator) who processed the withdrawal. Withdrawals of cryptocurrency are handled automatically; withdrawals of fiat (national) currency are approved by a human operator. |
| Status | integer. The current status of the withdrawal ticket. Some of these statuses are valid
only for cryptocurrency withdrawals, which uses an automated withdrawal process, and some are valid for
fiat currency withdrawals, which requires a human admin (operator). Some of these statuses are used by
Bitazza internally, yet they may appear on a returned Withdraw Ticket. Withdraw ticket statuses: 0 New (awaiting operator review) 1 AdminProcessing (An admin is looking at the ticket) 2 Accepted (withdrawal will proceed) 3 Rejected (admin or automatic rejection) 4 SystemProcessing (automatic processing underway) 5 FullyProcessed (the withdrawal has concluded) 6 Failed (the withdrawal failed for some reason) 7 Pending (the admin has placed the withdrawal in pending status) 8 Pending2Fa (user must click 2-factor authentication confirmation link) 9 AutoAccepted (withdrawal will be automatically processed) 10 Delayed (waiting for funds to be allocated for the withdrawal) 11 UserCanceled (withdraw canceled by user or Superuser) 12 AdminCanceled (withdraw canceled by Superuser) 13 AmlProcessing (anti-money-laundering process underway) 14 AmlAccepted (anti-money-laundering process complete) 15 AmlRejected (withdrawal did not stand up to anti-money-laundering process) 16 AmlFailed (withdrawal did not complete anti-money-laundering process) 17 LimitsAccepted (withdrawal meets limits for fiat or crypto asset) 18 LimitsRejected (withdrawal does not meet limits for fiat or crypto asset) 19 Submitted (withdrawal sent to Account Provider; awaiting blockchain confirmation) 20 Confirmed (Account Provider confirms that withdrawal is on the blockchain) 21 ManuallyConfirmed (admin has sent withdrawal via wallet or admin function directly; marks ticket as FullyProcessed; debits account) 22 Confirmed2Fa (user has confirmed withdraw via 2-factor authentication.) |
| feeAmt | real. The amount of any fee that was charged for the withdrawal. feeAmt is always denominated in the asset or product that was withdrawn. |
| updatedByUser | integer. The user ID of the most recent user who may have updated the withdrawal ticket. This user is usually an admin (operator). |
| updatedByUserName | string. The user name of the most recent user who may have updated the withdrawal ticket. This user is usually an admin (operator). |
| ticketNumber | integer. The number of the ticket, as assigned by the system. |
| createdTimeStamp | string. The time and date when the withdrawal ticket was created, in Microsoft Ticks format. All times and dates are UTC. |
| lastUpdateTimeStamp | string. The time and date when the withdrawal ticket was last updated, in Microsoft Ticks format. All times and dates are UTC. |
| Comments | array of JSON string objects. An array of key-value pairs appended as comments to the withdrawal ticket. See Comments example. |
| Attachments | array of JSON string objects. An array of any attachments appended to the withdrawal ticket. See Attachments example. |
| AuditLog | array of JSON string objects. Reserved for future use. |
Comments Example
Comments Example
"Comments":"[
{
"commentId": 0,
"enteredBy": 0,
"enteredDateTime": "0001-01-01T00:00:00",
"comment": "",
"operatorId": 0,
"omsId": 0,
"ticketCode": "",
"ticketId": 0
}
]",
Comments appear as an array.
| Key | Value |
|---|---|
| commentId | integer. The ID assigned to the comment by the system. |
| enteredBy | integer. The ID of the user who entered the comment. |
| enteredDateTime | string. The time and date that the comment was entered, in Microsoft Ticks format. All times and dates are UTC. |
| comment | string. The text of the comment. |
| operatorId | integer. The ID of the admin (operator) making the comment. |
| omsId | integer. The ID of the Order Management System where the withdrawal ticket and comment were created. (They are unlikely to be different). |
| ticketCode | string. A globally unique ID (GUID) assigned by the system and which identifies the ticket. |
| ticketId | integer. The ID of the ticket as assigned by the system. |
Attachments Example
Attachments Example
"Attachments":"[
{
"attachmentId": 0,
"submittedByUserId": 0,
"submittedByUserName": "",
"uploadDate": "0001-01-01T00:00:00",
"uploadIP": "",
"ticketNumber": 0
}
]",
Any attachments appear as an array.
| Key | Value |
|---|---|
| attachmentId | integer. The ID assigned to the attachment by the system. |
| submittedByUserId | integer. The user ID of the person who added the attachment to the withdrawal ticket. |
| submittedByUserName | integer. The user name of the person who submitted the attachment. |
| uploadDate | string. The date and time that the attachment was uploaded, in Microsoft Ticks format. All times and dates are UTC. |
| uploadIP | string. The IP address from which the attachment was uploaded. |
| ticketNumber | long integer. The number of the withdrawal ticket, as assigned by the system. |
GetAssetManagerWalletTicket
Category: System
Permissions: Operator
Call Type:
Synchronous
Returns the details about a single specific Asset Manager wallet ticket. The key-value pairs in the Request identify the ticket to return.
Request
{
"assetManagerId": 0,
"accountProviderId": 0,
"assetId": 0,
"TicketType": 0,
"TicketStatus": 0,
"ticketId": "",
"ticketNumber": 0,
"assetManagerServiceId": "1",
"startIndex": 0,
"limit": 0
}
| Key | Value |
|---|---|
| assetManagerId | integer. The ID of the Asset Manager to which the wallet is linked. Different Order Management Systems may have different Asset Managers. |
| accountProviderId | integer. The ID of the Account Provider that is linked to the Asset Manager for the asset identified in assetId. |
| assetId | integer. The ID of the asset (product) of the Exchange that caused the generation of a ticket. |
| ticketType | integer. Describes the type of error or condition that triggered the ticket. One
of: 0 Unknown (an error condition) 1 LowBalance 2 HighBalance 3 Transfer 4 BalanceRequired 5 BalanceMismatch 6 WithdrawError 7 DepositError 8 AccountProviderError |
| ticketStatus | integer. Describes the disposition of the ticket. One of: 0 Unknown (an error condition) 1 Open 2 Resolved 3 Rejected 4 Notification |
| ticketId | string. A unique ID (alphanumeric) assigned by the system to the ticket. |
| ticketNumber | integer. The number of this ticket on the Exchange. |
| assetManagerServiceId | string. The assetManagerServiceId is an alphanumeric string pre-configured for the specific Exchange. For current installations, this value is "1". |
| startIndex | integer. OPTIONAL The earliest location in the series of Asset Manager Wallet Tickets to begin searching for the one ticket you want returned. Tickets are searched from that location forward (that is, from then toward now, or from the past to the present). The most recent Asset Manager Wallet Ticket is ticket 0. Without a startIndex value, the system begins searching with the first Asset Manager Wallet Ticket on the Exchange. |
| limit | integer. OPTIONAL The count of Asset Manager Wallet Tickets to search. For example, if you set limit to 50, the Exchange begins searching at startIndex and looks at the next 50 tickets (moving from the ticket identified by startIndex towards the 0th — most recent — ticket). Once 50 tickets have been searched (in this case), the search ceases and either the specified ticket is returned or no ticket is returned. |
Response
{
"assetManagerId": 0,
"accountProviderId": 0,
"assetId": 0,
"ticketId": "",
"lastUpdatedTime": 0,
"lastUpdatedBy": 0,
"ticketNumber": 0,
"assetManagerServiceId": "1",
"info": "",
"TicketType": 0,
"TicketStatus": 0
}
The response is a single Asset Manager Wallet Ticket. Depending on values you set for startIndex and limit, GetAssetManagerWalletTicket may return no ticket.
| Key | Value |
|---|---|
| assetManagerId | integer. The ID of the Asset Manager to which the wallet is linked. |
| accountProviderId | integer. The ID of the Account Provider that is linked to the Asset Manager and the asset named in assetId. |
| assetId | integer. The ID of the asset (product) of the Exchange that caused the generation of the ticket. Usually, this is because of some problem or issue. |
| ticketId | string. A unit ID (alphanumeric) assigned by the system to the ticket. |
| lastUpdatedTime | long integer. The date and time stamp of the last update to the ticket, in POSIX format. All dates and times are UTC. |
| lastUpdatedBy | integer. The user ID of the last user to update the ticket (this usually will be an admin). |
| ticketNumber | integer. The number assigned to this ticket by the system. |
| assetManagerServiceId | string. The assetManagerServiceId is an alphanumeric string pre-configured for the specific Exchange. For current installations, this value always returns "1". |
| info | string. Any information appended to the ticket by the system. |
| ticketType | integer. Describes the type of error or condition that triggered the ticket. One
of: 0 Unknown (an error condition) 1 LowBalance 2 HighBalance 3 Transfer 4 BalanceRequired 5 BalanceMismatch 6 WithdrawError 7 DepositError 8 AccountProviderError |
| ticketStatus | integer. Describes the disposition of the ticket. One of: 0 Unknown (an error condition) 1 Open 2 Resolved 3 Rejected 4 Notification |
GetDepositInfo
Category: System
Permissions: Operator, Deposit
Call
Type: Synchronous
Retrieves deposit key information so that the user can send cryptocurrency funds, and optionally generates new keys. The GetDepositInfo call is only for depositing cryptocurrency into an account.
Users with Deposit permission can deposit only to their own accounts; users with Operator permission can deposit to any account.
Request
{
"OMSId": 1,
"AccountId": 1,
"ProductId": 1,
"GenerateNewKey": true
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the deposit ticket was created. |
| AccountId | integer. The ID of the account into which the deposit was made. |
| ProductId | integer. The ID of the product (asset) of the Exchange that caused the generation of a ticket. |
| GenerateNewKey | Boolean. If GenerateNewKey has a true value, the two crypto deposit keys wil be new; if GenerateNewKey has a false value, these will be the last two keys that were generated. |
Response
{
"AssetManagerId": 1,
"ACcountId": 1,
"AssetId": 1,
"ProviderId": 1,
"DepositInfo": [],
"result": true,
"errormsg": null,
"statuscode": 0
}
| Key | Value |
|---|---|
| assetManagerId | integer. The ID of the Asset Manager on which the deposit was made. |
| accountId | integer. The ID of the account into which the deposit was made. |
| assetId | integer. The ID of the asset (product) that was deposited. |
| ProviderId | integer. The ID of the Account Provider that handles this specific product (asset) |
| DepositInfo | array. Array of two crypto deposit keys, each a long integer. |
| result | Boolean. If the call has been successfully received by the Order Management System, returns true, otherwise returns false. |
| errormsg | String. A successful receipt of the call returns null. The errormsg
key for an unsuccessful call can return: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| statusCode | integer. If result is false, statusCode can return:
32 Not Authorized 33 Asset_Manager_Not_Found If no Account Provider is located, statusCode returns null. |
GetDepositRequestInfoTemplate
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Returns a single object describing a single deposit form template that is available to the caller and the caller's account, and appropriate to the product being deposited.
Request
{
"OMSId": 1,
"ProductId": 1,
"AccountId": 1,
"TemplateType": "TrustPay"
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the product is traded. |
| ProductId | integer. The ID of the product to be deposited. |
| AccountId | integer. The ID of the account into which the deposit will be made. |
| TemplateType | string. The name of the deposit template you want to return. |
Response
{
"Template": {
"ProviderType":"BitcoinRpc",
"Template": "{}",
"ProcessInfo": "",
"UseGetDepositWorkflow": true,
"DepositWorkflow": "CryptoWallet"
},
"result": true,
"errormsg": null,
"statuscode": 0
}
The Response is a single template appropriate to the product specified in the Request and available to the caller, along with fields that show whether the Response successfully returned the Template information. The key-value pairs of the inner Template object vary from Account Provider to Account Provider.
Template object
| Key | Value |
|---|---|
| ProviderType | String. The type of asset handled by the Account Provider. Possible values
are: BitcoinRpc BitGoRpc Internal Accounting WsAccountingProvider EthereumERC20 EthereumRPC |
| Template | JSON object. The key-value pairs of Template vary from Account Provider to Account Provider. |
| ProcessInfo | String. The ProcessInfo string varies with the Account Provider and the asset being deposited. In a generic deposit template, the ProcessingInfo key-value pair is empty; in other cases it is an address for processing the deposit. |
| UseGetDepositWorkflow | Boolean. A true value causes the deposit to use the deposit workflow named in DepositWorkflow. A false value causes the deposit not to use that defined workflow. |
| DepositWorkflow | String. A set of defined workflows for this template. The workflows are defined and
named during the installation of the Exchange. Choices
are: CryptoWallet ManualDeposit MerchantForm MerchantRedirect Custom |
Response fields
| Key | Value |
|---|---|
| result | Boolean. If the call has been successfully received by the Order Management System, returns true, otherwise returns false. |
| errormsg | String. A successful receipt of the call returns null. The errormsg
key for an unsuccessful call can return: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| statusCode | integer. If result is false, statusCode can return:
32 Not Authorized 33 Asset_Manager_Not_Found If no Account Provider is located, statusCode returns null. |
GetDeposits
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Returns an array of deposit objects with information about the deposits of a specific account.
Users with Trading permission can get deposit information only for their own accounts; users with Operator permission can get deposit information for any account.
Request
{
"OMSId": 1,
"AccountId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the deposits were made. |
| AccountId | integer. The ID of the account into which the deposits were made. |
Response
[
{
"omsId": 0,
"depositId": 0,
"accountId": 0,
"subAccountId": 0,
"productId": 0,
"amount": 0.0
},
]
The Response is an array of deposit objects.
| Key | Value |
|---|---|
| omsId | integer. The ID of the Order Management System on which this deposit was made. |
| depositId | integer. The ID of this deposit, assigned by the system. |
| accountId | integer. The ID of the account into which this deposit was made. |
| subAccountId | integer. Not currently used; reserved for future use. Defaults to 0. |
| productId | integer. The ID of the product or asset (the two are synonymous) that was deposited. |
| amount | real. The unit and fractional quantity of the product or asset that was deposited. For example 2.5 BitCoin or 2018.17 US Dollars. |
GetDepositTicket
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Returns details about a single deposit ticket. A deposit ticket documents that a deposit was made or attempted.
Request
{
"OMSId": 1,
"AccountId": 1,
"RequestCode": "Request Code GUID",
"TicketId": 100000002
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the deposit ticket was created. |
| AccountId | integer. The ID of the account into which the deposit was made. |
| RequestCode | string. A globally unique ID (GUID) that identifies this specific deposit. |
| TicketId | long integer. The ID of the specific deposit ticket, as assigned by the system. |
Response
{
"assetManagerId": 0,
"accountId": 0,
"assetId": 0,
"assetName": null,
"amount": 0.0,
"omsId": 0,
"requestCode": null,
"requestIP": null,
"requestUser": 0,
"requestUserName": null,
"operatorId": 0,
"Status": 0,
"feeAmt": 0.0,
"updatedByUser": 0,
"updatedByUserName": null,
"ticketNumber": 0,
"depositInfo": null,
"createdTimestamp": "0001-01-01T00:00:00",
"lastUpdateTimeStamp": "0001-01-01T00:00:00",
"comments": null,
"attachments": null
}
| Key | Value |
|---|---|
| assetManagerId | integer. The ID of the Asset Manager on which the deposit was made. |
| accountId | integer. The ID of the account into which the deposit was made. |
| assetId | integer. The ID of the asset (product) that was deposited. |
| assetName | string. The short name of the asset (product) that was deposited, for example BTC for BitCoin or USD for US Dollars. |
| amount | real. The unit and fractional amount of the asset that was deposited, for example 2.5 BitCoin or 2018.17 US Dollars. |
| omsId | integer. The ID of the Order Management System on which the deposit was made. |
| requestCode | string. A globally unique alphanumeric string (GUID) assigned by the system that identifies this specific deposit. |
| requestIP | string. The IP address from which the deposit request was made. |
| requestUser | integer. The user ID of the user who made the deposit request. |
| requestUserName | string. The user name of the user who made the deposit request, for example, jsmith. |
| operatorId | integer. The user ID of the operator who managed the deposit request. |
| status | integer. The current status of this deposit ticket. Some of these statuses are valid
only for cryptocurrency deposits; some are only valid for deposits of fiat (national) currency; others are
used by Bitazza internally. Any of the statuses may appear on a deposit ticket. Deposit ticket statuses 0 New (new ticket awaiting operator review) 1 AdminProcessing (an admin is looking at the ticket) 2 Accepted (an admin accepts the ticket) 3 Rejected (admin rejects the ticket) 4 SystemProcessing (automatic processing; an unlikely status for a deposit) 5 FullyProcessed (the deposit has concluded) 6 Failed (the deposit has failed for some reason) 7 Pending (Account Provider has set status to pending) 8 Confirmed (Account Provider confirms the deposit) 9 AmlProcessing (anti-money-laundering process underway) 10 AmlAccepted (anti-money-laundering process successful) 11 AmlRejected (deposit did not stand up to anti-money-laundering process) 12 AmlFailed (anti-money-laundering process failed/did not complete) 13 LimitsAccepted (deposit meets limits for fiat or crypto asset) 14 LimitsRejected (deposit does not meet limits for fiat or crypto asset) |
| feeAmt | real. The fee assessed for making the deposit, if any. Deposit fees usually are assessed in the asset/product being deposited. |
| updatedByUser | integer. The user ID of the last user to have updated the ticket (status, amount, etc.; this is usually an admin). |
| updatedByUserName | string. The user name of the last user to have updated the ticket, for example, jsmith. |
| ticketNumber | long integer. An ID number assigned by the system to identify the ticket (as opposed to identifying the deposit). |
| depositInfo | string. A set of key-value pairs that holds information about the source of the funds being deposited. This information was entered when the deposit ticket was created, as required by the Account Provider. It can vary from Account Provider to Account Provider. |
| createdTimeStamp | string. The date and time when the deposit ticket was created, in Microsoft Ticks format. All dates and times are UTC. |
| lastUpdateTimeStamp | string. The date and time when the deposit ticket last was updated — usually by an admin changing its status — in Microsoft Ticks format. All dates and times are UTC. |
| comments | string. Any comment appended to the deposit ticket. |
| attachments | string. Any attachment to the deposit ticket. |
GetDepositTickets
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Returns an array of deposit ticket objects for a specific account. The call returns all tickets for a given account. Use GetDepositTicket to return a single ticket. Operators (only) can use GetAllDepositTickets to return a subset of tickets.
Users with Trading permission can return deposit ticket information only for accounts with which they're associated; users with Operator permission can return deposit ticket information for any account.
Request
{
"OMSId": 1,
"OperatorId": 1,
"AccountId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the account operates whose tickets you want to return. |
| OperatorId | integer. A user with Operator permission should put the Operator's ID here; a user with Trading permission should put the value 1 here. |
| AccountId | integer. The account whose deposit tickets you want to return. |
Response
[
{
"assetManagerId": 0,
"accountId": 0,
"assetId": 0,
"assetName": null,
"amount": 0.0,
"omsId": 0,
"requestCode": "",
"requestIP": "",
"requestUser": 0,
"requestUserName": "",
"operatorId": 0,
"Status": 0,
"feeAmt": 0.0,
"updatedByUser": 0,
"updatedByUserName": "",
"ticketNumber": 0,
"depositInfo": null,
"createdTimestamp": "0001-01-01T00:00:00",
"lastUpdateTimeStamp": "0001-01-01T00:00:00",
"comments": null,
"attachments": null
},
]
The Response returns an array of deposit ticket information.
| Key | Value |
|---|---|
| assetManagerId | integer. The ID of the Asset Manager module that handled the deposit. |
| accountId | integer. The ID of the account into which the deposit was made. |
| assetId | integer. The ID of the asset (product) deposited. This may be cryptocurrency or fiat (national) currency. |
| assetName | string. The short name of the asset being deposited, for example USD (US Dollars), BTC (BitCoin), etc. |
| amount | real. The unit quantity and fractional quantity of the asset being deposited. For example, 2.5 BitCoin or 2018.17 US Dollars. |
| omsId | integer. The ID of the Order Management System through which the asset was deposited. |
| requestCode | string. A globally unique ID (GUID) that identifies the deposit ticket on the Exchange. |
| requestIP | string. The IP address from which the deposit was received, for example 127.0.0.1. |
| requestUser | integer. The user ID of the user making the deposit. |
| requestUserName | string. The user name of the user making the deposit, for example, jsmith. |
| operatorId | integer. The user ID of the human admin (operator) who accepted, rejected or placed the ticket in the Pending status. Operators set the status of fiat currency deposits; cryptocurrency deposits are handled automatically. |
| Status | integer. The current status of the deposit ticket. Some of these statuses are valid
only for cryptocurrency deposits and some are valid for fiat currency deposits. Some of these statuses are
used by Bitazza internally, yet they may appear on returned Deposit Ticket
information. Deposit ticket statuses: 0 New (new ticket awaiting operator review) 1 AdminProcessing (An admin is looking at the ticket) 2 Accepted (An admin accepts the ticket) 3 Rejected (Admin rejects the ticket) 4 SystemProcessing (automatic processing; an unlikely status for a deposit) 5 FullyProcessed (the deposit has concluded) 6 Failed (the deposit failed for some reason) 7 Pending (Account Provider has set status to pending) 8 Confirmed (Account Provider confirms the deposit) 9 AmlProcessing (anti-money-laundering process underway) 10 AmlAccepted (anti-money-laundering process successful) 11 AmlRejected (deposit did not stand up to anti-money-laundering process) 12 AmlFailed (anti-money-laundering process failed/did not complete) 13 LimitsAccepted (deposit meets limits for fiat or crypto asset) 14 LimitsRejected (deposit does not meet limits for fiat or crypto asset) |
| feeAmt | real. The fee assessed by the Exchange for making the deposit, if any. Such a fee normally is assessed in the asset being deposited. |
| updatedByUser | integer. The user ID of the person who made the most recent update to the deposit ticket. This user should be an admin (Operator). |
| updatedByUserName | string. The user name of the person (admin/Operator) who made the most recent update to the deposit ticket. |
| ticketNumber | integer. Number of the ticket on the Exchange. |
| depositInfo | object. A set of key-value pairs that holds information about the source of funds being deposited. This information was entered when the deposit ticket was created, as required by the Account Provider. It can vary from Account Provider to Account Provider. |
| createdTimeStamp | string. The date and time that the deposit ticket was created, in Microsoft Ticks format. All dates and times are UTC. |
| lastupdateTimeStamp | string. The date and time stamp that the deposit ticket last was updated, in Microsoft Ticks format. All dates and times are UTC. |
| comments | string. Any comment appended to the deposit ticket. |
| attachments | string. Any attachment to the deposit ticket. |
GetOMSWithdrawFees
Category: System
Permissions: Operator, Withdraw
Call
Type: Synchronous
Returns an array of objects, each of which describe a fee assessed on a specific product (asset).
Request
{
"OMSId": 1,
"ProductId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the produce (asset) is traded. |
| ProductId | integer. The ID of the product (asset) for which you want a list of fees. |
Response
[
{
"OMSId": 1,
"AccountId": 0,
"FeeId": 47,
"FeeAmt": 1,
"FeeCalcType": "Percentage",
"IsActive": false,
"ProductId": 1
},
]
The Response is an array of objects, each describing a fee.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the product (asset) is traded. |
| AccountId | integer. The ID of the account requesting the withdrawal fee information. Withdrawal fees may vary between accounts. The system "knows" the account of the requesting user. |
| FeeId | integer. The ID of the fee reported in this object. |
| FeeAmt | real. The fee assessed for this product. If FeeCalcType is Percentage, this value is the percentage of the fee. If the FeeCalcType is FlatRate, this value is the number of units and fractions of units of the product. The Exchange usually assesses withdrawal fees in the product being withdrawn. |
| FeeCalcType | string. The way the fee is calculated, either as a flat rate (FlatRate) or as a percentage (Percentage) of the withdrawal. |
| IsActive | Boolean. A true value signifies that this fee is active for this product; a false value that the fee is not active for this product. |
| ProductId | integer. The ID of the product (asset) against which the fee is assessed. |
GetWithdrawFee
Category: User
Permissions: Operator, Trading,
Withdraw
Call Type: Synchronous
Gets an estimate of a fee for a withdrawal. The Products function of the Bitazza Admin can set withdraw fees OMS-wide. You can also set a withdraw fee programmatically using SetOMSFee, but SetOMSFee is a System (not User) call with permission reserved to an exchange operator. Exchange-wide withdrawal fees cannot be overridden.
A user with Trading or Withdraw permissions can obtain withdrawal fee estimates only for products and accounts with which the user is associated; a user with Operator permission can obtain withdrawal fee estimates for any product or account.
Request
{
"OMSId": 1,
"AccountId": 1,
"ProductId": 1,
"Amount": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System trading the product. |
| AccountId | integer. The ID of the account making the withdrawal. |
| ProductId | integer. The ID of the product intended to be withdrawn. Fees may vary with product. |
| Amount | real. The amount of product intended to be withdrawn. |
Response
{
"FeeAmount":1.06
}
| Key | Value |
|---|---|
| FeeAmount | real. The estimated amount of the fee for the indicated withdrawal. |
GetWithdraws
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Returns a list of withdrawals for a given account ID.
Users with Trading permission can return withdrawals only for an account with which they are associated; users with Operator permission can return withdrawals for any account.
Request
{
"OMSId": 1,
"AccountId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the withdrawal was issued. |
| AccountId | integer. The ID of the account for which withdrawal information will be returned. |
Response
[
{
"amount": 0.0,
"feeAmount": 0.0,
"notionalValue": 0.0,
"withdrawId": 0,
"assetManagerId": 0,
"accountId": 0,
"assetId": 0,
"templateForm": "{
“TemplateType”: “TetherRPCWithdraw”,
“Comment”: “TestWithdraw”,
“ExternalAddress”: “ms6C3pKAAr8gRCcnVebs8VRkVrjcvqNYv3”
}",
"templateFormType": "TetherRPCWithdraw",
"omsId": 0,
"TicketStatus": 0,
"ticketNumber": 0,
"WithdrawTransactionDetails": "",
"withdrawType": "",
"withdrawCode": "490b4fa3-53fc-44f4-bd29-7e16be86fba3",
"AssetType": 0,
"reaccepted": true,
"notionalProductId": 0
},
]
The Response is an array of withdrawals made on the specified Order Management System for the specified account.
| Key | Value |
|---|---|
| amount | real. The amount of product or fractions of product being withdrawn (not the dollar value, unless the products being withdrawn are dollars). |
| feeAmount | real. The amount of withdrawal fee charged. Withdrawal fees usually are charged in the product being withdrawn. |
| notionalValue | real. In some regions, withdrawals in cryptocurrency must first be converted to the local currency. Thus, the "notional value" of a withdrawal is the value of the cryptocurrency expressed in the local fiat currency. |
| withdrawId | integer. The ID of this withdrawal, assigned by the system. |
| assetManagerId | integer. The ID of the Asset Manager through which the withdrawal was made. |
| accountId | integer. The ID of the account from which the withdrawal was made. |
| assetId | integer. The ID of the asset (product) being withdrawn. |
| templateform | string. The contents of the withdrawal template (key-value pairs). Templates vary from Account Provider to Account Provider, depending on the asset being withdrawn and the identity of the Account Provider. |
| templateFormType | string. The name of the withdrawal template. The template controls the destination of the asset being withdrawn. To get a list of withdrawal templates available to you, call GetWithdrawTemplateTypes. |
| omsId | integer. The ID of the Order Management System on which the withdrawal occurred. |
| TicketStatus | integer. The current status of the withdrawal ticket. Some of these statuses are valid
only for cryptocurrency withdrawals (which uses an automated withdrawal process), and some are valid for
fiat currency withdrawals (which requires a human admin operator). Some of these statuses are used by the
Bitazza Exchange internally, yet they may appear on a returned withdrawal
ticket. Withdraw ticket statuses: 0 New (awaiting operator review) 1 AdminProcessing (An admin is looking at the ticket) 2 Accepted (withdrawal will proceed) 3 Rejected (admin or automatic rejection) 4 SystemProcessing (automatic processing underway) 5 FullyProcessed (the withdrawal has concluded) 6 Failed (the withdrawal failed for some reason) 7 Pending (the admin has placed the withdrawal in pending status) 8 Pending2Fa (user must click 2-factor authentication confirmation link) 9 AutoAccepted (withdrawal will be automatically processed) 10 Delayed (waiting for funds to be allocated for the withdrawal) 11 UserCanceled (withdraw canceled by user or Superuser) 12 AdminCanceled (withdraw canceled by Superuser) 13 AmlProcessing (anti-money-laundering process underway) 14 AmlAccepted (anti-money-laundering process complete) 15 AmlRejected (withdrawal did not stand up to anti-money-laundering process) 16 AmlFailed (withdrawal did not complete anti-money-laundering process) 17 LimitsAccepted (withdrawal meets limits for fiat or crypto asset) 18 LimitsRejected (withdrawal does not meet limits for fiat or crypto asset) 19 Submitted (withdrawal sent to Account Provider; awaiting blockchain confirmation) 20 Confirmed (Account Provider confirms that withdrawal is on the blockchain) 21 ManuallyConfirmed (admin has sent withdrawal via wallet or admin function directly; marks ticket as FullyProcessed; debits account) 22 Confirmed2Fa (user has confirmed withdraw via 2-factor authentication.) |
| ticketNumber | integer. The number of the ticket, as assigned by the system (different from the ID of the withdrawal). |
| withdrawTransactionDetails | JSON string object. Dynamic information that changes from Account Provider to Account
Provider. The values of withdrawTransactionDetails may (but do not have to) include key-value
pairs for: TxId transaction ID ExternalAddress Amount Confirmed LastUpdated TimeSubmitted AccountProviderName |
| withdrawType | string. Shows whether the withdrawal is cryptocurrency or fiat (national) currency. |
| withdrawCode | string. A GUID that uniquely identifies the withdrawal (as opposed to the ticket representing the withdrawal). The value for widrawCode is the same as requestCode as returned by GetWithdrawTicket and GetWithdrawTickets. |
| AssetType | integer. Describes the nature of the product. One of: 0 Unknown (an error condition) 1 NationalCurrency 2 CryptoCurrency 3 Contract |
| reaccepted | Boolean. If a ticket was initially rejected, but later accepted for withdrawal, true shows that the ticket was re-accepted for processing after an initial rejection. |
| notionalProductId | integer. In those regions where withdrawal of cryptocurrency must be expressed in terms of local fiat currency, the notionalProductId expresses that local currency. |
GetWithdrawTemplate
Category: System
Permissions: Operator, Withdraw
Call
Type: Synchronous
Returns the text of the specific withdrawal template. To find out what templates are available to you, call GetWithdrawTemplateTypes.
Request
{
"OMSId": 1,
"ProductId": 1,
"TemplateType": "Template Name",
"AccountId": 1,
"AccountProviderId": 1
}
The system "knows" which Account Provider's withdrawal template to return based on the product ID and the template name you provide. There is usually only one Account Provider per product on an Exchange. AccountId and AccountProviderId therefore are optional key-value pairs.
| Key | Value |
|---|---|
| OMSId | integer. REQUIRED The ID of the Order Management System on which the withdrawal will be made. |
| ProductId | integer. REQUIRED The ID of the product (asset) about to be withdrawn. |
| TemplateType | string. REQUIRED The name of the withdrawal template you want to return. |
| AccountId | integer. OPTIONAL The ID of the account from which you plan to make the withrawal. |
| AccountProviderId | integer. OPTIONAL The ID of the Account Provider you plan to use for the withdrawal. |
Response
{
"Template": "",
"result": true,
"errormsg": "",
"statuscode": 0
}
The Response returns the key-value pairs of the template, along with any error messages about the call. The text of the template will vary from Account Provider to Account Provider.
| Key | Value |
|---|---|
| Template | string. The key-value pairs of the template inside a JSON string. |
| result | Boolean. Returns true if the call is successfully received; otherwise false. |
| errormsg | string. A successful receipt of the call returns null. The errormsg
for an unsuccessful call returns one of: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorvode 104) Operation Not Supported (errorcode 106) |
| statuscode | integer. If result is false, statuscode can
return: 32 Not Authorized 33 AssetManager_Not_Found If no Account Provider is located, statuscode returns null. |
GetWithdrawTemplateTypes
Category: System
Permissions: Operator, Withdraw
Call
Type: Synchronous
Returns a list of template names that are appropriate to the product (asset) named in the Request. To obtain the key-value pairs of the template itself, call GetWithdrawTemplate with the template name you obtain here.
Users with Withdraw permission can get a withdraw template type suitable only for their accounts and permitted products. Users with Operator permission can get template types suitable for any account and product.
Request
{
"OMSId": 1,
"ProductId": 1
}
The system "knows" what Account Provider templates are suitable to your account and product permissions.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System from which you plan to make the withdrawal. |
| ProductId | integer. The ID of the product (asset) that you plan to withdraw. |
Response
{
"TemplateTypes": [
"Standard"
],
"result": false,
"errormsg": "",
"statuscode": 0
}
| Key | Value |
|---|---|
| TemplateTypes | array of strings. An array of the names of the templates that are appropriate to the withdrawal of your asset, account, and Order Management System. If the call was unsuccessful, TemplateTypes may return an empty array. |
| result | Boolean. If the call has been successfully received by the Order Management System, returns true; otherwise returns false. |
| errormsg | string. A successful receipt of the call returns null. The errormsg
key for an unsuccessful call can return: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| statuscode | integer. If result is false, statuscode can
return: 32 Not Authorized 33 Asset_Manager_Not_Found If not account provider is located, statuscode returns null. |
GetWithdrawTicket
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Returns a single withdrawal ticket that matches all values in the Request. No optional fields; partial matches are not returned.
Request
{
"OMSId": 1,
"AccountId": 1,
"RequestCode": "1d3d01eb-9e7b-47e0-9056-db420bf157ee"
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System through which the withdrawal was made. |
| AccountId | integer. The ID of the Account from which the withdrawal was made. |
| RequestCode | string. The GUID assigned by the system to the withdraw ticket on creation. The call GetWithdrawTickets can return a set of RequestCode values to allow you to zero-in on an unknown ticket RequestCode. |
Response
{
"assetManagerId": 0,
"accountId": 0,
"assetId": 0,
"assetName": "",
"amount": 0.0,
"templateForm": "{
“TemplateType”: “TetherRPCWithdraw”,
“Comment”: “TestWithdraw”,
“ExternalAddress”: “ms6C3pKAAr8gRCcnVebs8VRkVrjcvqNYv3”,
}",
"templateFormType": "ThetherRPCWithdraw",
"omsId": 0,
"requestCode": "490b4fa3-53fc-44f4-bd29-7e16be86fba3",
"requestIP": "",
"requestUserId": 0,
"requestUserName": "",
"operatorId": 0,
"Status": 0,
"feeAmt": 0.0,
"updatedByUser": 0,
"updatedByUserName": "",
"ticketNumber": 0,
"createdTimestamp": "0001-01-01T00:00:00",
"lastUpdateTimestamp": "0001-01-01T00:00:00",
"Comments": "[
{
"commentId": 0,
"enteredBy": 0,
"enteredDateTime": "0001-01-01T00:00:00",
"comment": "",
"operatorId": 0,
"omsId": 0,
"ticketCode": "",
"ticketId": 0
}
]",
"Attachments": "[
{
"attachmentId": 0,
"submittedByUserId": 0,
"submittedByUserName": "",
"uploadDate": "0001-01-01T00:00:00",
"uploadIP": "",
"ticketNumber": 0
}
]",
"AuditLog": "[]"
}
| Key | Value |
|---|---|
| assetManagerId | integer. The ID of the Asset Manager through which the withdrawal was made. |
| accountId | integer. The ID of the account that made the withdrawal. |
| assetId | integer. The ID of the asset (product) that was withdrawn. Withdrawal fees (if any) are usually assessed in the same asset that was withdrawn. |
| assetName | string. The short name of the asset. For example, BTC for BitCoin or USD for US Dollars. |
| amount | real. The number of units or fractions of units of the asset that were withdrawn (not the asset's monetary value). For example, 2.5 BitCoin or 2018.00 US Dollars. |
| templateForm | JSON string object. The contents of the template form vary from Account Provider to Account Provider depending on the asset being withdrawn and the identity of the Account Provider. The Response returns this information as a string, not an object. |
| templateFormType | string. The name of the template being used. Templates vary from Account Provider to Account Provider. |
| omsId | integer. The ID of the Order Management System on which the withdrawal was made. |
| requestCode | string. A globally unique identifier (GUID) that identifies this specific withdrawal. |
| requestIP | string. The IP address from which the withdrawal was initiated. |
| requestUserId | integer. The user ID of the user who submitted the withdrawal. |
| requestUserName | string. The user name of the user who submitted the withdrawal. For example, jsmith. |
| operatorId | integer. The ID of the administrator (operator) who processed the withdrawal. Withdrawals of cryptocurrency are handled automatically; withdrawals of fiat (national) currency are approved by a human operator. |
| Status | integer. The current status of the withdrawal ticket. Some of these statuses are valid
only for cryptocurrency withdrawals, which uses an automated withdrawal process, and some are valid for
fiat currency withdrawals, which requires a human admin (operator). Some of these statuses are used by
Bitazza internally, yet they may appear on a returned Withdraw Ticket. Withdraw ticket statuses: 0 New (awaiting operator review) 1 AdminProcessing (An admin is looking at the ticket) 2 Accepted (withdrawal will proceed) 3 Rejected (admin or automatic rejection) 4 SystemProcessing (automatic processing underway) 5 FullyProcessed (the withdrawal has concluded) 6 Failed (the withdrawal failed for some reason) 7 Pending (the admin has placed the withdrawal in pending status) 8 Pending2Fa (user must click 2-factor authentication confirmation link) 9 AutoAccepted (withdrawal will be automatically processed) 10 Delayed (waiting for funds to be allocated for the withdrawal) 11 UserCanceled (withdraw canceled by user or Superuser) 12 AdminCanceled (withdraw canceled by Superuser) 13 AmlProcessing (anti-money-laundering process underway) 14 AmlAccepted (anti-money-laundering process complete) 15 AmlRejected (withdrawal did not stand up to anti-money-laundering process) 16 AmlFailed (withdrawal did not complete anti-money-laundering process) 17 LimitsAccepted (withdrawal meets limits for fiat or crypto asset) 18 LimitsRejected (withdrawal does not meet limits for fiat or crypto asset) 19 Submitted (withdrawal sent to Account Provider; awaiting blockchain confirmation) 20 Confirmed (Account Provider confirms that withdrawal is on the blockchain) 21 ManuallyConfirmed (admin has sent withdrawal via wallet or admin function directly; marks ticket as FullyProcessed; debits account) 22 Confirmed2Fa (user has confirmed withdraw via 2-factor authentication.) |
| feeAmt | real. The amount of any fee that was charged for the withdrawal. feeAmt is always denominated in the asset or product that was withdrawn. |
| updatedByUser | integer. The user ID of the most recent user who may have updated the withdrawal ticket. This user is usually an admin (operator). |
| updatedByUserName | string. The user name of the most recent user who may have updated the withdrawal ticket. This user is usually an admin (operator). |
| ticketNumber | integer. The number of the ticket, as assigned by the system. |
| createdTimeStamp | string. The time and date when the withdrawal ticket was created, in Microsoft Ticks format. All times and dates are UTC. |
| lastUpdateTimeStamp | string. The time and date when the withdrawal ticket was last updated, in Microsoft Ticks format. All times and dates are UTC. |
| Comments | array of JSON string objects. An array of key-value pairs appended as comments to the withdrawal ticket. See Comments example. |
| Attachments | array of JSON string objects. An array of any attachments appended to the withdrawal ticket. See Attachments example. |
| AuditLog | array of JSON string objects. Reserved for future use. |
Comments Example
Comments Example
"Comments":"[
{
"commentId": 0,
"enteredBy": 0,
"enteredDateTime": "0001-01-01T00:00:00",
"comment": "",
"operatorId": 0,
"omsId": 0,
"ticketCode": "",
"ticketId": 0
}
]",
Comments appear as an array.
| Key | Value |
|---|---|
| commentId | integer. The ID assigned to the comment by the system. |
| enteredBy | integer. The ID of the user who entered the comment. |
| enteredDateTime | string. The time and date that the comment was entered, in Microsoft Ticks format. All times and dates are UTC. |
| comment | string. The text of the comment. |
| operatorId | integer. The ID of the admin (operator) making the comment. |
| omsId | integer. The ID of the Order Management System where the withdrawal ticket and comment were created. (They are unlikely to be different). |
| ticketCode | string. A globally unique ID (GUID) assigned by the system that identifies the ticket. |
| ticketId | integer. The ID of the ticket as assigned by the system. |
Attachments Example
Attachments Example
"Attachments":"[
{
"attachmentId": 0,
"submittedByUserId": 0,
"submittedByUserName": "",
"uploadDate": "0001-01-01T00:00:00",
"uploadIP": "",
"ticketNumber": 0
}
]",
Any attachments appear as an array.
| Key | Value |
|---|---|
| attachmentId | integer. The ID assigned to the attachment by the system. |
| submittedByUserId | integer. The user ID of the person who added the attachment to the withdrawal ticket. |
| submittedByUserName | integer. The user name of the person who submitted the attachment. |
| uploadDate | string. The date and time that the attachment was uploaded, in Microsoft Ticks format. All times and dates are UTC. |
| uploadIP | string. The IP address from which the attachment was uploaded. |
| ticketNumber | long integer. The number of the withdrawal ticket, as assigned by the system. |
GetWithdrawTickets
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Returns a limited array of withdrawal tickets from the specified Order Management System and account.
GetWithdrawTickets is usable with Operator and Trading permissions. It returns tickets from a single account. A similar call, GetAllWithdrawTickets, can be used only with Operator permission and returns tickets from all accounts.
Request
{
"OMSId": 1,
"AccountId": 1,
"StartIndex": 0,
"Limit": 200
}
The key-value pairs StartIndex and Limit are optional. The oldest ticket is ticket 0. This differs from other calls where the newest ticket is ticket 0. The value of StartIndex is a pointer into the stream of withdrawal tickets, and the value of Limit shows how far into the past (towards ticket 0) to return tickets. For example, if there are 1500 current tickets (oldest ticket 0 through newest ticket 1499), StartIndex = 100, and Limit = 100; then GetWithdrawTickets would return ticket numbers 1399 through 1300.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System where the withdrawal tickets reside. |
| AccountId | integer. The ID of the account from which the withdrawals were made. A user with Operator permission can return withdrawal tickets for any account; a user with Trading permission can return withdrawal tickets only for an account with which that user is associated. |
| StartIndex | integer. OPTIONAL A pointer into the stream of withdrawal tickets. The oldest ticket is ticket 0. The default value for StartIndex is 0. |
| Limit | integer. OPTIONAL The number of withdrawal tickets to return, beginning at the ticket marked by StartIndex. The default value for Limit is 200. |
Response
[
{
"assetManagerId": 0,
"accountId": 0,
"assetId": 0,
"assetName": "",
"amount": 0.0,
"templateForm": "{
“TemplateType”: “TetherRPCWithdraw”,
“Comment”: “TestWithdraw”,
“ExternalAddress”: “ms6C3pKAAr8gRCcnVebs8VRkVrjcvqNYv3”,
}",
"templateFormType": "ThetherRPCWithdraw",
"omsId": 0,
"requestCode": "490b4fa3-53fc-44f4-bd29-7e16be86fba3",
"requestIP": "",
"requestUserId": 0,
"requestUserName": "",
"operatorId": 0,
"Status": 0,
"feeAmt": 0.0,
"updatedByUser": 0,
"updatedByUserName": "",
"ticketNumber": 0,
"createdTimestamp": "0001-01-01T00:00:00",
"lastUpdateTimestamp": "0001-01-01T00:00:00",
"Comments": "[
{
"commentId": 0,
"enteredBy": 0,
"enteredDateTime": "0001-01-01T00:00:00",
"comment": "",
"operatorId": 0,
"omsId": 0,
"ticketCode": "",
"ticketId": 0
}
]",
"Attachments": "[
{
"attachmentId": 0,
"submittedByUserId": 0,
"submittedByUserName": "",
"uploadDate": "0001-01-01T00:00:00",
"uploadIP": "",
"ticketNumber": 0
}
]",
"AuditLog": "[]"
}
]
The Response is an array of detail information about the withdrawal.
| Key | Value |
|---|---|
| assetManagerId | integer. The ID of the Asset Manager through which the withdrawal was made. |
| accountId | integer. The ID of the account that made the withdrawal. |
| assetId | integer. The ID of the asset (product) that was withdrawn. Withdrawal fees (if any) are usually assessed in the same asset that was withdrawn. |
| assetName | string. The short name of the asset. For example, BTC for BitCoin or USD for US Dollars. |
| amount | real. The number of units or fractions of units of the asset that were withdrawn (not the asset's monetary value). For example, 2.5 BitCoin or 2018.00 US Dollars. |
| templateForm | JSON string object. The contents of the template form vary from Account Provider to Account Provider depending on the asset being withdrawn and the identity of the Account Provider. The Response returns this information as a string. |
| templateFormType | string. The name of the template being used. Templates vary from Account Provider to Account Provider. |
| omsId | integer. The ID of the Order Management System on which the withdrawal was made. |
| requestCode | string. A globally unique identifier (GUID) that identifies this specific withdrawal. |
| requestIP | string. The IP address from which the withdrawal was initiated. |
| requestUserId | integer. The user ID of the user who submitted the withdrawal. |
| requestUserName | string. The user name of the user who submitted the withdrawal. For example, jsmith. |
| operatorId | integer. The ID of the administrator (operator) who processed the withdrawal. Withdrawals of cryptocurrency are handled automatically; withdrawals of fiat (national) currency are approved by a human operator. |
| Status | integer. The current status of the withdrawal ticket. Some of these statuses are valid
only for cryptocurrency withdrawals, which uses an automated withdrawal process, and some are valid for
fiat currency withdrawals, which requires a human admin (operator). Some of these statuses are used by
Bitazza internally, yet they may appear on a returned Withdraw Ticket. Withdraw ticket statuses: 0 New (awaiting operator review) 1 AdminProcessing (An admin is looking at the ticket) 2 Accepted (withdrawal will proceed) 3 Rejected (admin or automatic rejection) 4 SystemProcessing (automatic processing underway) 5 FullyProcessed (the withdrawal has concluded) 6 Failed (the withdrawal failed for some reason) 7 Pending (the admin has placed the withdrawal in pending status) 8 Pending2Fa (user must click 2-factor authentication confirmation link) 9 AutoAccepted (withdrawal will be automatically processed) 10 Delayed (waiting for funds to be allocated for the withdrawal) 11 UserCanceled (withdraw canceled by user or Superuser) 12 AdminCanceled (withdraw canceled by Superuser) 13 AmlProcessing (anti-money-laundering process underway) 14 AmlAccepted (anti-money-laundering process complete) 15 AmlRejected (withdrawal did not stand up to anti-money-laundering process) 16 AmlFailed (withdrawal did not complete anti-money-laundering process) 17 LimitsAccepted (withdrawal meets limits for fiat or crypto asset) 18 LimitsRejected (withdrawal does not meet limits for fiat or crypto asset) 19 Submitted (withdrawal sent to Account Provider; awaiting blockchain confirmation) 20 Confirmed (Account Provider confirms that withdrawal is on the blockchain) 21 ManuallyConfirmed (admin has sent withdrawal via wallet or admin function directly; marks ticket as FullyProcessed; debits account) 22 Confirmed2Fa (user has confirmed withdraw via 2-factor authentication.) |
| feeAmt | real. The amount of any fee that was charged for the withdrawal. feeAmt is always denominated in the asset or product that was withdrawn. |
| updatedByUser | integer. The user ID of the most recent user who may have updated the withdrawal ticket. This user is usually an admin (operator). |
| updatedByUserName | string. The user name of the most recent user who may have updated the withdrawal ticket. This user is usually an admin (operator). |
| ticketNumber | integer. The number of the ticket, as assigned by the system. |
| createdTimeStamp | string. The time and date when the withdrawal ticket was created, in Microsoft Ticks format. All times and dates are UTC. |
| lastUpdateTimeStamp | string. The time and date when the withdrawal ticket was last updated, in Microsoft Ticks format. All times and dates are UTC. |
| Comments | array of JSON string objects. An array of key-value pairs appended as comments to the withdrawal ticket. See Comments example. |
| Attachments | array of JSON string objects. An array of any attachments appended to the withdrawal ticket. See Attachments example. |
| AuditLog | array of JSON string objects. Reserved for future use. |
Comments Example
Comments Example
"Comments":"[
{
"commentId": 0,
"enteredBy": 0,
"enteredDateTime": "0001-01-01T00:00:00",
"comment": "",
"operatorId": 0,
"omsId": 0,
"ticketCode": "",
"ticketId": 0
}
]",
Comments appear as an array.
| Key | Value |
|---|---|
| commentId | integer. The ID assigned to the comment by the system. |
| enteredBy | integer. The ID of the user who entered the comment. |
| enteredDateTime | string. The time and date that the comment was entered, in Microsoft Ticks format. All times and dates are UTC. |
| comment | string. The text of the comment. |
| operatorId | integer. The ID of the admin (operator) making the comment. |
| omsId | integer. The ID of the Order Management System where the withdrawal ticket and comment were created. (They are unlikely to be different). |
| ticketCode | string. A globally unique ID (GUID) assigned by the system that identifies the ticket. |
| ticketId | integer. The ID of the ticket as assigned by the system. |
Attachments Example
Attachments Example
"Attachments":"[
{
"attachmentId":0,
"submittedByUserId":0,
"submittedByUserName":"",
"uploadDate":"0001-01-01T00:00:00",
"uploadIP":"",
"ticketNumber":0
}
]",
Any attachments appear as an array.
| Key | Value |
|---|---|
| attachmentId | integer. The ID assigned to the attachment by the system. |
| submittedByUserId | integer. The user ID of the person who added the attachment to the withdrawal ticket. |
| submittedByUserName | integer. The user name of the person who submitted the attachment. |
| uploadDate | string. The date and time that the attachment was uploaded, in Microsoft Ticks format. All times and dates are UTC. |
| uploadIP | string. The IP address from which the attachment was uploaded. |
| ticketNumber | long integer. The number of the withdrawal ticket, as assigned by the system. |
SubmitDepositTicketComment
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Creates a comment and attaches that comment to a specific deposit ticket.
Request
{
"commentId": 0,
"enteredBy": 0,
"enteredDateTime": "0001-01-01T00:00:00",
"comment": "",
"operatorId": 0,
"omsId": 0,
"ticketCode": "43d1a9f0-8dc3-46f9-b457-297c800d8c9c",
"ticketId": 0
}
| Key | Value |
|---|---|
| commentId | integer. The ID of this specific comment. In the Request, set this to 0. The Response supplies the system-assigned value for commentId. |
| enteredBy | integer. The user ID of the user making the comment. If an operator (admin) is making the request, this should be the generic user ID of the admin (not the operator ID). |
| enteredDateTime | string. The date and time that the comment was created, in Microsoft Ticks format and UTC time. |
| comment | string. The comment string itself. |
| operatorId | integer. The ID of an operator (admin) making the comment. The value for operatorId should be available programmatically from the ticket being commented. |
| omsId | integer. The ID of the Order Management System on which the deposit is being made. |
| ticketCode | string. A GUID (globally unique identifier) that identifies the deposit ticket to which the comment is attached. The value for ticketCode should be available programmatically from the ticket being commented. |
| ticketId | integer. An ID assigned by the system to the ticket. You can obtain this value from the calls CreateDepositTicket, GetAllDepositTickets, GetDepositTicket, and GetDepositTickets. In all these calls, the key is named ticketNumber. |
Response
{
"success": true,
"commentid": 10000002
}
| Key | Value |
|---|---|
| success | Boolean. A true value means that the comment has been successfully attached to the deposit ticket; false means that it has not been attached. |
| commentId | integer. The ID assigned by the system to this specific comment. |
SubmitWithdrawTicketComment
Category: System
Permissions: Operator, Trading
Call
Type: Synchronous
Creates a comment and attaches that comment to a specific withdrawal ticket.
Request
{
"commentId": 0,
"enteredBy": 0,
"enteredDateTime": "0001-01-01T00:00:00",
"comment": "",
"operatorId": 0,
"omsId": 0,
"ticketCode": "43d1a9f0-8dc3-46f9-b457-297c800d8c9c",
"ticketId": 0
}
| Key | Value |
|---|---|
| commentId | integer. The ID of this specific comment. In the Request, set this to 0. The Response supplies the system-assigned value for commentId. |
| enteredBy | integer. The user ID of the user making the comment. If an operator (admin) is making the request, this should be the generic user ID of the admin (not the operator ID). |
| enteredDateTime | string. The date and time that the comment was created, in Microsoft Ticks format and UTC time. |
| comment | string. The comment string itself. |
| operatorId | integer. The ID of an operator (admin) making the comment. The value for operatorId should be available programmatically from the ticket being commented. |
| omsId | integer. The ID of the Order Management System on which the withdrawal is being made. |
| ticketCode | string. A GUID (globally unique identifier) that identifies the withdrawal ticket to which the comment is attached. The value for ticketCode should be available programmatically from the ticket being commented. |
| ticketId | integer. An ID assigned by the system to the ticket. You can obtain this value from the calls GetWithdrawTicket, GetAllWithdrawTickets, and GetWithdrawTickets. In all these calls, the key is named ticketNumber. |
Response
{
"success": true,
"commentid": 10000002
}
| Key | Value |
|---|---|
| success | Boolean. A true value means that the comment has been successfully attached to the withdrawal ticket; false means that it has not been attached. |
| commentId | integer. The ID assigned by the system to this specific comment. |
Miscellaneous
These are User-category calls that don't fit well into the Admin Guide organization.
GetEarliestTickTime
Category: User
Permissions: Operator, Level1MarketData
Call
Type: Synchronous
Gets the earliest ticker reading of the trading day.
Users with Level1MarketData permission can obtain the earliest tick time only for an instrument they have permission to trade; users with Operator permission can get earliest tick time for any instrument.
Request
{
"InstrumentId": 1,
"OMSId": 1
}
| Key | Value |
|---|---|
| InstrumentId | integer. The ID of an instrument on the Order Management System for which the earliest ticker time is being requested. |
| OMSId | integer The ID of the Order Management System that will return the earliest ticker time of the day. |
Response
[
1501603632000 \\DateTime - UTC - Milliseconds since 1/1/1970
]
Despite the array brackets, the response returns a single value.
| Key | Value |
|---|---|
| 1501603632000 | long integer Time of the earliest ticker tick, in POSIX format and UTC. |
Ping
Category: User
Permissions: Public
Call Type:
Synchronous
Used to keep a connection alive.
Request
{ }
Ping requires no payload.
Response
{
"msg": "PONG"
}
Response is PONG.
AddEditExchange
Category: System
Permissions: SUPERUSER
Call Type: Synchronous
Adds a new logical Exchange to a running matching engine or updates an existing Exchange.
Only a SUPERUSER can create or update a new logical Exchange.
Request
{
"exchangeServiceId": "V2ExchangeCore",
"exchangeId": 0
}
| Key | Value |
|---|---|
| exchangeServiceId | string. The name of the matching engine on which the new Exchange will be created. |
| exchangeId | integer. Assign a value to a newly created exchange or changes the ID of an existing exchange. |
Response
The Response is standard response object
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}
| Key | Value |
|---|---|
| result | Boolean.If the call has been successfully received by the Order Management System, result is true otherwise it is false. |
| errormsg | string. A successful receipt of the call returns null.
The errormsg key for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcodes | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. |
AddEditExchangeInstrument
Category: System
Permissions: SUPERUSER
Call Type: Synchronous
Adds a new instrument (and its market) to an existing Exchange.
Request
Required key-value pairs are marked; other KVPs are optional in the Request.
{
"omsId": 1,
"exchangeServiceId": "V2ExchangeCore"
"exchangeId": 0
"instrumentId": 0
"productPairType": 0
"orderBookType": 0
"productPairId": 0
"productPairId": 0
"product1Id": 0
"product2Id": 0
"minimumQuantity": 0.0
"priceIncrement": 0.0
"symbol": ""
"selfTradePrevention": true
"priceCollarThreshold": 0.0
"priceCollarPercent": 0.0
"priceCollarEnabled": true
"priceFloorLimit": 0.0
"priceFloorLimitEnabled": true
"priceCeilingLimit": 0.0
"priceCeilingLimitEnabled": true
"createWithMarketRunning": true
}
| Key | Value |
|---|---|
| omsId | integer. REQUIRED The ID of the Order Management System on which the instrument will be created. |
| exchangeServiceId | string. The name of the matching engine on which the new instrument will be traded. |
| exchangeId | integer. The ID of the AlphaPoint Exchange on which the instrument will be traded. |
| instrumentId | integer. REQUIRED The value for instrumentId is determined by the system. Set this value to 0 when making the Request; the system responds with the assigned ID. |
| productPairType |
integer. A product pair is the same as instrument.
The value of productPairType is an integer representing the type of instrument.
All instrument types currently are standard (an exchange of one product for another),
or unknown (an error condition). This may expand to new types in the future. One of: 0 Unknown (an error condition) 1 Standard |
| otherBookType |
integer. The type of order book for the Exchange. One of 0 Unknown (an error condition) 1 Standard 2 NoMatching 3 Crossing |
| productPairId | integer. The value for productPairId is determined by the system. Set this value to 0 in the Request; the system responds with the assigned ID. |
| product1Id | integer. The ID of the first product making up the instrument. For example, if the instrument is BTCUSD, BitCoin would be product1 and the ID for the BitCoin asset would be product1Id. |
| product2Id | integer. The ID of the second product making up the instrument. For example, if the instrument is BTCUSD, US Dollar would be product2 and the ID for the USD asset would be product2Id. |
| minimumQuantity | real. The minimum quantity in which the instrument is traded. For example, US Dollars cannot be traded in increments smaller than 1 cent (1/100 of a dollar); there is no half-cent denomination. |
| priceIncrement | real. The smallest value by which the instrument can rise or fall on the Exchange. This is different from the number of decimal places in which the instrument is priced. |
| symbol | string. REQUIRED The alphanumeric characters designating the instrument; for example BTCUSD for the instrument BitCoin/US Dollars. |
| selfTradePrevention | Boolean. An account trading with itself may still incur fees. If this instrument prevents an account from trading the instrument with itself, the value is true, otherwise, the value is false. |
| priceCollarThreshold | real. A price threshold amount beyond the current market price that determines whether a put or call on the instrument is a collar strategy. |
| priceCollarPercent | real. A price threshold percentage beyond the current market price that determines whether a put or a call on the instrument is a collar strategy. |
| priceCollarEnabled | Boolean. A value of true enables purchasing out-of-the-money put options or writing out-of-the-money call options on the instrument. A value of false prevents collar strategies on the instrument. |
| priceFloorLimit | real. A limit for the lowest acceptable price for the instrument on the Exchange, as determined by the Exchange operator. |
| priceFloorLimitEnabled | Boolean. A value of true enables the floor limit, and halts trading in the instrument if the limit is reached. The Exchange operator is also notified by system via email. |
| priceCeilingLimit | real. A limit for the highest acceptable price for the instrument on the Exchange, as determined by the Exchange operator. |
| priceCeilingLimitEnabled | Boolean. A value of true enables the ceiling limit, and halts trading in the instrument if the limit is reached. The Exchange operator is also notified by the system via email. |
| createWithMarketRunning | Boolean. A value of true means that the new instrument is created and immediately available on the operating market. A value of false means that the new instrument must wait for the market to be paused or halted, and will become available once the market restarts. |
Response
The Response is standard response object
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": "",
}
| Key | Value |
|---|---|
| result | Boolean.If the call has been successfully received by the Order Management System, result is true otherwise it is false. |
| errormsg | string. A successful receipt of the call returns null.
The errormsg key for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcodes | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. |
GetOperators
Category: System
Permissions: Operator
Call Type: Synchronous
Returns a list of operators for the Order Management System on which the call is issued. The call cannot be issued for an Order Management System other than the one where the issuing operator is logged in.
Request
There is no Request payload for this call.
{}
Response
[
{
"operatorId": 2,
"OperatorGuid": "e420b702-b7e9-43f6-82f1-8fc442c3329d",
"OperatorName": "CME Operator",
"DefaultOMSId": 1,
"Website": "",
"VerifyURL": "",
"UseEmailVerify": true,
"UseRecaptcha": true,
"RecaptchaPrivateKey": null,
"RecaptchaPublicKey": null
}
]
| Key | Value |
|---|---|
| OperatorId | integer. The ID of the operator. |
| OperatorGuid | string. The globally unique ID (GUID) for the operator. |
| OperatorName | string. The user name of the operator. |
| DefaultOMSId | integer. The ID of the Order Management System that the operator primarily administers. |
| Website | string. The URL of the venue operator's website. This website URL is used to populate email templates. |
| VerifyURL | string. |
| UseEmailVerify | Boolean. A true value tells the Exchange to verify withdrawals using an email and two-factor authentication. A false value requires neither email verification nor 2FA. |
| UseRecaptcha | Boolean. Turns on (true) or off (false) use of Recaptcha for this operator. Recaptcha is a commercial bot detector. |
| RecaptchaPrivateKey | string. An alphanumeric string that is is the operator's private key for the Recaptcha bot detector. |
| RecaptchaPublicKey | string. An alphanumeric string that is the operator's public key for the Recaptcha bot detector. |
GetOperatorUsers (DEPRECATED)
Category: System
Permissions: Operator
Call Type: Synchronous
Returns a list of users who are associated with a specific operator.
In earlier versions of the AlphaPoint Exchange, users were associated with an operator.
This is no longer the case. You should not use this call.
Request
{
"OperatorId": 1
}
| Key | Value |
|---|---|
| OperatorId | integer. The ID of the operator whose corresponding user IDs you want to return. |
Response
The Response is an array of operator IDs and the user IDs associated with them.
[
{
"operatorId": 0,
"userId": 0,
}
]
| Key | Value |
|---|---|
| operatorId | integer. The ID of the operator echoed back from the Request. |
| userId | integer. The user ID associated with that operator ID. |
RemoveOperatorUser (DEPRECATED)
Category: System
Permissions: Operator
Call Type: Synchronous
Removes a single user from association with a given operator.
In earlier versions of the AlphaPoint Exchange, users were associated with an operator. This is no longer the case. You should not use this call.
Request
{
"operatorId": 0
"userId": 0
}
| Key | Value |
|---|---|
| operatorId | integer. The ID of the operator whose user you want to remove. The ID of the operator whose corresponding user IDs you want to return. |
| userId | integer. The ID of the user you want to disassociate from the operator. |
Response
{
"Success": true,
}
| Key | Value |
|---|---|
| Success | Boolean. If true, the user has been successfully removed. If false, the user has not been successfully removed. |
Market Maker API
Bitazza Market Maker API Intergration
Bitazza provides a suite of APIs to facilitate the integration of Market Maker workflows. This document is intended to provide all the relevant technical details to accomplish this. It is required that Operators coordinate with their Account Manager or Production Support team to ensure that adequate disk space has been allocated and the appropriate ip-address rate limits are configured. Bitazza highly recommends conducting a certification of this integration prior to enabling the Market Maker in production. The APIs listed below will provide a complete workflow allowing the Market Maker to submit and manage orders, subscribe to market data, subscribe to all relevant trade and account events and authenticate a user session.
Market Data/Trades APIs
Subscribe user to Level 2 market data for a specific instrument
Unsubscribe user from Level 2 subscription
Subscribe to Trades Market Data Feed for a specific instrument
Unsubscribe user from Trades Market Data Feed
Subscribe user to Ticker Market Data Feed
Unsubscribes user from Ticker Market Data Feed
Order Submission / Order History / Order Events APIs
Create a new order
Cancel an open order
Retrieve the complete list of all orders
Retrieve the state of open orders
Subscribe to notifications about account-level events
Retrieve a list of balances for a specific account
Retrieve the ticker history for a specific instrument
User Authentication / Account / Logout APIs
Authenticate a user for a websocket session
Retrieve a list of account IDs for a specific user
Ends the websocket sessiont
For detailed specifications on all API calls, please review the Bitazza API User Guide.
Authenticate via Key and Signature
AddUserAPIKey
RemoveUserAPIKey
AddUserAPIKeyPermission
RemoveUserAPIKeyPermission
AuthenticateUser
AddUserAPIKey
Endpoint
[
RPCMethodDesc(Name = "AddUserAPIKey",
Description = "Add User APIKey and Secret",
Permissions = "SUPERUSER,Operator,Trading",
PayloadType = "{ \"UserId\": 1, \"APIKey\":\"API Key String\",
\"Permission\":\"Comma separated Permission Names\"}",
ResponseType = "{ \"UserId\": 1, \"APIKey\":\"API Key String\",
\"Permission\":\"Comma separated PermissionNames\" }",
Category = "System")
]
In order to authenticate user via key and signature, user need to create key and secret
using this endpoint. userId needs to be provided along with permission in payload and
key and secrets are generated for user.
The endpoint will return UserAPIKey classtype json string which contains APIKey and
APISecret.
RemoveUserAPIKey
Endpoint
[
RPCMethodDesc(Name = "RemoveUserAPIKey",
Description = "Remove User APIKey and Secret"
Permissions = "SUPERUSER,Operator,Trading",
Payload = "{ \"UserId\": 1, \"APIKey\":\"APIKeyName\" }",
ResponseType = typeof(APIResponse),
Category = "System")
]
In order to remove user from authenticating via key and signature, this endpoint is used. UserId and APIKey need to be provided to remove user.
AddUserAPIKeyPermission
Endpoint
[
RPCMethodDesc(Name = "AddUserAPIKeyPermission",
Description = "Add a permission from an API Key",
Permissions = "SUPERUSER,Operator,Trading",
Payload = "{ \"UserId\": 1, \"APIKey\":\"API Key String\",
\"Permission\":\"Permission Name\" }",
ResponseType = typeof(APIResponse),
Category = "System")
]
RemoveUserAPIKeyPermission
Endpoint
[
RPCMethodDesc(Name = "RemoveUserAPIKeyPermission",
Description = "Remove a permission from an API Key",
Permissions = "SUPERUSER,Operator,Trading",
Payload = "{ \"UserId\": 1, \"APIKey\":\"API Key String\",
\"Permission\":\"PermissionName\" }",
ResponseType = typeof(APIResponse),
Category = "System")
]
These endpoints add and remove permission of user associated with key and signature.
AuthenticateUser
Endpoint
[
RPCMethodDesc(Name = "AuthenticateUser",
Description = "Authenticates a user for the current websocket session.",
Payload = "{ \"UserName\":\"\", \"Password\":\"\" } or { \"APIKey\":\"\",
\"Signature\":\"\",\"UserId\":1,\"Nonce\":12345 }",
Payload = "{ \"UserId\": 1, \"APIKey\":\"API Key String\",
\"Permission\":\"PermissionName\" }",
ResponseType = typeof(AuthenticationResult),
Category = "Authentication",
Permissions = "Public",
IsAuthenticationCall = true)
]
AuthenticateUser Endpoint supports two types of authentications. User can be authenticated using traditional userName, password pair or user can provide an APIKey, Signature, Nonce and UserId.
Example of How to Generate Signature
As an example, on how to generate signature, please use following instructions:
https://codebeautify.org/hmac-generator
Algorithms: HMAC-Sha256
Key: Secret
message: is
composed of nonce, userid and ApiKey in follow format
"nounceUserIdApiKey"
Once you hit "Generate HMAC" it will generate signature. Use this generated signature
while calling "AuthenticateUser".
If you have additional feedback, please email [email protected].
REST API
REST API endpoint: https://apexapi.bitazza.com:8443/AP/
Authenticate
Authenticates a user (logs in a user) and creates a Session which can be used to make subsequent authorized
calls. A successful call to AuthenticateUser returns a JSON object containing the user’s Id, AccountId, OMSId,
and a Session Token.
Store the Token for session identification on all other requests. Store the UserId, AccountId and OMSId for
use in other requests.
Response Payload
{
"Authenticated": true,
"UserId": 1
"Token": "9f59e5c1-11cf-4258-b204-0aed329dc96c",
"AccountId": 4,
"OMSId: 1
}
POST
/AP/Authenticate
https://apexapi.bitazza.com:8443/AP/Authenticate
Headers
Content-Type: application/json
Authorization: Basic Base64Encoded(UserName:Password)
Example: Basic dXNlcjpwYXNzd29yZA==
| Key | Value |
|---|---|
| Authenticated | boolean. True if successfully authenticated. |
| UserId | integer. Your User Id. |
| Token | string. Your current session token. Put this value into the APToken Header on authorized requests. |
| AccountId | integer. Your Account Id. Use this anywhere an AccountId is a required field. |
| OMSId | integer. The ID of the Order Management System your user belongs to. Use this value anywhere OMSId is a required field. |
GetProducts
Returns an array of objects for each Product (Asset or Currency) on the exchange.
Response Payload
[
{
"OMSId": 1,
"ProductId": 1
"Product": "BTC",
"ProductFullName": "BTC",
"ProductType": "CryptoCurrency",
"DecimalPlaces": 8
"TickSize": 0.00000001
"NoFees": false
},
{
"OMSId": 1,
"ProductId": 2
"Product": "USD",
"ProductFullName": "USD",
"ProductType": "NationalCurrency",
"DecimalPlaces": 2
"TickSize": 0.01
"NoFees": false
}
]
GET
/AP/GetProducts
https://apexapi.bitazza.com:8443/AP/GetProducts?OMSId=1
URL-Encoded Parameters
- OMSId [integer] The OMSId you received in the AuthenticateUser Response.
| Key | Value |
|---|---|
| OMSId | integer. The Order Management System ID. |
| ProductId | integer. Identifies the product using an integer value. |
| Product | string. Symbol of the product. |
| ProductFullname | string. The long or full name of the product. |
| ProductType | string. NationalCurrency or CryptoCurrency |
| DecimalPlaces | integer. Number of decimal places representing the smallest unit of the product. |
| TickSize | decimal. Same as DecimalPlaces as a real value. Smallest possible real unit of the product. |
| NoFees | boolean. Specifies if fees cannot be taken in this product. (In the case where this is true, fees will usually be taken in another product depending on the pair.) |
GetInstruments
Returns an array of objects for each Instrument (Trade-able pair of assets) on the exchange.
Response Payload
[
{
"OMSId": 1,
"InstrumentId": 1
"Symbol": "BTCUSD",
"Product1": 1,
"Product1Symbol": "BTC",
"Product2": 2,
"Product2Symbol": "USD",
"InstrumentType": "Standard"
"VenueInstrumentId": 1,
"VenueId": 1,
"SortIndex": 0,
"SessionStatus": "Unknown"
"PreviousSessionStatus": "Unknown"
"SessionStatusDateTime": "0001-01-01T05:00:00Z"
"SelfTradePrevention": false,
"QuantityIncrement": 0.00000001
},
{
"OMSId": 1,
"InstrumentId": 2
"Symbol": "A0USD",
"Product1": 3,
"Product1Symbol": "PE0",
"Product2": 2,
"Product2Symbol": "USD",
"InstrumentType": "Standard"
"VenueInstrumentId": 2,
"VenueId": 1,
"SortIndex": 0,
"SessionStatus": "Unknown"
"PreviousSessionStatus": "Unknown"
"SessionStatusDateTime": "0001-01-01T05:00:00Z"
"SelfTradePrevention": false,
"QuantityIncrement": 0.01
}
]
GET
/AP/GetInstruments
https://apexapi.bitazza.com:8443/AP/GetInstruments?OMSId=1
URL-Encoded Parameters
- OMSId [Integer]
| Key | Value |
|---|---|
| OMSId | integer. The Order Management System ID. |
| InstrumentId | integer. The numeric ID of the Instrument |
| Symbol | string. The string ID of the Instrument |
| Product1 | integer. The numeric ProductId of the first Product which makes up the pair. |
| Product1Symbol | string. The string identifier of the first Product which makes up the pair. |
| Product2 | integer. The numeric ProductId of the second Product which makes up the pair. |
| Product2Symbol | string. The string identifier of the second Product which makes up the pair. |
| IntstrumentType | string. Describes the type of instrument this is. Usually “Standard” |
| VenueInstrumentId | integer. Describes the ID of the instrument on the matching engine. |
| VenueId | integer. Describes the ID of the matching engine the Instrument resides on. |
| SortIndex | integer. Sometimes used to sort Instruments visibly on a UI. |
| SessionStatus | string. Describes the market state for this instrument. “Running”, “Paused”, “Halted” |
| PreviousSessionStatus | string. Describes the previous market state for this instrument. “Running”, “Paused”, “Halted” |
| SessionStatusDateTime | string/datetime. The time the current SessionStatus went into effect. |
| QuantityIncrement | decimal. The smallest tradeable quantity for this Instrument. |
GetAccountPositions
Retrieves a list of positions (balances) and related information.
Response Payload
[
{
"OMSId": 1,
"AccountId": 4
"ProductSymbol": "BTC",
"ProductId": 1,
"Amount": 0,
"Hold": 0,
"PendingDeposits": 0,
"PendingWithdraws": 0,
"TotalDayDeposits": 0,
"TotalDayWithdraws": 0,
"TotalMonthWithdraws": 0
},
{
"OMSId": 1,
"AccountId": 4
"ProductSymbol": "USD",
"ProductId": 2,
"Amount": 0,
"Hold": 0,
"PendingDeposits": 0,
"PendingWithdraws": 0,
"TotalDayDeposits": 0,
"TotalDayWithdraws": 0,
"TotalMonthWithdraws": 0
}
]
GET
/AP/GetAccountPositions
https://apexapi.bitazza.com:8443/AP/GetAccountPositions?OMSId=1&AccountId=4
Headers
- APToken [Token string supplied in AuthenticateUser Response]
URL-Encoded Parameters
- OMSId [Integer]
- AccountId [Integer]
| Key | Value |
|---|---|
| OMSId | integer. The Order Management System ID. |
| AccountId | integer. The Account the position/balance is for. |
| ProductSymbol | string. The symbol of the product the position/balance is for. |
| ProductId | integer. The ID of the product the position/balance is for. |
| Amount | decimal. The total balance/position, including any amount held. |
| Hold | decimal. Represents the amount of the balance that is on hold and cannot be traded or withdrawn. |
| PendingDeposits | decimal. Total amount of deposits not yet confirmed. |
| PendingWithdraws | decimal. Total amount of withdraws not yet confirmed. |
| TotalDayDeposits | decimal. Total amount of deposits in the last 24 hours. |
| TotalDayWithdraws/td> | decimal. Total amount of withdraws in the last 24 hours. |
| TotalMonthWithdraws/td> | decimal. Total amount of withdraws in the last 30 days. |
GetOpenOrders
Returns an array of 0 or more orders that are still active on the market. The call returns an empty array if a user has no open orders.
Response Payload
[
{
"Side": "Buy",
"OrderId": 15069
"Price": 95,
"Quantity": 1,
"DisplayQuantity": 1,
"Instrument": 1,
"Account": 4,
"OrderType": "Limit",
"ClientOrderId": 99,
"OrderState": "Working",
"ReceiveTime": 1503077068361,
"ReceiveTimeTicks": 636386738683614156,
"OrigQuantity": 1,
"QuantityExecuted": 0,
"AvgPrice": 0,
"CounterPartyId": 0,
"ChangeReason": "NewInputAccepted",
"OrigOrderId": 15069,
"OrigClOrdId": 99,
"EnteredBy": 1,
"IsQuote": false,
"InsideAsk": 9223372036.854775807,
"InsideAskSize": 0,
"InsideBid": 95,
"InsideBidSize": 6.82,
"LastTradePrice": 1,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": null,
"OMSId": 1
}
]
GET
/AP/GetOpenOrders
https://apexapi.bitazza.com:8443/AP/GetOpenOrders?OMSId=1&AccountId=4
Headers
- APToken [Token string supplied in AuthenticateUser Response]
URL-Encoded Parameters
- OMSId [Integer]
- AccountId [Integer]
| Key | Value |
|---|---|
| Side | string. “Buy” or “Sell” |
| OrderId | long. The server Id of the order. |
| Price | decimal. Price of the Order. |
| Quantity | decimal. Quantity remaining on the order. |
| DisplayQuantity | decimal. The maximum amount of quantity shown in public market data. Usually equal to the Quantity. |
| Instrument | integer. The InstrumentId the order is for. |
| Account | integer. The Account the order belongs to. |
| OrderType | string. “Market”, “Limit”, “StopMarket”, “StopLimit”, “TrailingStopMarket”, “TrailingStopLimit”, “BlockTrade” |
| ClientOrderId | long. User submitted Id of the order. |
| OrderState | string. “Working”, “FullyExecuted”, “Expired”, “Canceled”, “Rejected” |
| ReceiveTime | long. UTC Epoch Time the order was received. |
| ReceiveTimeTicks | long. Microsoft Ticks Time the order was received. |
| OrigQuantity | decimal. The original quantity the order was submitted for. |
| QuantityExecuted | decimal. The total amount executed against this order. |
| AvgPrice | decimal. DEPRECATED |
| CounterPartyId | integer. This will be 0 unless this is a BlockTrade, in which case it represents the Id of the counterparty the BlockTrade is submitted for. |
| ChangeReason | string. “NewInputAccepted”, “NewInputRejected”, “OtherRejected”, “Expired”, “Trade”, “SystemCanceled_NoMoreMarket”, “SystemCanceled_BelowMinimum”, “SystemCanceled_PriceCollar”, “SystemCanceled_MarginFailed” |
| OrigOrderId | long. If this is a replacement order in a CancelReplaceOrder instruction, this is the OrderId of the canceled order. |
| OrigClOrdId | long. If this is a replacement order in a CancelReplaceOrder instruction, this is the Client Order Id of the canceled order. |
| EnteredBy | integer. The UserId of the user who entered this order. |
| IsQuote | boolean. Specifies if this is a Market Maker Quote. |
| InsideAsk | decimal. The inside (best) ask at the time this order state was last updated. |
| InsideAskSize | decimal. The quantity of the inside (best) ask at the time this order state was last updated. |
| InsideBid | decimal. The inside (best) bid at the time this order state was last updated. |
| InsideBidSize | decimal. The quantity of the inside (best) bid at the time this order state was last updated. |
| LastTradePrice | decimal. The price of the last trade at the time this order state was last updated. |
| RejectReason | string. A description of the reason for rejection, if the OrderState is “Rejected”. |
| IsLockedIn | boolean. In the event the order is a BlockTrade, this describes if only one party is required to enter the trade. |
| CancelReason | string. Describes any comment or reason for an Admin cancellation of this order. |
| OMSId | integer. The Order Management System ID. |
GetOrderHistory
Returns a complete list of all orders, open, filled, canceled and rejected. Limited to 100.
Response Payload
[
{
"Side": "Buy,
"OrderId": 15069
"Price": 95,
"Quantity": 1,
"DisplayQuantity": 1,
"Instrument": 1,
"Account": 4,
"OrderType": "Limit",
"ClientOrderId": 99,
"OrderState": "Working",
"ReceiveTime": 1503077068361
"ReceiveTimeTicks": 636386738683614156
"OrigQuantity": 1
"QuantityExecuted": 0
"AvgPrice": 0
"CounterPartyId": 0
"ChangeReason": "NewInputAccepted"
"OrigOrderId": 15069
"OrigClOrdId": 99
"EnteredBy": 1
"IsQuote": false
"InsideAsk": 9223372036.854775807
"InsideAskSize": 0
"InsideBid": 95
"InsideBidSize": 6.82
"LastTradePrice": 1
"RejectReason": ""
"IsLockedIn": false
"CancelReason": null
"OMSId": 1
},
{
"Side": "Buy,
"OrderId": 15069
"Price": 95,
"Quantity": 0,
"DisplayQuantity": 1,
"Instrument": 1,
"Account": 4,
"OrderType": "Limit",
"ClientOrderId": 15067,
"OrderState": "Canceled",
"ReceiveTime": 1503076964272
"ReceiveTimeTicks": 636386737642718166
"OrigQuantity": 1
"QuantityExecuted": 0
"AvgPrice": 0
"CounterPartyId": 0
"ChangeReason": "UserModified"
"OrigOrderId": 15067
"OrigClOrdId": 99
"EnteredBy": 1
"IsQuote": false
"InsideAsk": 9223372036.854775807
"InsideAskSize": 0
"InsideBid": 95
"InsideBidSize": 6.82
"LastTradePrice": 1
"RejectReason": ""
"IsLockedIn": false
"CancelReason": "UserModified"
"OMSId": 1
}
]
GET
/AP/GetOrderHistory
https://apexapi.bitazza.com:8443/AP/GetOrderHistory?OMSId=1&AccountId=4
Headers
- APToken [Token string supplied in AuthenticateUser Response]
URL-Encoded Parameters
- OMSId [Integer]
- AccountId [Integer]
| Key | Value |
|---|---|
| Side | string. "Buy" or "Sell" |
| OrderId | long. The server Id of the order. |
| Price | decimal. Price of the Order. |
| Quantity | decimal. Quantity remaining on the order. |
| DisplayQuantity | decimal. The maximum amount of quantity shown in public market data. Usually equal to the Quantity. |
| Instrument | integer. The InstrumentId the order is for. |
| Account | integer. The Account the order belongs to. |
| OrderType | string. “Market”, “Limit”, “StopMarket”, “StopLimit”, “TrailingStopMarket”, “TrailingStopLimit”, “BlockTrade” |
| ClientOrderId | long. User submitted Id of the order. |
| OrderState | long. “Working”, “FullyExecuted”, “Expired”, “Canceled”, “Rejected” |
| ReceiveTime | long. UTC Epoch Time the order was received. |
| ReceiveTimeTicks | long. Microsoft Ticks Time the order was received. |
| OrigQuantity | decimal. The original quantity the order was submitted for. |
| QuantityExecuted | decimal. The total amount executed against this order. |
| AvgPrice | decimal. DEPRECATED |
| CountryPartyId | integer. This will be 0 unless this is a BlockTrade, in which case it represents the Id of the counterparty the BlockTrade is submitted for. |
| ChangeReason | string. “NewInputAccepted”, “NewInputRejected”, “OtherRejected”, “Expired”, “Trade”, “SystemCanceled_NoMoreMarket”, “SystemCanceled_BelowMinimum”, “SystemCanceled_PriceCollar”, “SystemCanceled_MarginFailed” |
| OrigOrderId | long. If this is a replacement order in a CancelReplaceOrder instruction, this is the OrderId of the canceled order. |
| OrigClOrdId | long. If this is a replacement order in a CancelReplaceOrder instruction, this is the Client Order Id of the canceled order. |
| EnteredBy | integer. The UserId of the user who entered this order. |
| IsQuote | boolean. Specifies if this is a Market Maker Quote. |
| InsideAsk | decimal. The inside (best) ask at the time this order state was last updated. |
| InsideAskSize | decimal. The quantity of the inside (best) ask at the time this order state was last updated. |
| InsideBid | decimal. The inside (best) bid at the time this order state was last updated. |
| InsideBidSize | decimal. The quantity of the inside (best) bid at the time this order state was last updated. |
| LastTradePrice | decimal. The price of the last trade at the time this order state was last updated. |
| RejectReason | string. A description of the reason for rejection, if the OrderState is “Rejected”. |
| IsLockedIn | boolean. In the event the order is a BlockTrade, this describes if only one party is required to enter the trade. |
| CancelReason | string. Describes any comment or reason for an Admin cancellation of this order. |
| OMSId | integer. The Order Management System ID. |
GetOrderStatus
Retrieves the status of a single order.
Response Payload
{
"Side": "Buy",
"OrderId": 15069
"Price": 95,
"Quantity": 1,
"DisplayQuantity": 1,
"Instrument": 1,
"Account": 4,
"OrderType": "Limit",
"ClientOrderId": 99,
"OrderState": "Working",
"ReceiveTime": 1503077068361,
"ReceiveTimeTicks": 636386738683614156,
"OrigQuantity": 1,
"QuantityExecuted": 0,
"AvgPrice": 0,
"CounterPartyId": 0,
"ChangeReason": "NewInputAccepted",
"OrigOrderId": 15069,
"OrigClOrdId": 99,
"EnteredBy": 1,
"IsQuote": false,
"InsideAsk": 9223372036.854775807,
"InsideAskSize": 0,
"InsideBid": 95,
"InsideBidSize": 6.82,
"LastTradePrice": 1,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": null,
"OMSId": 1
}
GET
/AP/GetOrderStatus
https://apexapi.bitazza.com:8443/AP/GetOrderStatus?OMSId=1&AccountId=4&OrderId=15069
Headers
- APToken [Token string supplied in AuthenticateUser Response]
URL-Encoded Parameters
- OMSId [Integer]
- AccountId [Integer]
- OrderId [Long]
| Key | Value |
|---|---|
| Side | string. "Buy" or "Sell" |
| OrderId | long. The server Id of the order. |
| Price | decimal. Price of the Order. |
| Quantity | decimal. Quantity remaining on the order. |
| DisplayQuantity | decimal. The maximum amount of quantity shown in public market data. Usually equal to the Quantity. |
| Instrument | integer. The InstrumentId the order is for. |
| Account | integer. The Account the order belongs to. |
| OrderType | string. “Market”, “Limit”, “StopMarket”, “StopLimit”, “TrailingStopMarket”, “TrailingStopLimit”, “BlockTrade” |
| ClientOrderId | long. User submitted Id of the order. |
| OrderState | string. “Working”, “FullyExecuted”, “Expired”, “Canceled”, “Rejected” |
| ReceiveTime | long. UTC Epoch Time the order was received. |
| ReceiveTimeTicks | long. Microsoft Ticks Time the order was received. |
| OrigQuantity | decimal. The original quantity the order was submitted for. |
| QuantityExecuted | decimal. The total amount executed against this order. |
| AvgPrice | decimal. DEPRECATED |
| CounterrPartyId | string. This will be 0 unless this is a BlockTrade, in which case it represents the Id of the counterparty the BlockTrade is submitted for. |
| ChangeReason | long. “NewInputAccepted”, “NewInputRejected”, “OtherRejected”, “Expired”, “Trade”, “SystemCanceled_NoMoreMarket”, “SystemCanceled_BelowMinimum”, “SystemCanceled_PriceCollar”, “SystemCanceled_MarginFailed” |
| OrigOrderId | long. If this is a replacement order in a CancelReplaceOrder instruction, this is the OrderId of the canceled order. |
| OrigClOrdId | long. If this is a replacement order in a CancelReplaceOrder instruction, this is the Client Order Id of the canceled order. |
| EnteredBy | integer. The UserId of the user who entered this order. |
| IsQuote | boolean. Specifies if this is a Market Maker Quote. |
| InsideAsk | decimal. The inside (best) ask at the time this order state was last updated. |
| InsideAskSize | decimal. The quantity of the inside (best) ask at the time this order state was last updated. |
| InsideBid | decimal. The inside (best) bid at the time this order state was last updated. |
| InsideBidSize | decimal. The quantity of the inside (best) bid at the time this order state was last updated. |
| LastTradePrice | decimal. The price of the last trade at the time this order state was last updated. |
| RejectReason | string. A description of the reason for rejection, if the OrderState is “Rejected”. |
| IsLockedIn | boolean. In the event the order is a BlockTrade, this describes if only one party is required to enter the trade. |
| CancelReason | string. Describes any comment or reason for an Admin cancellation of this order. |
| OMSId | integer. The Order Management System ID. |
SendOrder
Body
{
"AccountId": 5,
"ClientOrderId": 99
"Quantity": 1,
"DisplayQuantity": 0,
"LimitPrice": 95,
"OrderIdOCO": 0,
"OrderType": "Limit",
"PegPriceType": "Midpoint",
"InstrumentId": 1,
"TrailingAmount": 1.0,
"LimitOffset": 2.0,
"Side": 0,
"StopPrice": 96,
"TimeInForce": 1,
"OMSId": 1,
}
Response Payload
{
"status": "Accepted",
"errormsg": ""
"OrderId": 15047,
}
Body
{
"AccountId": 5,
"ClientOrderId": 99
"Quantity": 1,
"DisplayQuantity": 0,
"LimitPrice": 95,
"OrderIdOCO": 0,
"OrderType": "Limit",
"PegPriceType": "Midpoint",
"InstrumentId": 1,
"TrailingAmount": 1.0,
"LimitOffset": 2.0,
"Side": 0,
"StopPrice": 96,
"TimeInForce": 1,
"OMSId": 1,
}
Response Payload
{
"status": "Accepted",
"errormsg": ""
"OrderId": 15047,
}
POST
/AP/SendOrder
https://apexapi.bitazza.com:8443/AP/SendOrder
Headers
- Content-Type=application/json
- APToken [Token string supplied in AuthenticateUser Response]
| Key | Value | Required |
|---|---|---|
| AccountId | integer. The AccountId to submit this order on. | Yes |
| ClientOrderId | long. A client supplied Identifier for the order. | No |
| Quantity | decimal. The amount/quantity to submit the order for. | Yes |
| DispalyQuantity | decimal. Specifies the maximum amount to display on the book at any one time. | No |
| LimitPrice | decimal. The price the order is for. Optional for Market Orders. | No |
| OrderIdOCO | long. Not Used. | No |
| OrderType | string. “Market”, “Limit”, “StopMarket”, “StopLimit”, “TrailingStopMarket”, “TrailingStopLimit”, “BlockTrade” | Yes |
| PegPriceType | string. Describes how a trailing price is calculated. Options: “Last”, “Bid”, “Ask”, “Midpoint” | No |
| InstrumentId | integer. Specifies the Instrument this order is for. | Yes |
| TrailingAmount | decimal. The distance from the market price to trail by, used only for Trailing orders. | No |
| LimitOffset | decimal. The offset to place a Limit order at when the trailing price is crossed. Used only in TrailingStopLimit orders. | No |
| Side | string. “Buy” or “Sell” | Yes |
| StopPrice | decimal. The price a Stop order is to be placed at once triggered. | No |
| TimeInForce | string. “GTC”, “IOC”, “FOK” | Yes |
| OMSId | integer. The Order Management System the Account and Instrument reside on. Generally the same as the OMSId returned by AuthenticateUser. | Yes |
ModifyOrder
Body
{
"OMSId": 1,
"OrderId": 15049
"InstrumentId": 1,
"PreviousOrderRevision": 0,
"Quantity": 0.9,
}
Response
{
"result": true,
"errormsg": null
"errorcode": 0,
"detail": null,
}
Body
{
"OMSId": 1,
"OrderId": 15049
"InstrumentId": 1,
"PreviousOrderRevision": 0,
"Quantity": 0.9,
}
Response
{
"result": true,
"errormsg": null
"errorcode": 0,
"detail": null,
}
POST
/AP/ModifyOrder
https://apexapi.bitazza.com:8443/AP/ModifyOrder
Headers
- Content-Type=application/json
- APToken=[Token string supplied in AuthenticateUser Response]
| Key | Value | Required |
|---|---|---|
| OMSId | integer. The Order Management System the Account and Instrument reside on. Generally the same as the OMSId returned by AuthenticateUser. | Yes |
| OrderId | long. The Server Order Id of the Order to modify. | Yes |
| InstrumentId | integer. The Instrument the order is for. | Yes |
| PreviousOrderRevision | integer. Safe to leave as 0. | No |
| Quantity | decimal. The new Quantity (must be lower than the current quantity). | Yes |
CancelReplaceOrder
Body
{
"AccountId": 4,
"OrderIdToReplace": 15067
"ClientOrderId": 99,
"Quantity": 1,
"DisplayQuantity": 0,
"LimitPrice": 95,
"OrderIdOCO": 0,
"OrderType": 2,
"PegPriceType": 1,
"InstrumentId": 1,
"TrailingAmount": 1.0,
"LimitOffset": 2.0,
"Side": 0,
"StopPrice": 96,
"TimeInForce": 1,
"OMSId": 1,
}
Response Payload
{
"ReplacementOrderId": 15068,
"ReplacementClOrdId": 0
"OrigOrderId": 15067,
"OrigClOrdId": 0,
}
Body
{
"AccountId": 4,
"OrderIdToReplace": 15067
"ClientOrderId": 99,
"Quantity": 1,
"DisplayQuantity": 0,
"LimitPrice": 95,
"OrderIdOCO": 0,
"OrderType": 2,
"PegPriceType": 1,
"InstrumentId": 1,
"TrailingAmount": 1.0,
"LimitOffset": 2.0,
"Side": 0,
"StopPrice": 96,
"TimeInForce": 1,
"OMSId": 1,
}
Response Payload
{
"ReplacementOrderId": 15068,
"ReplacementClOrdId": 0
"OrigOrderId": 15067,
"OrigClOrdId": 0,
}
POST
/AP/CancelReplaceOrder
https://apexapi.bitazza.com:8443/AP/CancelReplaceOrder
Headers
- Content-Type=application/json
- APToken [Token string supplied in AuthenticateUser Response]
| Key | Value | Required |
|---|---|---|
| AccountId | integer. The AccountId to submit this order on. | Yes |
| OrderIdToReplace | long. The Server Order Id of the order being replaced. | Yes |
| CleintOrder | long. A client supplied Identifier for the order. | No |
| Quantity | decimal. The amount/quantity to submit the order for. | Yes |
| DisplayQuantity | decimal. Specifies the maximum amount to display on the book at any one time. | No |
| LimitPrice | decimal. The price the order is for. Optional for Market Orders. | No |
| OrderIdOCO | long. Not Used. | No |
| OrderType | string. “Market”, “Limit”, “StopMarket”, “StopLimit”, “TrailingStopMarket”, “TrailingStopLimit”, “BlockTrade” | Yes |
| PegPriceType | string. Describes how a trailing price is calculated. Options: “Last”, “Bid”, “Ask”, “Midpoint” | No |
| InstrumentId | integer. Specifies the Instrument this order is for. | Yes |
| TrailingAMount | decimal. The distance from the market price to trail by, used only for Trailing orders. | No |
| LimitOffset | decimal. The offset to place a Limit order at when the trailing price is crossed. Used only in TrailingStopLimit orders. | No |
| Side | string. “Buy” or “Sell” | Yes |
| StopPrice | decimal. The price a Stop order is to be placed at once triggered. | No |
| TimeInForce | string. “GTC”, “IOC”, “FOK” | Yes |
| OMSId | integer. The Order Management System the Account and Instrument reside on. Generally the same as the OMSId returned by AuthenticateUser. | Yes |
CancelOrder
Body
{
"OMSId": 1,
"AccountId": 4
"ClOrderId": 0,
"OrderId": 15068,
}
Response
{
"result": true,
"errormsg": null
"errorcode": 0,
"detail": null,
}
Body
{
"OMSId": 1,
"AccountId": 4
"ClOrderId": 0,
"OrderId": 15068,
}
Response
{
"result": true,
"errormsg": null
"errorcode": 0,
"detail": null,
}
POST
/AP/CancelOrder
https://apexapi.bitazza.com:8443/AP/CancelOrder
Headers
- Content-Type=application/json
- APToken=[Token string supplied in AuthenticateUser Response]
| Key | Value | Required |
|---|---|---|
| OMSId | integer. The Order Management System the Account and Instrument reside on. Generally the same as the OMSId returned by AuthenticateUser. | Yes |
| AccountId | integer. The AccountId to submit this order on. | Yes |
| ClOrderId | long. The Client Order Id of the Order to Cancel. You must submit either ClOrderId or OrderId. | Conditional |
| OrderId | long. The Server Order Id of the Order to modify. You must submit either OrderId or ClOrderId. | Conditional |
CancelAllOrders
Body
{
"AccountId": 4
"OMSId": 1,
"InstrumentId": 1,
}
Response
{
"result": true,
"errormsg": null
"errorcode": 0,
"detail": null,
}
Body
{
"AccountId": 4
"OMSId": 1,
"InstrumentId": 1,
}
Response
{
"result": true,
"errormsg": null
"errorcode": 0,
"detail": null,
}
POST
/AP/CancellAllOrders
https://apexapi.bitazza.com:8443/AP/CancelAllOrders
Headers
- Content-Type=application/json
- APToken=[Token string supplied in AuthenticateUser Response]
| Key | Value | Required |
|---|---|---|
| OMSId | integer. The Order Management System the Account and Instrument reside on. Generally the same as the OMSId returned by AuthenticateUser. | Yes |
| AccountId | integer. The AccountId to submit this order on. | Yes |
| InstrumentId | integer. The Instrument to cancel all open orders for. | Yes |
Spot APIs
Summary
Payload
{ }
Response
[
{
"symbol": "ETH_BTC",
"base_id": 1027
"quote_id": 1,
"last_price": 0.02006513,
"volume": 0.05000000,
"high": 0.02314415
"low": 0.02279842
"sell": 0.02361423
"buy": 0.02306513
"change": 0.00014892
}
]
Description: Retrieves basic L1 data with unified
crypto mapping for eachmatching instrument on the system
Permissions: Operator
Assets
Payload
{ }
Response
[
{
"name": "Bitcoin",
"unified_cryptoasset_id": 1,
"min_withdraw": 0.00000001,
},
{
"name": "Ethereum",
"unified_cryptocurreny_id": 1027,
"min_withdraw": 0.0000000100000000000000000000,
}
]
Description: Provides a detailed summary for each
currency available on the exchange for CMC Integration
Permissions: Public
OrderBook
Payload
{
"market_pair": "unified crypto instrument symbol (eth_btc)",
"level": 2, // level 1 or level 2 data
"depth": 10,
}
Level 1 Response
{
"timestamp": 1590770267837,
"bids": [[444.31311992, 0.02313427]], // qty, price
"asks": [[165.23824000, 0.02370535]], // qty, price
}
Level 2 Response
{
"timestamp": 1590771337965,
"bids": [[210.05799997, 0.02319354], [93.034, 0.02318366]],
"asks": [[28.845, 0.02377658], [0.02127, 0.02379242]],
}
Description: The order book endpoint is to provide a complete level 2
order book (arranged by best asks/bids) with full depth returned for a
given market pair for CMC integration.
Permissions: Public
Trades
Payload
{
"market_pair": "unified crypto instrument symbol (eth_btc)",
}
Response
[
{
"tradeID": 1234,
"price": 0.01105525,
"base_volume": 0.00000001,
"quote_volume": 0.0000000002305525,
"trade_timestamp": "2020-05-29T15:44:29.111Z",
"type": "sell", // taker side
},
{
"tradeID": 360773,
"price": 0.02305525,
"base_volume": 0.00000001,
"quote_volume": 0.0000000002305525,
"trade_timestamp": "2020-05-29T15:45:12.544Z",
"type": "sell", // taker side
},
]
Description: Returns last 100 trades for asset. The type field
is the taker side
Permissions: Public