Introduction

Welcome to the BeaxyAPI developer documentation. This document should contain all the information required to properly implement applications using our API.

There are 2 main interfaces that can be used to access the BeaxyAPI:

APICommunicationDescription
RESTfulRequest-responseStateless API providing the widest range of data, not capable of streaming, only pooling.
WebSocketPublish-subscribeStateful API providing the streaming of real time market data.

IP Rate Limits

API's are allowed 117 requests per second per each unique IP address. If the API calls exceed the quota then status code 429 will be returned. We also provide utility headers X-Rate-Limit-Limit X-Rate-Limit-Remaining X-Rate-Limit-Reset for each request to monitor current rate limit state.

REST

General

RESTful endpoint provides the widest range of data, based on HTTP protocol which works in a Request-Reply scheme.

To use resources that require authorized access, you will need to provide an access token in the Authorization header when making HTTP requests. Authorization token can be obtained via calling the Authorization endpoint.

Authorization

Obtain access token using api key and api secret

curl -X POST "https://api.beaxy.com/api/v1/Auth/Token"
  -d '{"apiKey": "", "apiSecret": ""}'
  -H "Content-Type: application/json"  

Once the apiKey and apiSecret are validated successfully, response object with with JSON structured like this is returned:

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0NzAiLCJ...",
  "expires_in": 2073600,
  "token_type": "Bearer"
}

HTTP Request

POST /api/v1/Auth/Token

Request

ParameterDescription
apiKeyYour account's API key.
apiSecretSecret associated with the key.

Response

ParameterDescription
access_tokenAccess token for the session.
expires_inExpire in seconds.
token_typeToken type.

Assets

This endpoint retrieves a list of supported assets.

curl -X GET "https://api.beaxy.com/api/v1/Assets"

The above command returns JSON structured like this:

[
  {
    "id": 0,
    "name": "string",
    "code": "string",
    "withdrawalFee": 0,
    "withdrawalFrozen": true,
    "tradingFrozen": true,
    "maxConfirmations": 0
  }
]

HTTP Request

GET /api/v1/Assets

Response

ParameterDescription
idThe unique id for the asset.
nameDisplay name of the asset.
codeAsset code. This is widly used in the blockchain community to identify crypto assets.
withdrawalFeeApproximate withdrawal fees for the asset.
withdrawalFrozenSet to true if the withdrawals for this asset are frozen at the moment.
tradingFrozenSet to true if the trading for this asset is frozen at the moment.
maxConfirmationsMaximum number of blockchain confirmation required before deposit for this asset is available for trading.

Symbols

This endpoint retrieves a list of symbols.

curl -X GET "https://api.beaxy.com/api/v1/Symbols"

The above command returns JSON structured like this:

[
  {
    "sb": 0,
    "n": "string",
    "faid": 0,
    "taid": 0,
    "ad": "2019-03-11T21:05:14.877Z",
    "tf": true,
    "mf": true,
    "ps": 0,
    "as": 0,
    "mt": 0,
    "v": 0,
    "c": 0,
    "lp": 0,
    "l24l": 0,
    "l24h": 0
  }
]

HTTP Request

GET /api/v1/Symbols

Response

ParameterDescription
sbThe unique id for the symbol.
nDisplay name of the symbol.
faidUnique id for the base asset.
taidUnique id for the quote asset.
adDate when the symbol was first listed on the exchange.
tfSet to true if the trading for this asset is frozen at the moment.
mfSet to true if the matching for this asset is frozen at the moment.
psMaximum decimal precision allowed while setting price for the quote asset.
asMaximum decimal precision allowed while setting size for the quote asset.
mtMinimum order total.
vVolume of last 24 hours.
cPrice change percentage of last 24 hours.
lpLast trade price.
l24lLowest price of last 24 hours.
l24hHighest price of last 24 hours.

Trades

This endpoint retrieves the last 500 trades for the symbol, ordered by time desc.

curl -X GET "https://api.beaxy.com/api/v1/Symbols/2/Trades"

The above command returns JSON structured like this:

[
  {
    "ts": 0,
    "seq": 0,
    "pts": 0,
    "pseq": 0,
    "sb": 0,
    "p": 0,
    "s": 0,
    "t": 0,
    "tsf": 0
  }
]

HTTP Request

GET /api/v1/Symbols/{symbol}/Trades

Response

ParameterDescription
tsTimestamp for the trade.
seqSequence number within a same timestamp.
ptsSequence number for the previous trade.
pseqTimestamp for the previous trade.
sbSymbol of the trade.
pUnit price for the trade.
sSize of the trade.
ttlTotal price for the trade.
tsfSet to true if taker order was a sell order.

Order Book

This endpoint retrieves the current state of the order book for specified level and side.

curl -X GET -G "https://api.beaxy.com/api/v1/Symbols/2/OrderBook"
  -d "bsf=0"
  -d "lvl=20"

The above command returns JSON structured like this:

[
  {
    "ts": 0,
    "seq": 0,
    "pts": 0,
    "pseq": 0,
    "sb": 0,
    "p": 0,
    "s": 0,
    "l": 0,
    "ttl": 0,
    "bsf": 0,
  }
]

HTTP Request

GET /api/v1/Symbols/{symbol}/OrderBook

Request Query Parameters

ParameterDescription
bsfBuy/Sell. Buy = 0, Sell = 1. If bsf query parameter is not provided, both buy and sell levels will be returned.
lvlLevel of Order Book. Should be positive number. If lvl parameter is not provided then all levels will be returned.

Response

ParameterDescription
tsTimestamp for the order book level.
seqSequence number within a same timestamp.
ptsTimestamp for the previous level update.
pseqSequence number for the previous level update.
sbSymbol of the order book level.
pUnit price of the level.
sSize of the level.
lLevel.
ttlTotal at the level.
bsfBuy/Sell flag. Buy = 0, Sell = 1.

Wallets

This endpoint retrieves list of user wallets.

curl -X GET "https://api.beaxy.com/api/v1/Wallets"
  -H "Authorization: Bearer <ACCESS_TOKEN>"

The above command returns JSON structured like this:

[
  {
    "id": 0,
    "assetId": 0,
    "name": "string",
    "address": "string",
    "pendingBalance": 0,
    "lockedBalance": 0,
    "reservedBalance": 0,
    "availableBalance": 0,
    "isWithdrawalFrozen": true,
    "isTradingFrozen": true,
    "isDefault": true,
    "createdDate": "2019-03-11T22:22:30.138Z"
  }
]

HTTP Request

GET /api/v1/Wallets

Response

ParameterDescription
idUnique id for the wallet.
assetIdAssetId for the wallet.
nameUser defined display name of the wallet.
addressBlockhchain deposit/withdrawal address for the wallet.
pendingBalanceTotal pending balance.
lockedBalanceTotal locked balance.
reservedBalanceTotal reserved balance.
availableBalanceTotal available balance.
isWithdrawalFrozenSet to true if withdrawals from this wallet are frozen at the moment.
isTradingFrozenSet to true if trading from this wallet is frozen at the moment.
isDefaultSet to true if this wallet is set as a default wallet.
createdDateCreation date of the wallet.

Withdraw

This endpoint initiates balance withdrawal from a given wallet.

curl -X POST "https://api.beaxy.com/api/v1/Wallets/1/Withdrawals"
  -d '{"assetId": "3", "destinationWalletAddress": "0x123456....", "withdrawalAmount": "3", "twoFactorAuthenticationCode": "123456"}'
  -H "Content-Type: application/json"
  -H "Authorization: Bearer <ACCESS_TOKEN>"

HTTP Request

POST /api/v1/Wallets/{wallet}/Withdrawals

Response

ParameterDescription
assetIdSource wallet asset id.
destinationWalletAddressDestination wallet address where the withdrawal should be sent.
withdrawalAmountAmount to withdraw.
twoFactorAuthenticationCodeTwo factor authentication code is two factor authentication is enabled.

Generate Address

This endpoint generates a blockchain address.

curl -X POST "https://api.beaxy.com/api/v1/Addresses"
  -d '{"aId": "3"}'
  -H "Content-Type: application/json"
  -H "Authorization: Bearer <ACCESS_TOKEN>"

The above command returns JSON structured like this:

{
  "walletIds": [
    0
  ],
  "address": "string"
}

HTTP Request

POST /api/v1/Addresses

Request Query Parameters

ParameterDescription
aIdAssetId for the wallet.

Response

ParameterDescription
addressGenerated address.
walletIdsList of wallet ids for newly generate address.

Orders

This endpoint returns orders.

curl -X GET -G "https://api.beaxy.com/api/v1/Symbols/2/Orders"
  -d "state=0"
  -H "Content-Type: application/json"
  -H "Authorization: Bearer <ACCESS_TOKEN>"

The above command returns JSON structured like this:

  {
    "Open": [{...}, {...}],
    "OpenStop": [{...}, {...}],
	  "Closed": [{...}, {...}]
  }

HTTP Request

GET /api/v1/Symbols/{symbol}/Orders

Request Query Parameters

ParameterDescription
stateOpen/Closed. Open = 0, Closed = 1, Open Stop = 2. If state query parameter is not provided, both open and closed orders will be returned.

Response

ParameterDescription
openOpen orders.
openStopOpen stop orders.
closedClosed orders.
{
  "origTime": "0001-01-01T00:00:00",
  "orderType": 0,
  "buySellFlag": 0,
  "stopVal": 0.0,
  "origPrice": null,
  "size": 0.0,
  "origSize": 0.0,
  "toWalletId": 0,
  "fromWalletId": 0,
  "tradingPairId": 0,
  "orderId": 0,  
  "feeWalletId": 0,
  "clientOrderId" :0
}

Open Order

ParameterDescription
OrigTimeOriginal Time.
OrderTypeOrder type. 0=Market, 1=Limit, 2=Limit ImmediateOrCancel, 3=Limit FillOrKill, 4=Stop Limit, 5=Stop Market, 8=Take Profit, 9=Take Profit Limit, 10= LimitMarketMaker(Post-Only)
BuySellFlagBuy/Sell flag.
StopValStop value.
PriceAverage price for total fulfilled size.
OrigPricePrice set by user.
SizeRemaining size.
OrigSizeOriginal size.
ToWalletIdQuote asset wallet id.
FromWalletIdBase asset wallet id.
TradingPairIdTrading pair id.
OrderIdOrder id.
FeeWalletIdFee wallet id.
ClientOrderIdCustom order identifier provided by client. This id will be present in websocket update. Default value is 0.
{
  "origTime": "0001-01-01T00:00:00",
  "orderType": 0,
  "buySellFlag": 0,
  "stopVal": 0.0,
  "price" : 0,
  "origPrice": null,
  "size": 0.0,
  "origSize": 0.0,
  "toWalletId": 0,
  "fromWalletId": 0,
  "tradingPairId": 0,
  "orderId": 0,  
  "feeWalletId": 0,
  "clientOrderId" :0
}

Open Stop Order

ParameterDescription
OrigTimeOriginal Time.
OrderTypeOrder type. 0=Market, 1=Limit, 2=Limit ImmediateOrCancel, 3=Limit FillOrKill, 4=Stop Limit, 5=Stop Market, 8=Take Profit, 9=Take Profit Limit, 10= LimitMarketMaker(Post-Only).
BuySellFlagBuy/Sell flag.
StopValStop value.
PriceAverage price for total fulfilled size.
OrigPricePrice set by user.
SizeRemaining size.
OrigSizeOriginal size.
ToWalletIdQuote asset wallet id.
FromWalletIdBase asset wallet id.
TradingPairIdTrading pair id.
OrderIdOrder id.
FeeWalletIdFee wallet id.
ClientOrderIdCustom order identifier provided by client. This id will be present in websocket update. Default value is 0.
  {
    "orderId": 0,
    "tradingPairId": 0,
    "fromWalletId": 0,
    "toWalletId": 0,
    "size": 0.0,
    "fulFilledSize": 0.0,
	  "origPrice": 0,
    "price": null,
    "total": null,
    "stopVal": 0.0,
    "buySellFlag": 0,
    "orderType": 0,
    "isCancelled": false,
    "isRejected": false,
    "createdDate": "0001-01-01T00:00:00",
    "closedDate": "0001-01-01T00:00:00",
    "clientOrderId" :0
  }

Closed Order

ParameterDescription
OrderIdOrder id.
TradingPairIdTrading pair id.
ToWalletIdQuote asset wallet id.
FromWalletIdBase asset wallet id.
SizeSize.
FulFilledSizeFulfilled size.
OrigPricePrice set by user.
PriceAverage price for the total fulfilled size.
TotalTotal.
StopValStop value.
BuySellFlagBuy/Sell flag.
OrderTypeOrder type. 0=Market, 1=Limit, 2=Limit ImmediateOrCancel, 3=Limit FillOrKill, 4=Stop Limit, 5=Stop Market, 8=Take Profit, 9=Take Profit Limit, 10= LimitMarketMaker(Post-Only).
IsCancelledIs cancelled.
IsRejectedIs rejected.
CreatedDateCreated date.
ClosedDateCreated date.
ClientOrderIdCustom order identifier provided by client. This id will be present in websocket update. Default value is 0.

Order Fills

This endpoint returns order fills up to 10000 rows (250 by default). You can optionally pass start and end parameters to get only fills between that range.

curl -X GET -G "https://api.beaxy.com/api/v1/Symbols/2/OrderFills"
  -d "rows=<ROWS>"
  -d "start=<START_DATE>"
  -d "end=<END_DATE>"
  -H "Content-Type: application/json"
  -H "Authorization: Bearer <ACCESS_TOKEN>"

The above command returns JSON structured like this:

  {    
    "toWalletReservedBalance": 0.0,
    "toWalletAvailableBalance": 0.0,
    "fromWalletReservedBalance": 0.0,
    "fromWalletAvailableBalance": 0.0,
    "fillTime": "0001-01-01T00:00:00",
    "isTaker": false,
    "remainingSize": 0.0,
    "origPrice": null,
    "origSize": null,
    "orderTime": "0001-01-01T00:00:00",
    "buySellFlag": 0,
    "payWithBxy": false,
    "bxyFee": 0.0,
    "orderType": 0,
    "sequenceNumber": 0,
    "stopVal": 0.0,
    "price": 0.0,
    "size": 0.0,
    "bxyWalletId": 0,
    "toWalletId": 0,
    "fromWalletId": 0,
    "clientOrderId": 0,
    "orderId": 0,
    "walletFee": 0.0
  }

HTTP Request

GET /api/v1/Symbols/{symbol}/OrderFills

Response

ParameterDescription
orderIdOrder id.
clientOrderIdClient order id (0 if not set).
fromWalletIdBase asset wallet id.
toWalletIdQuote asset wallet id.
bxyWalletIdBxy wallet id
origSizeOriginal size.
sizeFill size.
remainingSizeRemaining size.
origPriceOriginal price.
priceFill price.
stopValStop value.
buySellFlagBuy/Sell flag.
orderTypeOrder type. 0=Market, 1=Limit, 2=Limit ImmediateOrCancel, 3=Limit FillOrKill, 4=Stop Limit, 5=Stop Market, 8=Take Profit, 9=Take Profit Limit, 10= LimitMarketMaker(Post-Only).
payWithBxyIs payed with Bxy.
isTakerSet to true if the fill is generated by taker order.
fillTimeTime when order was filled.
orderTimeTime when order was placed.
bxyFeeFees paid from BXY wallet/Rebates earned into BXY wallet. In case of rebate, this field has negative number.
walletFeeFees paid from quote asset wallet in case of buy order and from base asset wallet in case of sell.
fromWalletAvailableBalanceAvailable balance in base asset wallet at the time of the fill.
fromWalletReservedBalanceReserved balance in base asset wallet at the time of the fill.
toWalletAvailableBalanceAvailable balance in quote asset wallet at the time of the fill.
toWalletReservedBalanceReserved balance in quote asset wallet at the time of the fill.

Wallet Transactions

This endpoint returns order wallet transaction for specified asset and date range.

curl -X GET -G "https://api.beaxy.com/api/v1/WalletTransactions"
  -d "assetId=<ASSET_ID>"
  -d "start=<START_DATE>"
  -d "end=<END_DATE>"
  -H "Content-Type: application/json"
  -H "Authorization: Bearer <ACCESS_TOKEN>"

The above command returns JSON structured like this:

  {
    "correlationId": 0,
    "walletTransactionId": 0,
    "walletId": 0,
    "assetId": 0,
    "size": 0.0,
    "confirmations": 0,
    "blockchainTransactionId": "",
    "date": "0001-01-01T00:00:00",
    "type": 0,
    "status": 0,
    "externalWalletAddress": "",
    "externalWalletAddressTag": ""
  }

HTTP Request

GET /api/v1/WalletTransactions

Response

ParameterDescription
correlationIdCorrelation id.
walletTransactionIdWallet transaction id.
walletIdWallet id.
assetIdAsset id.
sizeTransfer size.
confirmationsConfirmations count.
blockchainTransactionIdBlockchain transaction id (will be empty for internal transactions).
dateWallet transaction creation date.
typeType (Deposit = 0, Withdrawal = 1, InternalWithdrawal = 2, InternalDeposit = 3).
statusStatus (Pending = 0, Confirmed = 1, ApprovedByAdmin = 2, ApprovedByUser = 3, RejectedByAdmin = 4, PendingAdminApproval = 5, RejectedByWalletManager = 6).
externalWalletAddressExternal wallet address.
externalWalletAddressTagExternal wallet address tag (XRP, EOS).

Place Order

This endpoint submits a new order.

curl -X POST "https://api.beaxy.com/api/v1/Symbols/2/Orders"
  -d '{"fromWalletId":0,"toWalletId":0,"bxyWalletId":0,"size":0,"price":0,"stopVal":0,"buySellFlag":0,"orderType":0}'
  -H "Content-Type: application/json"
  -H "Authorization: Bearer <ACCESS_TOKEN>"

The above command takes request object JSON strctured like this:

{
  "fromWalletId": 0,
  "toWalletId": 0,
  "bxyWalletId": 0,
  "size": 0,
  "price": 0,
  "stopVal": 0,
  "buySellFlag": 0,
  "orderType": 0,
  "clientOrderId": 0
}

The above command returns status 200 with response object {"orderId" : 1234} if order is submitted succesfully.

HTTP Request

POST /api/v1/Symbols/{symbol}/Orders

Request

ParameterDescription
fromWalletIdBase asset wallet id.
toWalletIdQuote asset wallet id.
bxyWalletIdBXY wallet id. If PayWithPXY is set to true, fees will be charged from this wallet id.
sizeSize of the order.
pricePrice of the order.
stopValStop value if the order is stop order.
buySellFlagBuy/Sell flag. Buy = 0, Sell = 1.
orderTypeOrder type. 0=Market, 1=Limit, 2=Limit ImmediateOrCancel, 3=Limit FillOrKill, 4=Stop Limit, 5=Stop Market, 8=Take Profit, 9=Take Profit Limit, 10= LimitMarketMaker(Post-Only)
clientOrderIdCustom order identifier provided by client. This id will be present in websocket update. Default value is 0.

Response

ParameterDescription
orderIdOrder id.

Cancel Order

This endpoint cancels an open order.

curl -X DELETE "https://api.beaxy.com/api/v1/Symbols/2/Orders/1"
  -H "Authorization: Bearer <ACCESS_TOKEN>"

The above command returns status 200 if cancel order request is submitted succesfully.

HTTP Request

DELETE /api/v1/Symbols/{symbol}/Orders/{order}

Cancel All Orders

This endpoint cancels all open orders.

curl -X DELETE "https://api.beaxy.com/api/v1/Symbols/2/Orders"
  -H "Authorization: Bearer <ACCESS_TOKEN>"

The above command returns status 200 if cancel all orders request is submitted succesfully.

HTTP Request

DELETE /api/v1/Symbols/2/Orders

WebSocket API

General

The WebSocket endpoint provides real-time market data streaming which works in a Subscribe-Publish communication model. After establishing a WebSocket connection with us, you can subscribe to a required stream with custom filter parameters.

Connection

Common response object.

{
  "type": 2,
  "invocationid": 0,
  "item": {
    ...
  }  
}

We are using the SignalR library (clients C#, JS) to provide real time updates via WebSockets, SSE and HTTP Polling. To manually connect to WebSocket you should pass through the SignalR invocation process. Connect your WebSocket client to wss://api.beaxy.com/hubs/realtimeupdates (optionally pass access_token query parameter with JWT token if stream requires authentication) then send {"protocol":"json","version":1}<0x1e> message. After that you will periodically receive {"type":6}<0x1e> which is the SignalR pinging mechanism to keep the connection alive. After that you should connect to the stream by sending {"arguments":[<ARGUMENTS>],"invocationId":"<INVOCATION_ID>","target":"<STREAM_NAME>","type":4}<0x1e> message. Pass unique identifier for each invocation. Then you will receive initial message {"type": 2, "invocationId": "1", "item": {"f": 1, "u": null}}<0x1e> where f equals to 1 which indicates that you sucessfully conected to the stream. The upcoming updates will come with "f": 0 and u will contain your actual update. Below you will find all the available streams and response messages which will be inside u.

Streams

Trades

Stream NameInvocation Message
Trades{"arguments":[{symbols : [2, 3]}],"invocationId":"1","target":"Trades","type":4}<0x1e>

Pass symbol ids as argument to receive updates (for example {symbols : [2,3,4...]}) or empty array (for example {symbols : []}) to receive updates for all symbols.

Response message:

  {
    "ts": 0,
    "seq": 0,
    "pts": 0,
    "pseq": 0,
    "sb": 0,
    "p": 0,
    "s": 0,
    "t": 0,
    "tsf": 0
  }

Response Message

VariableDescription
tsTimestamp for the trade.
seqSequence number within a same timestamp.
ptsTimestamp for the previous trade.
pseqSequence number for the previous trade.
sbSymbol of the trade.
pUnit price for the trade.
sSize of the trade.
ttlTotal for the trade.
tsfSet to true if taker order was a sell order.

Order Book

Stream NameInvocation Message
OrderBook{"arguments":[{symbols : [2]}],"invocationId":"2","target":"OrderBook","type":4}<0x1e>

Pass symbol ids as argument (for example {symbols : [2,3,4...]}) to receive update for specified symbols or pass empty array (for example {symbols : []) to receive updates for all symbols. Each atomic order book update is followed by a delimiter message. Atomic order book update is update generated for all levels getting affected by a single order at once. Delimiter message has value for the field "d" set to "D". In addition, values of other fields like 'p', 's', 'bsf' are defaulted to 0 for delimiter message (for example {"ts":1562617286937,"seq":1,"pts":1562617286937,"pseq":0,"sb":2,"bsf":0,"s":0.0,"p":0.0,"l":0,"ttl":0.0,"d":"D"}). Non-delimiter messages has "d" set to empty string "".

Response message:

  {
    "ts": 0,
    "seq": 0,
    "pts": 0,
    "pseq": 0,
    "sb": 0,
    "p": 0,
    "s": 0,
    "l": 0,
    "ttl": 0,
    "bsf": 0,
    "d":""
  }

Response Message

VariableDescription
tsTimestamp for the order book level.
seqSequence number within a same timestamp.
ptsTimestamp for the previous level update.
pseqSequence number for the previous level update.
sbSymbol of the order book level.
pUnit price of the level.
sSize of the level.
llevel.
ttlTotal at the level.
bsfBuy/Sell flag. Buy = 0, Sell = 1.
dDelimiter which indicates end of atomic operation. For delimiter messages value will be "D" otherwise just empty string "".

Manage Local Order Book

Connect to the orderbook stream with required depth
Buffer updates you receive from the stream
Get snapshot for the same depth from this endpoint : https://api.beaxy.com/api/v1/Symbols/{symbol}}/OrderBook?bsf={0/1}&lvl={1/5/20/50}
Discard any updates where ts = ts and seq = seq in the snapshot
Start processing the buffered updates from where (ts = snapshot's ts and seq > snapshot's seq) or (ts > snapshot's ts) whichever comes first
The data in the orderbook update is the absolute quantity for that level
If the quantity in the update is set to 0, remove the level
Every new update should have pts(previous timestamp) and pseq(previous sequence number) equal to the timestamp, sequence number of the update which came right before it. If this is not true, then a separate endpoint can be used to fetch missed updates.

Symbols

Stream NameInvocation Message
Symbols{"arguments":[{symbols : [2]}],"invocationId":"3","target":"Symbols","type":4}<0x1e>

Pass symbol ids as argument to receive updates (for example {symbols : [2,3,4...]}) or empty array (for example {symbols : []}) to receive updates for all symbols.

Response message:

  {
    "sb": 0,
    "v": 0,
    "c": 0,
    "lp": 0,
    "l24l": 0,
    "l24h": 0
  }

Response Message

VariableDescription
sbSymbol id.
vVolume of last 24 hours.
cPrice change percentage of last 24 hours.
lpLast trade price.
l24lLowest price of last 24 hours.
l24hHighest price of last 24 hours.

Wallet Balance Updates

Stream NameInvocation Message
WalletBalanceUpdate{"arguments":[{"WalletId" : 1234...}],"invocationId":"19","target":"WalletBalanceUpdate","type":4}<0x1e>

Pass wallet id as an argument to receive updates for specific wallet or pass an empty object {} to receive updates for all wallets.

Response message:

  {    
    "aid": 0,    
    "wid": 0,
    "a": 0,
    "r": 0,
    "p": 0,
    "l": 0
  }

Response Message

VariableDescription
widWallet id.
aidAccount id.
aAvailable balance.
rReserved balance.
pPending balance.
lLocked balance.

My Orders

Stream NameInvocation Message
MyOrders{"arguments":[{symbols : [2]}],"invocationId":"5","target":"MyOrders","type":4}<0x1e>

Pass symbol ids as argument to receive updates (for example {symbols : [2,3,4...]}) or empty array (for example {symbols : []}) to receive updates for all symbols.

Response message:

  {
    "o": 0,
    "a": [{
	  "id": 0,
	  "fwid": 0,
	  "twid": 0,
	  "bdwid": 0,
	  "s": 0,
	  "ffs": 0,
	  "p": 0,
	  "ttl": 0,
	  "sv": 0,
	  "bsf": 0,
	  "t": 0,
	  "cd": "DateTime"
	}],
	"u": [{
	  "id": 0,
	  "t": 0,
	  "ffs": 0
	}],
	"c": [{
	  "id": 0,
	  "fwid": 0,
	  "twid": 0,
	  "s": 0,
	  "ffs": 0,
	  "p": 0,
	  "ttl": 0,
	  "sv": 0,
	  "bsf": 0,
	  "t": 0,
	  "ic": true,
	  "ir": false,
	  "cd": "DateTime",
	  "cld": "DateTime",
	}]
  }

Response Message

VariableDescription
oClient order id.
aNew orders.
uUpdated orders.
cClosed orders.

New Order

VariableDescription
idOrder id.
fwidBase asset wallet id.
twidQuote asset wallet id.
bdwidBxy default wallet id.
sRemaining size.
ffsFulfilled size.
opPrice set by user.
pAverage price for the total fulfilled size.
ttlTotal.
svStop value.
bsfBuy/Sell flag.
tOrder type. 0=Market, 1=Limit, 2=Limit ImmediateOrCancel, 3=Limit FillOrKill, 4=Stop Limit, 5=Stop Market, 8=Take Profit, 9=Take Profit Limit, 10= LimitMarketMaker(Post-Only).
cdCreated date.

Updated Order

VariableDescription
idOrder id.
tOrder type. 0=Market, 1=Limit, 2=Limit ImmediateOrCancel, 3=Limit FillOrKill, 4=Stop Limit, 5=Stop Market, 8=Take Profit, 9=Take Profit Limit, 10= LimitMarketMaker(Post-Only).
ffsFulfilled size for the current update.
pAverage price for the total fulfilled size.
ttlTotal

Closed Order

VariableDescription
idOrder id.
fwidBase asset wallet id.
twidQuote asset wallet id.
sSize.
ffsFulfilled size.
opPrice set by user.
pAverage price for the total fulfilled size.
ttlTotal.
svStop value.
bsfBuy/Sell flag.
tOrder type. 0=Market, 1=Limit, 2=Limit ImmediateOrCancel, 3=Limit FillOrKill, 4=Stop Limit, 5=Stop Market, 8=Take Profit, 9=Take Profit Limit, 10= LimitMarketMaker(Post-Only).
icIs cancelled.
irIs rejected.
cdCreated date.
cldClosed date.

Cancel On Disconnect

Cancel on Disconnect (COD) functionallity allows API clients to assure order cancelation after client/server unexpected or expected disconnect. Functionality allows client, to decide for which scenarios to cancel orders (COD Trigger) and what orders to cancel (COD Target).

Targetvalue
All0
OnlyForCurrentSession1

All: After disconnect, all orders will be canceled

OnlyForCurrentSession: After disconnect, only orders done in timeframe of invoking COD methhod and disconnect

Triggervalue
Always0
OnlyOnUnexpectedDisconnect1

Always: After disconnect, no matter disconnect was unintentional or gracefull, orders will be canceled

OnlyOnUnintentionalDisconnect: Only after uninentional disconnect (server shutdown, socket error...) orders will be canceled

Pass symbol ids to cancel only orders for specific symbols (for example {symbols : [2,3,4...]}) or empty array (for example {symbols : []}) to cancel orders for all symbols.

To enable COD functionality client should invoke CancelOnDisconnect by sending following messsage {"arguments":[{symbols: [1,2,3], target: 0, trigger: 0],"invocationId":"3","target":"CancelOnDisconnect","type":1}<0x1e>.

Examples

Symbols List

Short CodesID
ETH-BTC1
BXY-BTC2
LTC-BTC3
ETC-BTC4
XMR-BTC5
ZEC-BTC6
NEO-BTC7
XRP-BTC8
EOS-BTC9
WAVES-BTC10
DASH-BTC11
BTC-USDC12
ETH-USDC13
NPXS-BTC14
ICX-BTC15
OMG-BTC16
POLY-BTC17
ZIL-BTC18
BCHABC-BTC19
DRGN-BTC20
ZRX-BTC21
BAT-BTC22
AION-BTC23
MTL-BTC24
BOXX-BTC25
USDC-BXY26
FTM-BTC27
GO-BTC28
VIDT-BTC29
QNT-BTC30
NRG-BTC31
VID-BTC34

Beaxy Error Codes

Error CodeError Type
600Unexpected
603ActivationCodeInvalid
605ActivationCodeExpired
610UserNotActivated
611UserFrozen
616IpNotWhitelisted
634LimitExceedsMaximumDailyWithdrawalLimit
636TradingPairTradingFrozen
637WalletTradingFrozen
638CurrencyTradingFrozen
643InvalidIpAddress
645InvalidCurrencyId
646CurrencyListIsEmpty
649WalletNotFound
651WalletHasNonZeroBalance
653WalletWithdrawalFrozen
654WalletNotEnoughFunds
655InvalidWithdrawalWalletAddress
657WithdrawalAddressNotWhitelisted
658WithdrawalLimitExceeded
659WithdrawalAddressBelongsToSameUser
660WithdrawalInvalidAmountStep
661WithdrawalAmountLessThanMinimum
663AccountFrozen
665CurrencyBanned
666TradeNotAllowed
668InvalidPriceOrSize
670InvalidOrderType
671InvalidSide
672InvalidMinTotal
677CurrencyMismatch
679OrderNotFound
680ApiCredentialsNotFound
681ApiCredentialsDeleted
682ApiCredentialsNotActivated
683ApiCredentialsAlreadyActivated
693InvalidRowsCount
694InvalidDateRange

Multiple Invocations

You can initiate as many invocations as many you want. Don't forget to give each invocation a unique identifier. For example we can listen for orderbook and trades updates at the same time. Check out Connection section under WebSocketsAPI to complete handshake process with the SignalR Hub. After that send {"arguments":[{symbols : [2, 3]}],"invocationId":"1","target":"Trades","type":4}<0x1e> message for Trades and {"arguments":[{symbols : [2], level: 1}],"invocationId":"2","target":"OrderBook","type":4}<0x1e> for Orderbook. Then you will receive update messages with given invocation ids. In this case Trades updates will come in this format {"type":2,"invocationid":1,"item":{...}} with invocation id 1 where item is single trade update entry.

Orders Flow

Note: You need the Access token for this. Follow the instructions in Authorization section.

Connect to the WebSockets by following the connection instructions in the WebSocketAPI section. After successful handshake with WebSocket Hub send {"arguments":[{symbols : [2]}],"invocationId":"5","target":"MyOrders","type":4}<0x1e> message to initiate invocation. Argument symbols responding for filtering orders by specified symbols. To receive updates for all updates just pass empty array "arguments":[{symbols : []}]. You can find full list of supported symbols in the section above or call corresponding REST endpoint to fetch the latest symbols. After a successful invocation you will be able to receive order updates.

Also you might need wallet updates to track balances in case if your orders successfully executes. For that just initiate a new invocation with message {"arguments":[{"WalletId" : 1234...}],"invocationId":"19","target":"WalletBalanceUpdate","type":4}<0x1e>. Argument walletId responding for filtering updates by specified wallet. You can fetch a list of wallets by calling corresponding REST endpoint.

To place order call REST POST /api/v1/Symbols/{symbol}/Orders (list of symbol ids available in the section above) endpoint with {"fromWalletId":1234,"toWalletId":5678,"bxyWalletId":1357,"size":3,"price":0.1,"stopVal":0,"buySellFlag":1,"orderType":3} (dummy object) and you will get a response with status code 200 which contains {"orderId" : 1234} object (note that you will receive WebSocket update that your order successfully placed). You can also cancel your orders by calling DELETE /api/v1/Symbols/{symbol}/Orders/{order}. Also, we provide an endpoint to cancel all orders for specified symbol. For that just call DELETE /api/v1/Symbols/{symbol}/Orders.