Getting Started

Globitex API provides different ways to access exchange trading facilities from your own application. Each developer can choose most appropriate API type according to their needs, previous experience and knowledge.

Options:

  • FIX API - the most efficient way to receive current market quotes and place orders via industry standard Financial Information eXchange (FIX) protocol.
  • RESTful API – exchange functionality available as widely used web services.
  • Streaming API – allows to improve web service efficiency for receiving market data using streaming functionality based on WebSocket and Socket.IO protocol.

FIX API

Basic information

  • The FIX gateway is accessible with an OpenVPN connection.
  • There are two interfaces: FIX Market data and FIX Trading.
  • FIX Trading requires a valid SenderCompId, login and password specified in the Logon message.
  • The protocol is based on FIX protocol 4.4 (http://www.fixtradingcommunity.org/FIXimate/FIXimate3.0/). Refer to FIX 4.4 documentation if there is no tag information specified.
  • The FIX gateway supports subset of messages and tags listed in this document.
  • Quantity is represented in lots (e.g. 10000001 for XBTEUR when representing 1 bitcoin and 1 satoshi).
  • Price is represented in natural value (e.g. 2500.01 for XBTEUR).

Symbols

Symbol Lot size Price Minimum Order size increment
XBTEUR 10 satoshi or 0.0000001 0.01 EUR 20000 lots 1 lot
BCHEUR 100 satoshi or 0.000001 0.01 EUR 2000 lots 1 lot
ETHEUR 0.000001 0.01 EUR 20000 lots 1 lot
ETHXBT 0.00001 0.00001 XBT 2000 lots 1 lot
GBXETH 0.001 0.0000001 ETH 5000 lots 1 lot
GBXXBT 0.001 0.0000001 XBT 5000 lots 1 lot
EURSEUR 0.0001 0.01 EUR 50000 lots 1 lot

Document usage

  • All tags listed should be treated as required by default. Optional tags will be marked.
  • Tags that are not listed are not supported
  • Tags are implemented according to FIX protocol 4.4 (http://www.fixtradingcommunity.org/FIXimate/FIXimate3.0/). If some values are not supported the complete list of values is specified.

End points

There are two FIX end-points that use different network addresses (ipv4:port):

  • FIX Trading end-point: interface for trading (placing new orders, order status requests, execution reports, order cancellation)
  • FIX Market data end-point: interface for market data subscription

Client should use proper endpoint. Behavior in case of receiving wrong message is not specified. Client could possibly be disconnected or receive Reject messages in case of using an incorrect endpoint.

Disaster scenarios

In case of severe fault the FIX session could be forcibly reset. In this case Client will receive ResetSeqNo flag from server and should synchronize its state by MassStatusRequest.

Effective time

There are restrictions on internal order placement timeouts. In case of fault Client will receive Reject with the specific reason "Too late to enter"

Order statuses

There are two pseudo-states that could be returned only by sending OrderStatusRequest or OrderMassStatusRequest:

  • Pending New
  • Pending Cancel.

Please note:

  • First ExecutionReport will be New or Rejected
  • Not-filled FOK and IOC orders become Expired

Consider the following diagram:

Session layer

FIX session has no persistence.

Supported messages

FIX Trading

Supports the following application-level messages:

From Client to FIX gateway:

From FIX gateway to Client:

Client will receive ExecutionReports for orders that are placed with the same SenderCompID.

FIX Market data

Supports the following application-level messages:

From Client to FIX gateway:

From FIX gateway to Client:

Message Format

StandardHeader

Tag Name Values
8 BeginString FIX.4.4
9 BodyLength
35 MsgType

0 - Heartbeat

1 - Test Request

2 - Resend Request

5 - Logout

A - Logon

D - NewOrderSingle

F - Order Cancel Request

H - Order Status Request

V - Market Data Request

AF - Mass Status Request

49 SenderCompID

Should contain username. Only one connection can be established with the same SenderCompID

56 TargetCompID

GLOBITEX

34 MsgSeqNum
43 PossDupFlag
52 SendingTime @Snt

StandardTrailer

Tag Name Values Comments
10 CheckSum

Heartbeat [type '0']

Tag Name Values Comments
112 TestReqID this Heartbeat is a response to TestRequest

TestRequest [type '0']

Tag Name Values Comments
112 TestReqID

ResendRequest [type '2']

Tag Name Values Comments
7 BeginSeqNo
16 EndSeqNo

Reject [type '3']

Tag Name Values Comments
45 RefSeqNum
371 RefTagID
58 Text optional

SequenceReset [type '4']

Tag Name Values Comments
123 GapFillFlag N (default), Y
371 RefTagID
123 GapFillFlag
36 NewSeqNo

Logout [type '5']

Tag Name Values Comments
58 Text optional could contain a reason for server-initiated logout

Logon [type 'A']

Tag Name Values Comments
98 EncryptMethod 0
108 HeartBtInt
553 Username
554 Password
141 ResetSeqNumFlag Y
10001 CancelOnDisconnect Y or N, optional, default:N cancel all orders for a specific SenderCompID on disconnect

Instrument block

Tag Name Values Comments
55 Symbol e.g. "XBTEUR”

MarketDataRequestReject [type 'Y']

Tag Name Values Comments
262 MDReqID
281 MDReqRejReason 0
58 Text optional could contain a reason

MarketDataSnapshotFullRefresh [type 'W']

Tag Name Values Comments
262 MDReqID
Instrument (component)
268 NoMDEntries (repeating group)
269 > MDEntryType

0 - Bid

1 - Offer

270 > MDEntryPx
271 > MDEntrySize

MarketDataIncrementalRefresh [type 'X']

Tag Name Values Comments
262 MDReqID
268 NoMDEntries (repeating group)
279 >MDUpdateAction 0 - New in case of level removal MDEntrySize will be 0
269 >MDEntryType

0 - Bid

1 - Offer

2 - Trade

> Instrument (component)
270 > MDEntryPx
271 > MDEntrySize

MarketDataRequest [type 'V']

Subscribe:

Tag Name Values Comments
262 MDReqID
263 SubscriptionRequestType

0 - Snapshot

1 - Snapshot and updates

264 MarketDepth

0 - Full Book

1 - Top Of Book

267 NoMDEntryTypes (repeating group)
269 >MDEntryType

0 - Bid

1 - Offer

2 - Trade

146 NoRelatedSym (repeating group)
> Instrument (component)

Unsubscribe:

Tag Name Values Comments
262 MDReqID
263 SubscriptionRequestType

2 - Disable previous Snapshot + Update Request (Unsubscribe)

ExecutionReport [type '8']

Tag Name Values Comments
37 OrderID (Repeating group), size = 1
11 ClOrdID <= 32 characters
41 OrigClOrdID filled for ExecutionReport initiated by OrderCancelRequest
790 OrdStatusReqID ExecType=I
17 ExecID
150 ExecType

0 - New

4 - Canceled

8 - Rejected

C - Expired

F - Trade (partial fill or fill)

I = Order Status

39 OrdStatus

0 - New

1 - Partially filled

2 - Filled

4 - Canceled

8 - Rejected

C - Expired

6 - Pending Cancel

A - Pending New

Pending Cancel and Pending New could be sent if ExecType=I
103 OrdRejReason

1 - Unknown symbol

2 - Exchange closed

4 - Too late to enter

5 - Unknown Order

6 - Duplicate Order (e.g. dupe ClOrdID (11))

11 - Unsupported order characteristic

15 - Unknown account(s)

99 - Other

if Rejected
1 Account
Instrument (component)
54 Side

1 - Buy

2 - Sell

60 TransactTime
38 OrderQty
40 OrdType

1 - Market

2 - Limit

44 Price for limit orders
32 LastQty for Trades
31 LastPx for Trades
851 LastLiquidityInd for Trades
151 LeavesQty
14 CumQty
6 AvgPx
584 MassStatusReqID

Mass status request identifier. Present if Order_Mass_Status_Request (35=AF) is used.

912 LastRptRequested

N - There is at least one more execution report

Y = This is last execution report

Present if Order_Mass_Status_Request (35=AF) is used

NewOrderSingle [type 'D']

Tag Name Values Comments
11 ClOrdID @ID
1 Account
Instrument (component)
54 Side

1 - Buy

2 - Sell

60 TransactTime
38 OrderQty
40 OrdType

1 - Market

2 - Limit

3 - Stop

4 - Stop Limit

44 Price
99 StopPx Stop price For Stop and Stop Limit Orders
59 TimeInForce

0 - Day (or session)

1 - Good Till Cancel (GTC)

2 = Immediate or Cancel (IOC)

4 = Fill or Kill (FOK)

6 - Good Till Date (GTD)

126 ExpireTime UTCTimestamp for GTD orders
18 ExecInst optional, 'o' from FIX5.0SP1 (cancel on disconnect)
10001 CancelOnDisconnect

Optional

Y

N (default)

OrderCancelReject [type '9']

Tag Name Values Comments
37 OrderID If CxlRejReason="Unknown order", specifies "NONE"
11 ClOrdID
41 OrigClOrdID
39 OrdStatus If CxlRejReason = "Unknown Order", specifies Rejected
434 CxlRejResponseTo
102 CxlRejReason

OrderCancelRequest [type 'F']

Tag Name Values Comments
41 OrigClOrdID
11 ClOrdID
Instrument (component)
1 Account
54 Side
60 TransactTime

OrderStatusRequest [type 'H']

Behavior:

  • Server sends order status as ExecutionReport
  • Account and Side are required
  • If order is not found the server doesn't send any response.
Tag Name Values Comments
11 ClOrdID @ID
790 OrdStatusReqID @StatReqID
1 Account
Instrument (component)
54 Side

1 - Buy

2 - Sell

OrderMassStatusRequest [type 'AF']

Tag Name Values Comments
584 MassStatusReqID
585 MassStatusReqType 7 - Status for all orders
1 Account (required)

RESTful API

Basic information

Service endpoints

Production environment:

Endpoint

Description

https://api.globitex.com Service endpoint for RESTful API calls

Currency symbols

The following currency symbols are traded on the exchange.

Symbol Price step Minimum order size Order size increment
XBTEUR 0.01 0.002 0.00000001

The actual list of symbols can be obtained by /api/1/public/symbols method.

Size representation:

  • Quantity is represented in natural values (e.g. 1.00000001 for XBTEUR when representing 1 Bitcoin and 1 Satoshi)
  • Price is represented in natural values (e.g. 250.01 for XBTEUR)

Error messages

In case of error in client request processing, HTTP error code is returned. Additionally, JSON object containing error description can be returned.


Possible values for HTTP error codes:

HTTP status code HTTP status code name When returned
400 Bad Request Client request data has errors
403 Forbidden Missing required fields for signature check or problems with message signature
404 Not Found Request is sent to invalid path
500 Internal Server Error Unexpected server error occurred when processing client request

Data structure for error description in JSON format:

Field Required Type Description
errors Yes array of object Error message

Data structure for errors object

Field Required Type Description
code Yes integer Error code
message Yes string Error message
data No string Additional data about error

Example responses:

"errors": [{"code": -32600, "message": "Invalid Request", "data": "Unknown symbol BTCUSD"}]
"errors": [{"code": 30240, "message": "Invalid cryptocurrency address"}]

Error codes

API method calls can return the following common errors with HTTP error codes:

HTTP error code JSON Code Message Description
403 10 Missing API key API key not exists in HTTP request header
403 20 Missing nonce Nonce not exists in HTTP request header
403 30 Missing signature Signature not exists in HTTP request header
403 40 Invalid API key API key not found or have invalid format.
403 50 Nonce is not monotonous Received nonce is smaller than in previous requests
403 60 Nonce is not valid Too big number or not a number
403 70 Wrong signature Specified signature is not correct
403 80 No permissions API key has no permissions to call this method
403 90 API key is not enabled Client have not enabled API key
403 100 API key locked API key is locked on client action or on exchange side
403 110 Invalid client state Client account is closed or is not approved
403 120 Invalid API key state API key is deleted
403 130 Trading suspended Trading for client is suspended
403 140 REST API suspended Trading via REST API suspended
400 200 Mandatory parameter missing At least one of the method mandatory parameters are missing

Authentication

RESTful Trading and Payment API requires HMAC-SHA512 signatures for each request.

To use this API endpoint you should get your API key and Secret key from the web application Settings page.

Each request should include the following parameters in HTTP header:

Parameter HTTP header field Required Type Description
apikey X-API-Key Yes string as generated by exchange API key from web application Settings page
nonce X-Nonce Yes integer, less than (2^53-2) unique monotonous number that should be generated on the client. Hint: use millisecond or microsecond timestamp
signature X-Signature Yes string representation of hmac-sha512 result uri, nonce and requestBody

Signature generation pseudo-code:

uri = path [+ '?' + query]
(example 1: /api/1/trading/orders/active?symbols=XBTEUR)
(example 2: /api/1/trading/new_order)

message = apikey + '&' + nonce + uri [+ ? + requestBody]
(example 1: 4c0af59aaad960538015f35eff051336&1499263537306/api/1/trading/orders/active?account=ZAN034A01)
(example 2: 4c0af59aaad960538015f35eff051336&1499262973793/api/1/trading/new_order?account=ZAN034A01&clientOrderId=REST1499262973793&symbol=XBTEUR&side=buy&price=2500&quantity=0.01)

signature = lower_case(hex(hmac_sha512(message.getBytes(‘UTF-8’), secret_key.getBytes(‘UTF-8’) )))

Javascript code (example):

var crypto = require('crypto');
...
var signature = crypto.createHmac('sha512', secretKey).update(message).digest('hex');

Market Data methods

RESTful API provides access to market data with the following methods:

  • get the timestamp - /api/1/public/time
  • get the list of instruments - /api/1/public/symbols
  • get the ticker for specified instrument - /api/1/public/ticker/:symbol
  • get all tickers - /api/1/public/ticker
  • get the order book for specified instrument - /api/1/public/orderbook/:symbol
  • get individual trades data for specified instrument - /api/1/public/trades/:symbol
  • get recent trades for specified instrument - /api/1/public/trades/recent/:symbol

Get Time

Returns the server time in UNIX timestamp format. Precision – milliseconds.

Request: GET /api/1/public/time

Example response:

{
"timestamp":1393492619000
}

Get Symbols

Returns the list of instruments traded on exchange with their characteristics:

Request: GET /api/1/public/symbols


The following fields are used in the response object:

Field Description
symbol Instrument symbol
priceIncrement Order price minimum increment parameter
sizeIncrement Order size minimum increment parameter
sizeMin Minimum order size
currency Price currency for the instrument
commodity Base currency for the instrument

Example response:

{
 "symbols": [
  {
	"symbol":"XBTEUR",
	"priceIncrement":"0.01",
	"sizeIncrement":"0.00000001",
	"sizeMin":"0.002",
	"currency":"EUR",
	"commodity":"XBT"
  }
]
}

Get Ticker For Symbol

Returns the current data for the instrument.

Request: GET /api/1/public/ticker/:symbol where :symbol is an instrument symbol traded on the exchange


The following fields are used in the response object:

Field Description
symbol Instrument symbol
ask Lowest sell order
bid Highest buy order
last Last trade price
low Lowest trade price per last 24h + last incomplete minute
high Highest trade price per last 24h + last incomplete minute
open Open price for instrument
volume Trade volume per last 24h + last incomplete minute
volumeQuote Trade volume in second currency per last 24h + last incomplete minute
timestamp Server time in UNIX timestamp format

Error codes returned:

Code Message Data
20000 Invalid argument Unknown symbol ABCXBT

Example response:

{
  "symbol":"XBTEUR",
  "ask":"554.12",
  "bid":"549.56",
  "last":"550.73",
  "low":"400.70",
  "high":"600.10",
  "open":"449.73",
  "volume":"567.90",
  "volumeQuote":"289002.81",
  "timestamp":1393492619000
}

Get Ticker

Returns the current data for all instruments traded on the exchange.

Request: GET /api/1/public/ticker

Example response:

{
	"instruments": [
		{
		"symbol":"XBTUSD",
		"ask":"489.26",
		"bid":"488.08",
		"last":"489.31",
		"low":"478.01",
		"high":"496.23",
		"open":"500.00",
		"volume":"404.20",
		"volumeQuote":"197735.83",
		"timestamp":1409907025743
		},{
		"symbol":"XBTEUR",
		"ask":"378.23",
		"bid":"376.28",
		"last":"376.29",
		"low":"362.48",
		"high":"382.13",
		"open":"400.00",
		"volume":"961.71",
		"volumeQuote":"361328.13",
		"timestamp":1409907025743
		}
	]
}

Get Order Book for Symbol

Returns an array of open orders for the specified instrument. First value - price, second - size.

Request: GET /api/1/public/orderbook/:symbol where :symbol is an instrument symbol traded on exchange


Error codes returned:

Code Message Data
20000 Invalid argument Unknown symbol ABCXBT

Example response:

{
  "asks": [
	["405.71","0.09"],
	["406.65","0.06"],
	["409.51","0.15"],
	["413.93","51.6"],
	["414.59","47.1"]
],
  "bids": [
	["398.30","0.15"],
	["396.99","0.13"],
	["395.00","0.5"],
	["391.93","42.4"],
	["383.67","145.4"]
  ]
}

Get Trades for Symbol

Returns trade data for the specified instrument.

Request: GET /api/1/public/trades/:symbol where :symbol is an instrument symbol traded on exchange

Parameters:

Parameter Required Type/Value Description
from No 64 bit integer Returns trades with trade_id > specified trade_id (if by=trade_id) or returns trades with timestamp >= specified timestamp (if by=ts)
till No 64 bit integer Returns trades with trade_id < specified trade_id (if by=trade_id) or returns trades with timestamp < specified timestamp (if by=ts)
by No trade_id or ts Selects if filtering and sorting is performed by trade_id or by timestamp
sort No asc or desc Trades are sorted ascending (default) or descending
startIndex No integer Start index for the query result row to return data from (0 = first line)
maxResults No integer Maximum quantity of returned items for one request, at most 1000
formatItem No true or false Format of items returned: as an array (default) or as a list of objects
formatTimestamp No millisecond or second Format of trade timestamp returned: in milliseconds (default) or in seconds
formatWrap No true or false Selects if the result array is wrapped in trades object (true) or returned as plain array (false). Default value - true
side No true or false Selects if the taker side of a trade is returned. Default value - false

Error codes returned:

Code Message Data
20000 Invalid argument Unknown symbol BTCUSeD
20100 Invalid argument Fields are not valid: [field name(s)]

Example:

/api/1/public/trades/XBTEUR?from=0&till=10&by=trade_id&formatWrap=true

Example response:

{
  "trades": [
	[1393492619000,"575.64","0.02","3814483"],
	[1393492619001,"574.30","0.12","3814482"],
	[1393492619002,"573.67","3.80","3814481"],
	[1393492619003,"571.00","0.01","3814479"],
	...
  ]
}

Example:

/api/1/public/trades/XBTUSD?from=0&till=10&by=trade_id&formatWrap=false&formatItem=object

Example response:

[
  {"date":1393492619000,"price":"575.64","amount":"0.02","tid":"3814483"},
  {"date":1393492619001,"price":"574.30","amount":"0.12","tid":"3814482"},
  {"date":1393492619002,"price":"573.67","amount":"3.80","tid":"3814481"},
  {"date":1393492619003,"price":"571.00","amount":"0.01","tid":"3814479"},
  ...
]

Get Recent Trades for Symbol

Returns recent trades for the specified instrument.

Request: /api/1/public/trades/recent/:symbol where :symbol is an instrument symbol traded on exchange

Parameters:

Parameter Required Type/Value Description
maxResults No integer Maximum quantity of returned results, at most 1000
formatItem No true or false Format of items returned: as an array (default) or as a list of objects
side No true or false Selects if the taker side of a trade is returned. Default value - false

Error codes returned:

Code Message Data
20000 Invalid argument Unknown symbol BTCEUR
20010 Resource not found [invalid path] does not exist
20100 Invalid argument Fields are not valid: [field name(s)]

Example:

/api/1/public/trades/recent/XBTEUR?maxResults=20&formatItem=object&side=true

Example response:

{"trades":[
{"date":1411045690003,"price":"442.12","amount":"0.09","tid":1413901,"side":"sell"},
{"date":1411045690003,"price":"442.02","amount":"0.60","tid":1413900,"side":"buy"},
{"date":1411045690003,"price":"441.57","amount":"0.19","tid":1413899,"side":"buy"},
{"date":1411045635556,"price":"442.00","amount":"0.42","tid":1413889,"side":"buy"},
{"date":1411045635556,"price":"441.59","amount":"0.19","tid":1413888,"side":"buy"},
{"date":1411045635556,"price":"441.59","amount":"0.39","tid":1413887,"side":"buy"},
{"date":1411045621329,"price":"442.00","amount":"0.01","tid":1413882,"side":"sell"},
{"date":1411045621329,"price":"442.00","amount":"0.32","tid":1413881,"side":"buy"},
{"date":1411045621329,"price":"441.57","amount":"0.28","tid":1413880,"side":"buy"},
{"date":1411045621329,"price":"441.56","amount":"0.38","tid":1413879,"side":"buy"}
]
}

Trading methods

RESTful API allows to perform trading operations with the following methods:

  • get all active orders - /api/1/trading/active
  • place a new order - /api/1/trading/new_order
  • cancel an order - /api/1/trading/cancel_order
  • get user's recent orders - /api/1/trading/recent
  • get user's trading history - /api/1/trading/trades

Trading operations require authentication.

Error codes and reports representing order status changes are described below.

Execution Report

The API uses ExecutionReport as an object that represents change of order status.

The following fields are used in ExecutionReport object:

Field Required Type/Value Description
orderId Yes string Order ID on the Exchange
clientOrderId Yes string clientOrderId sent in NewOrder message (see /api/1/trading/new_order)
execReportType Yes new
canceled
rejected
expired
trade
status
Execution report type
orderStatus Yes new
partiallyFilled
filled
canceled
rejected
expired
Order status
orderRejectReason Yes - for orders in rejected state unknownSymbol
exchangeClosed
orderExceedsLimit
unknownOrder
duplicateOrder
unsupportedOrder
unknownAccount
other
Reason of rejection. Relevant only for orders in rejected state
account Yes string Exchange account number the order is placed on
symbol Yes string, e.g. XBTUSD Instrument symbol traded on exchange (see Currency symbols)
side Yes buy or sell Side of a trade
timestamp No integer UTC timestamp in milliseconds
price No decimal as string Price of an order
quantity Yes decimal as string Order quantity in natural currency units (e.g. 1.00000001 for XBTUSD when representing 1 bitcoin and 1 satoshi)
type Yes limit Type of an order. Only limit orders are currently supported
timeInForce Yes GTC - Good-Til-Canceled
IOC - Immediate-Or-Cancel
FOK - Fill-Or-Kill
DAY - day orders
Time in force
tradeId Yes - for trades integer Trade ID on the exchange
lastQuantity Yes - for trades decimal as string Quantity of the last trade in natural currency units (e.g. 1.00000001 for XBTUSD when representing 1 bitcoin and 1 satoshi)
lastPrice Yes - for trades decimal as string Price of the last trade
leavesQuantity No decimal as string Order unfilled quantity in natural currency units (e.g. 1.00000001 for XBTUSD when representing 1 bitcoin and 1 satoshi)
cumQuantity No decimal as string Total executed order quantity in natural currency units (e.g. 1.00000001 for XBTUSD when representing 1 bitcoin and 1 satoshi)
execQuantity No decimal as string Quantity of last executed trade in natural currency units (e.g. 1.00000001 for XBTUSD when representing 1 bitcoin and 1 satoshi)
averagePrice No decimal as string Average price. Equals 0 if cumQuantity=0
orderSource No WEB - web application
FIX - FIX API
REST - RESTful API
ADM - order was placed by the exchange administration
Interface used for order placement

Example response:

{ "ExecutionReport": {
"orderId": "5852103",
"clientOrderId": "11111112",
"execReportType": "new",
"orderStatus": "new",
"account": "ADE922A21",
"symbol": "XBTUSD",
"side": "buy",
"timestamp": 1395236779235,
"price": 0.1,
"quantity": 100,
"type": "limit",
"timeInForce": "GTC",
"lastQuantity": 0,
"lastPrice": 0,
"leavesQuantity": 100,
"cumQuantity": 0,
"averagePrice": 0
} }

Get Active Orders

Returns all orders in status new, partiallyFilled or suspended.

Request: GET /api/1/trading/orders/active

Parameters:

Parameter Required Type Description
symbols No string Comma-separated list of symbols. Default - all symbols
clientOrderId No string Unique order ID
account Yes string Account number

The following fields are used in order object:

Field Required Type Description
orderId Yes integer Order ID on the exchange
orderStatus Yes new
partiallyFilled
suspended
Order status
lastTimestamp Yes integer UTC timestamp of the last change, in milliseconds
orderPrice Yes - for limit orders decimal as string Order price
orderQuantity Yes decimal as string Order quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
avgPrice Yes decimal as string Average price
type Yes limit, stopLimit, stop Type of an order
timeInForce Yes GTC - Good-Til-Canceled
IOC - Immediate-Or-Cancel
FOK - Fill-Or-Kill
DAY - Day
GTD - Good-Till-Date
Time in force
clientOrderId Yes string Unique client-generated ID
symbol Yes string Currency symbol
side Yes buy or sell Side of a trade
account Yes string Exchange account number the order is placed on
orderSource Yes string Channel for the order placement. Possible values see in Execution reports
leavesQuantity Yes decimal as string Remaining quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
cumQuantity Yes decimal as string Order total executed quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
execQuantity Yes decimal as string Quantity of last executed trade in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
stopPrice Yes - for stop orders decimal as string Order stop price
expireTime Yes – for GTD orders integer UTC timestamp in milliseconds

Example response:

{"orders":[
{
	"orderId":"7242835",
	"orderStatus":"new",
	"lastTimestamp":1495038022000,
	"orderPrice":"2000.000",
	"orderQuantity":"1.00000",
	"avgPrice":"0",
	"type":"limit",
	"timeInForce":"GTC",
	"clientOrderId":"1495038022448",
	"symbol":"XBTEUR",
	"side":"sell",
	"account":"ZAN034A01",
	"orderSource":"WEB",
	"leavesQuantity":"1.00000",
	"cumQuantity":"0.00000",
	"execQuantity":"0.00000"
},{
	"orderId":"7242849",
	"orderStatus":"new",
	"lastTimestamp":1495444275000,
	"orderPrice":"801.000",
	"orderQuantity":"0.01000",
	"avgPrice":"0",
	"type":"limit",
	"timeInForce":"GTD",
	"clientOrderId":"1495444275779",
	"symbol":"XBTEUR",
	"side":"buy",
	"account":"ZAN034A01",
	"orderSource":"WEB",
	"leavesQuantity":"0.01000",
	"cumQuantity":"0.00000",
	"execQuantity":"0.00000",
	"expireTime":2241464400000
},{
	"orderId":"7242850",
	"orderStatus":"suspended",
	"lastTimestamp":1495444739000,
	"orderPrice":"810.000",
	"orderQuantity":"0.01000",
	"avgPrice":"0",
	"type":"stopLimit",
	"timeInForce":"GTC",
	"clientOrderId":"1495444739529",
	"symbol":"XBTEUR",
	"side":"buy",
	"account":"ZAN034A01",
	"orderSource":"WEB",
	"leavesQuantity":"0.01000",
	"cumQuantity":"0.00000",
	"execQuantity":"0.00000",
	"stopPrice":"808.000"
}]}

Place New Order

Place a new order. Returns a JSON object ExecutionReport that represent a status of the order.

Request: POST /api/1/trading/new_order

Parameters:

Parameter Required Type Description
clientOrderId No string Unique order ID generated by client. Can not match active order on the same account. From 8 to 32 characters. If not provided, will be generated automatically
account Yes string Account number
symbol Yes string Instrument symbol traded on exchange (see Instrument symbols), e.g. XBTEUR
side Yes buy or sell Side of a trade
price Yes - for limit orders decimal value as string Order price
quantity Yes decimal value as string Order quantity in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
type No limit or market, stop, stopLimit Order type. Default value - limit
timeInForce No GTC - Good-Til-Canceled
GTD - Good-Til-Date
IOC - Immediate-Or-Cancel
FOK - Fill-Or-Kill
DAY - day
Time in force. Default value – GTC
expireTime Yes – for GTD orders 64 bit integer UTC timestamp in seconds
stopPrice Yes – for stop and stop limit orders decimal value as string Order stop price

The following fields are used in ExecutionReport object:

Field Required Type Description
orderId Yes integer Order ID on the exchange
clientOrderId Yes string Unique client-generated ID
orderStatus Yes new
rejected
suspended
Order status
symbol Yes string Currency symbol
side Yes buy or sell Side of a trade
price Yes - for limit orders decimal as string Order price
quantity Yes decimal as string Order quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
type Yes limit, market, stopLimit, stop Type of an order
timeInForce Yes GTC - Good-Til-Canceled
IOC - Immediate-Or-Cancel
FOK - Fill-Or-Kill
DAY - Day
GTD - Good-Till-Date
Time in force
expireTime Yes – for GTD orders integer UTC timestamp in milliseconds
stopPrice Yes - for stop orders decimal as string Order stop price
lastQuantity Yes decimal as string Quantity of last executed trade in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
lastPrice Yes decimal as string Price of the last executed quantity
leavesQuantity Yes decimal as string Remaining quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
cumQuantity Yes decimal as string Order total executed quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
averagePrice Yes decimal as string Average price
created Yes integer UTC timestamp when order request was received on server side. In milliseconds
execReportType Yes new
rejected
suspended
Execution report type
orderRejectReason No string Order reject reason
timestamp No integer UTC timestamp of order placement. In milliseconds
account Yes string Exchange account number the order is placed on
orderSource Yes REST Channel for the order placement

Example:

post url: /api/1/trading/new_order
post data: clientOrderId=11111112&symbol=XBTEUR&side=buy&price=0.1&quantity=100&type=limit&timeInForce=GTC

Example response:

{"ExecutionReport":
	{
	"orderId":"58521038",
	"clientOrderId":"fe02900d762ad2458a942ce5d126c7b2",
	"orderStatus":"new",
	"symbol":"XBTEUR",
	"side":"sell",
	"price":"553.08",
	"quantity":"0.00030",
	"type":"limit",
	"timeInForce":"GTC",
	"lastQuantity":"0.00000",
	"lastPrice":"",
	"leavesQuantity":"0.00030",
	"cumQuantity":"0.00000",
	"averagePrice":"0",
	"created":1480067768415,
	"execReportType":"new",
	"timestamp":1480067768415,
	"account":"VER564A02",
	"orderSource": "REST"
	}
}

Cancel Order

Cancels an order. Returns ExecutionReport JSON object or CancelReject JSON object.

Request: POST /api/1/trading/cancel_order


Parameters:

Parameter Required Type Description
clientOrderId Yes string Order ID, the same as in new order, from 8 to 32 characters

The following fields are used in ExecutionReport object:

Field Required Type Description
orderId Yes integer Order ID on the exchange
clientOrderId Yes string Unique client-generated ID
orderStatus Yes canceled Order status
symbol Yes string Currency symbol
side Yes buy or sell Side of a trade
price Yes - for limit orders decimal as string Order price
quantity Yes decimal as string Order quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
type Yes limit, stopLimit, stop Type of an order
timeInForce Yes GTC - Good-Til-Canceled
IOC - Immediate-Or-Cancel
FOK - Fill-Or-Kill
DAY - Day
GTD - Good-Till-Date
Time in force
expireTime Yes – for GTD orders integer UTC timestamp in milliseconds
stopPrice Yes - for stop orders decimal as string Order stop price
lastQuantity Yes decimal as string Quantity of last executed trade in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
lastPrice Yes decimal as string Price of the last executed quantity
leavesQuantity Yes decimal as string Remaining quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
cumQuantity Yes decimal as string Order total executed quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
averagePrice Yes decimal as string Average price
created Yes integer UTC timestamp when order request was received on server side. In milliseconds
lastTimestamp No integer UTC timestamp of order last update. In milliseconds
execReportType Yes canceled Execution report type
orderRejectReason No string Order reject reason
account Yes string Exchange account number the order is placed on
orderSource Yes string Channel for the order placement. Possible values see in Execution reports

The following fields are used in CancelReject object:

Field Required Type Description
clientOrderId Yes string Unique client-generated ID
cancelRequestClientOrderId Yes string Identifier for order cancel request
rejectReasonCode Yes orderNotFound Order cancel reject reason code
account Yes string Exchange account number the order is placed on

Example:

post url: /api/1/trading/cancel_order
post data: clientOrder_id=11111112

Example response:

{ "ExecutionReport":
  { "orderId": "58521038",
  "clientOrderId": "11111112",
  "orderStatus": "canceled",
  "symbol": "XBTEUR",
  "side": "buy",
  "price": "0.1",
  "quantity": "100",
  "type": "limit",
  "timeInForce": "GTC",
  "lastQuantity": "0",
  "lastPrice": "0",
  "leavesQuantity": "0",
  "cumQuantity": "0",
  "averagePrice": "0",
  "created": 1497515137193,
  "lastTimestamp": 1497515167420,
  "execReportType": "canceled",
  "account": "VER564A02",
  "orderSource": "REST"
  }
}

CancelReject response:

{ "CancelReject": {
  "clientOrderId": "11111112",
  "cancelRequestClientOrderId": "011111112",
  "rejectReasonCode": "orderNotFound",
  "account": "VER564A02"
  }
}

Cancel All Orders

Cancels all orders. Returns ExecutionReport array of JSON object.

Request: POST /api/1/trading/cancel_orders


Parameters:

Parameter Required Type Description
account Yes string Account number
symbols No string Comma-separated list of symbols. Default - all symbols
side No buy or sell Side of a trade

The following fields are used in ExecutionReport object:

Field Required Type Description
orderId Yes integer Order ID on the exchange
clientOrderId Yes string Unique client-generated ID
orderStatus Yes canceled Order status
symbol Yes string Currency symbol
side Yes buy or sell Side of a trade
price Yes - for limit orders decimal as string Order price
quantity Yes decimal as string Order quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
type Yes limit, stopLimit, stop Type of an order
timeInForce Yes GTC - Good-Til-Canceled
IOC - Immediate-Or-Cancel
FOK - Fill-Or-Kill
DAY - Day
GTD - Good-Till-Date
Time in force
expireTime Yes – for GTD orders integer UTC timestamp in milliseconds
stopPrice Yes - for stop orders decimal as string Order stop price
lastQuantity Yes decimal as string Quantity of last executed trade in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
lastPrice Yes decimal as string Price of the last executed quantity
leavesQuantity Yes decimal as string Remaining quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
cumQuantity Yes decimal as string Order total executed quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
averagePrice Yes decimal as string Average price
created Yes integer UTC timestamp when order request was received on server side. In milliseconds
lastTimestamp No integer UTC timestamp of order last update. In milliseconds
execReportType Yes canceled Execution report type
orderRejectReason No string Order reject reason
account Yes string Exchange account number the order is placed on
orderSource Yes string Channel for the order placement. Possible values see in Execution reports

Example:

post url: /api/1/trading/cancel_orders
post data: account=ADE922A21

Example response:

{
 "ExecutionReport": [
  {
  "orderId": "411459298",
  "clientOrderId": "7bd65b9cc64e436a89edef57b841f691",
  "orderStatus": "canceled",
  "symbol": "XBTEUR",
  "side": "sell",
  "price": "280.00",
  "quantity": "1",
  "type": "limit",
  "timeInForce": "GTC",
  "lastQuantity": "0",
  "lastPrice": "",
  "leavesQuantity": "0",
  "cumQuantity": "0",
  "averagePrice": "0",
  "created": 1443530022688,
  "lastTimestamp": 1443530050131,
  "execReportType": "canceled",
  "account": "ADE922A21",
  "orderSource": "WEB"
  },
  {
  "orderId": "411459299",
  "clientOrderId": "a6b41105b54c4304bf7bd8bca29fb060",
  "orderStatus": "canceled",
  "symbol": "XBTEUR",
  "side": "sell",
  "price": "290.00",
  "quantity": "15",
  "type": "limit",
  "timeInForce": "GTC",
  "lastQuantity": "0",
  "lastPrice": "",
  "leavesQuantity": "0",
  "cumQuantity": "0",
  "averagePrice": "0",
  "created": 1443530030502,
  "lastTimestamp": 1443530050131,
  "execReportType": "canceled",
  "account": "ADE922A21",
  "orderSource": "REST"
  }
 ]
}

Get Recent Orders

Returns an array of user's recent orders (order objects) for the last 24 hours, sorted by order update time.

Request: GET /api/1/trading/orders/recent


Parameters:

Parameter Required Type Description
account Yes string Account number
maxResults Yes integer Maximum quantity of returned items, at most 1000
startIndex No integer Zero-based index, 0 by default
sort No asc or desc Orders are sorted ascending (default) or descending
symbols No string Comma-separated list of currency symbols
isTrades No boolean Is trades on order. Default - all
statuses No new
partiallyFilled
filled
canceled
expired
suspended
Comma-separated list of order statuses

The following fields are used in order object:

Field Required Type Description
orderId No integer Order ID on the exchange
orderStatus No new
partiallyFilled
filled
canceled
expired
rejected
suspended
Order status
lastTimestamp Yes integer UTC timestamp of the last change, in milliseconds
orderPrice Yes - for limit orders decimal as string Order price
stopPrice Yes - for stop orders decimal as string Order stop price
orderQuantity Yes decimal as string Order quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
avgPrice Yes decimal as string Average price
quantityLeaves Yes decimal as string Remaining quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
type No limit, market, stopLimit, stop Type of an order
timeInForce No GTC - Good-Til-Canceled
IOC - Immediate-Or-Cancel
FOK - Fill-Or-Kill
DAY - day
GTD - Good-Till-Date
Time in force
cumQuantity No decimal as string Order total executed quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
clientOrderId No string Unique client-generated ID
symbol No string Currency symbol
side No buy or sell Side of a trade
execQuantity No decimal as string Quantity of last executed trade in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
expireTime Yes – for GTD orders integer UTC timestamp in seconds
orderSource Yes string Channel for the order placement. Possible values see in Execution reports
account Yes string Exchange account number the order is placed on

Example response:

{"orders": [
 {
  "orderId": "1",
  "orderStatus": "partiallyFilled",
  "lastTimestamp": 1395659434845,
  "orderPrice": "800",
  "orderQuantity": "1.01",
  "avgPrice": "800",
  "quantityLeaves": "0.01",
  "type": "limit",
  "timeInForce": "GTC",
  "cumQuantity": "1",
  "clientOrderId": "111111111111111111111111",
  "symbol": "XBTEUR",
  "side": "buy",
  "execQuantity": "0.2",
  "orderSource": "WEB",
  "account": "ADE922A21"
 },
 {
  "orderId": "2",
  "orderStatus": "new",
  "lastTimestamp": 1395664550770,
  "orderPrice": "801",
  "orderQuantity": "1",
  "avgPrice": "0",
  "quantityLeaves": "1",
  "type": "limit",
  "timeInForce": "GTC",
  "cumQuantity": "0",
  "clientOrderId": "111111111111111111111112",
  "symbol": "XBTEUR",
  "side": "sell",
  "execQuantity": "0",
  "orderSource": "WEB",
  "account": "ADE922A21"
 }
]}

Get Order State

Returns the state of order(s) if order(s) have been placed on the exchange.

Request: GET /api/1/trading/order


Parameters:

Parameter Required Type Description
clientOrderId Yes string Unique client-generated ID
account Yes string Exchange account number the order is placed on

The following fields are used in order object:

Field Required Type Description
orderId No integer Order ID on the exchange
orderStatus No new
partiallyFilled
filled
canceled
expired
rejected
suspended
Order status
lastTimestamp Yes integer UTC timestamp of the last change, in milliseconds
orderPrice Yes - for limit orders decimal as string Order price
stopPrice Yes - for stop orders decimal as string Order stop price
orderQuantity Yes decimal as string Order quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
avgPrice Yes decimal as string Average price
quantityLeaves Yes decimal as string Remaining quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
type No limit, market, stopLimit, stop Type of an order
timeInForce No GTC - Good-Til-Canceled
IOC - Immediate-Or-Cancel
FOK - Fill-Or-Kill
DAY - day
GTD - Good-Till-Date
Time in force
cumQuantity No decimal as string Order total executed quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
clientOrderId No string Unique client-generated ID
symbol No string Currency symbol
side No buy or sell Side of a trade
execQuantity No decimal as string Last executed quantity, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
orderSource Yes string Channel for the order placement. Possible values see in Execution reports
expireTime Yes – for GTD orders integer UTC timestamp in seconds
account Yes string Exchange account number the order is placed on

Example response:

{
 "orders": [
   {
	"orderId": 425817975,
	"orderStatus": "filled",
	"lastTimestamp": 1446740176886,
	"orderPrice": "729",
	"orderQuantity": "10",
	"avgPrice": "729",
	"quantityLeaves": "0",
	"type": "market",
	"timeInForce": "FOK",
	"cumQuantity": "10",
	"clientOrderId": "afe8b9901b0e4914991291a49175a380",
	"symbol": "XBTEUR",
	"side": "sell",
	"execQuantity": "10",
	"orderSource": "WEB",
	"account": "ADE922A21"
   }
 ]
}

Get My Trades

Returns the trading history - an array of client's trades (trade objects).

Request: GET /api/1/trading/trades


Parameters:

Parameter Required Type Description
by Yes trade_id or ts Selects if filtering and sorting is performed by trade_id or by timestamp
startIndex Yes integer Start index for the query result row to return data from (0 = first line)
maxResults Yes integer Maximum quantity of returned result rows for one request, at most 1000
symbols No string Comma-separated list of currency symbols
account Yes string Account number
sort No asc or desc Trades are sorted ascending or descending (default)
from No 64 bit integer Returns trades with trade_id > specified trade_id (if by=trade_id) or returns trades with timestamp >= specified timestamp(if by=ts`)
till No 64 bit integer Returns trades with trade_id < specified trade_id (if by=trade_id) or returns trades with timestamp < specified timestamp (if by=ts)

The following fields are used in trade object:

Field Required Type Description
tradeId Yes integer Trade ID on the exchange
symbol Yes string Instrument symbol
side Yes buy or sell Side of the client order
originalOrderId Yes integer Order ID on the exchange
clientOrderId No string Unique order ID generated by client. From 8 to 32 characters
execQuantity Yes decimal as string Trade size, in natural currency units (e.g. 1.00000001 for XBTEUR when representing 1 bitcoin and 1 satoshi)
execPrice Yes decimal as string Trade price
timestamp Yes integer Trade timestamp, in milliseconds
fee No decimal as string Fee for the trade, negative value means rebate
isLiqProvided Yes boolean If true then client order was liquidity provider (maker) if false then liquidity taker
feeCurrency No string Currency of the fee, e.g. EUR
account Yes string Account number

Example response:

{"trades": [
  {
	"tradeId": 39,
	"symbol": "XBTEUR",
	"side": "sell",
	"originalOrderId": "114",
	"clientOrderId": "FTO18jd4ou41--25",
	"execQuantity": "10",
	"execPrice": "150",
	"timestamp": 1395231854030,
	"fee": "0.03",
	"isLiqProvided": false,
	"feeCurrency": "EUR",
	"account": "ADE922A21"
  },
  {
	"tradeId": 38,
	"symbol": "XBTEUR",
	"side": "buy",
	"originalOrderId": "112",
	"clientOrderId": "FTO18jd4ou3n--15",
	"execQuantity": "10",
	"execPrice": "140.1",
	"timestamp": 1395231853882,
	"fee": "0.028",
	"isLiqProvided": true,
	"feeCurrency": "EUR",
	"account": "ADE922A21"
  }
]}

Payment Data methods

RESTful API allows to query data using the following methods:

  • get information about created exchange accounts and their balance - /api/1/payment/accounts
  • get a list of payment transactions - /api/1/payment/transactions

Get Balance

Returns the list of client accounts and their balance.

Request: GET /api/1/payment/accounts


Parameters: no parameters

The following fields are returned:

Field Required Type Description
account Yes string Account number
main Yes boolean Is this default account for client
balance Yes array of object Account balance

Data structure for balance object:

Field Required Type Description
currency Yes string Currency symbol, e.g. EUR
available Yes decimal as string Currency amount available for trading or payments
reserved Yes decimal as string Currency amount reserved for active orders

Example response:

{
 "accounts": [
  {"account":"AFN561A01","main":true,"balance": [
	{"currency":"EUR","available":"100.0","reserved":"0.0"},
	{"currency":"XBT","available":"1.00000002","reserved":"0.0"}
 ]},
  {"account":"AFN561A02","main":false,"balance": [
	{"currency":"EUR","available":"120.0","reserved":"0.0"},
	{"currency":"XBT","available":"1.90000002","reserved":"0.0"}
 ]}
]
}

Get Transaction List

Returns a list of payment transactions and their status (array of transactions).

Request: GET /api/1/payment/transactions


Parameters:

Parameter Required Type Description
transactionCode No string Transaction code
from No 64 bit integer Returns transactions with transaction create date >= from
till No 64 bit integer Returns transactions with transaction create date <= till
currency No string Currency symbol, e.g. EUR
direction No in or out Direction of the payment transaction
paymentType No Possible values:
  • internal
  • exchange
  • crypto
  • bank
Payment types with following values:
  • internal – transfer between the client internal accounts
  • exchange – payment to or from the other beneficiary account in the exchange
  • crypto – cryptocurrency payment
  • bank – bank transfer
status No Possible values:
  • unconfirmed
  • pending
  • completed
  • rejected
  • canceled
Transaction status
account No string Own account number in the exchange on which the transaction was maid
accountExternal No string External account number. Can be bank account number, cryptocurrency address or exchange account number for other client
clientTransId No string Transaction ID generated by client
startIndex No integer Start index for the query, default = 0
maxResults No integer Maximum results for the query, maximum value 1000, default = 10
sort No asc or desc Transactions are sorted ascending or descending (default)

Response:

Field Required Type Description
transactions Yes array of object Transaction list

Data structure for transactions object:

Field Required Type Description
transactionCode Yes string Transaction code on the exchange
clientTransId No string Transaction ID generated by client
created Yes 64 bit integer Transaction creation date. Unix time with precision in seconds
direction Yes payin or payout Direction of the payment transaction
paymentType Yes Possible values:
  • internal
  • exchange
  • crypto
  • bank
Payment types with the following values:
  • internal – transfer between the client internal accounts
  • exchange – payment to or from the other beneficiary account in the exchange
  • crypto – cryptocurrency payment
  • bank – bank transfer
account Yes string Own account number in the exchange on which the transaction was made
currency Yes string Currency symbol, e.g. EUR
amount Yes decimal as string Amount of money that was requested for withdrawal or received via wire transfer
status Yes Possible values:
  • unconfirmed
  • pending
  • completed
  • rejected
  • canceled
Transaction status
rejectReason No string Transaction rejection reason
transactionHash No string Cryptocurrency transaction hash
coinAddress No string Beneficiary cryptocurrency address or Globitex cryptocurrency address used for deposits
currencyTrans No string Currency symbol, e.g. EUR for amount debited/credited in client trading account
amountTrans No string Currency amount debited/credited in client trading account
commission No object Transaction commission data
conversion No object Data about currency conversion if funds were deposited in different currency
depositor No object Data about the depositor
beneficiary No object Data about the beneficiary
intermediary No object Data about the intermediary bank
details No string Payment details
revocable No boolean Client can cancel execution of transaction

Data structure for commission object:

Field Required Type Description
currency Yes string Currency symbol, e.g. EUR, for commissions
amount Yes string Commission amount for the transaction
source Yes Possible values:
  • account
  • payment
Commission source. Was commissions taken from the client's account or payment amount

Data structure for conversion object:

Field Required Type Description
rate Yes string Currency conversion rate
currency Yes string Currency symbol, e.g. EUR, for converted funds
amount Yes string Incoming or outgoing currency amount before or after conversion depending on the transaction direction

Data structure for depositor object:

Field Required Type Description
name No string Name of the depositor
bank No string Depositor bank name
swift No string Depositor bank swift code
account No string Depositor account number

Data structure for beneficiary object:

Field Required Type Description
name No string Name of the beneficiary
bank No string Beneficiary bank name
swift No string Beneficiary bank swift code
account No string Beneficiary account number

Data structure for intermediary object:

Field Required Type Description
bank Yes string Intermediary bank name
swift Yes string Intermediary bank swift code
account Yes string Intermediary account number

Example response:

{"transactions": [
  {
	"transactionCode": "3F2504E04F8941D39A0C0305E82C3301",
	"created": 1443171051,
	"direction": "payin",
	"paymentType": "crypto",
	"account": "AFN561A01",
	"currency": "XBT",
	"amount": "1.001",
	"status": "pending",
	"transactionHash": "f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6",
	"coinAddress": "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy",
  },
  {
	"transactionCode": "3F2504E04F8941D39A0C0305E82C3302",
	"created": 1443170051,
	"finished": 1443170951,
	"direction": "payout",
	"paymentType": "crypto",
	"account": "AFN561A01",
	"currency": "XBT",
	"amount": "2.001",
	"status": "completed",
	"transactionHash": "f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a7",
	"coinAddress": "34CRZpt8j81rgh9QhzuBepqPi4cBQSjhjr",
	}
]}

Streaming API

Market data Streaming API based on WebSocket protocol

Market data streaming URL: wss://stream.globitex.com/market-data

Streaming API provides an access to market data. Streaming API is based on WebSocket protocol. All messages are in JSON format.

Useful links:

Basic information

Once client connects to WebSocket endpoint the session is started.

The server broadcasts the following types of messages:

  • MarketDataSnapshotFullRefresh message contains a full snapshot of the order book.
  • MarketDataIncrementalRefresh message contains incremental changes

Some recommendations to consider:

  • The application could receive the first snapshot and maintain the order book by applying incremental updates.
  • It's recommended to invalidate a state of the application periodically using full snapshots.
  • It's recommended to check sequence numbers and to drop updates with non-monotonous sequence numbers.
MarketDataSnapshotFullRefresh message

Summary: contains a full snapshot of the order book.


The following fields are used in MarketDataSnapshotFullRefresh object:

Field Description
snapshotSeqNo Last price change sequence number included in this market data snapshot. Each symbol has its own sequence
timestamp UTC timestamp for market data snapshot, in milliseconds
symbol Symbol of instrument traded on exchange
exchangeStatus Exchange status: "working" - trading is open; "suspended" - trading is suspended
ask, bid Sorted arrays of price levels in the order book. For full snapshot all price levels are provided

Example message:

{"MarketDataSnapshotFullRefresh": {
 "snapshotSeqNo": 899009,
 "symbol": "XBTEUR",
 "exchangeStatus": "working",
 "ask": [
   {
	"price": "101.42",
	"size": "7"
   },
   {
	"price": "101.85",
	"size": "5"
   },
   {
	"price": "102.59",
	"size": "1"
   },
   {
	"price": "114.53",
	"size": "3"
   },
   {
	"price": "114.54",
	"size": "6"
   },
   {
	"price": "114.55",
	"size": "19"
   }
 ],
 "bid": [
   {
	"price": "89.72",
	"size": "79"
   },
   {
	"price": "89.71",
	"size": "158"
   },
   {
	"price": "89.7",
	"size": "166"
   },
   {
	"price": "89.69",
	"size": "231"
   },
   {
	"price": "89.68",
	"size": "169"
   },
   {
	"price": "89.67",
	"size": "186"
   },
   {
	"price": "89.66",
	"size": "178"
   }
 ],
 "timestamp": 1381394357861
}}
MarketDataIncrementalRefresh message

Summary: contains incremental changes of the order book and individual trades.


The following fields are used in MarketDataIncrementalRefresh object:

Field Description
seqNo Monotone increasing number of the snapshot, each symbol has its own sequence
timestamp UTC timestamp for market data snapshot, in milliseconds
symbol Symbol of Instrument traded on exchange
exchangeStatus Exchange status: "working" - trading is open; "suspended" - trading is suspended
ask, bid An array of changes in the order book where price is a price, size is new size. size=0 means that the price level has been removed
trade Trade data object
trade->price Price for the trade
trade->size Size of the trade
trade->tradeId Trade identifier on the exchange
trade->timestamp UTC timestamp for the trade, in milliseconds
trade->side Side of the "taker" order

Example message:

{"MarketDataIncrementalRefresh": {
 "seqNo": 546693,
 "symbol": "XBTEUR",
 "exchangeStatus": "working",
 "ask": [],
 "bid": [
   {
	"price": "100.98",
	"size": "3"
   }
 ],
 "trade": [
   {
	"price": "100.98",
	"size": "5",
	"tradeId":1504345454,
	"timestamp": 1497534522703,
	"side":"buy"
   }
 ],
 "timestamp": 1497534522806
}}

Market Data Streaming API based on Socket.IO protocol

The API provides Socket.IO version 1.0.x protocol for receiving market data. It supports:

  • WebSocket and xhr-polling transport
  • multiplexing a single connection with Socket.IO namespaces (see namespaces below)

Event data is returned in JSON format.


Socket.IO URL base: https://stream.globitex.com:8080

Trades namespace

Namespace: trades

URL: /trades/:symbol e.g. /trades/XBTEUR

Event: trade


The following fields are used in trade object:

Field Required Type Description
amount Yes decimal as string Trade amount
price Yes decimal as string Trade price

Event example:

{"amount":"0.15","price":"478.33"}
Ticker namespace

Namespace: ticker

To receive events for all instruments:


URL: /ticker

To receive events fro specific instrument:

URL: /ticker/:symbol e.g. /ticker/XBTEUR

Event: ticker


The following fields are used in trade object:

Field Required Type Description
volume Yes decimal as string Traded volume in instrument base currency
symbol Yes decimal as string Trade price
high Yes decimal as string Highest price
last Yes decimal as string Last trade price
low Yes decimal as string Lowest price
volumeQuote Yes decimal as string Traded volume in quote currency
ask Yes decimal as string Current ask price
bid Yes decimal as string Current bid price
open Yes decimal as string Day opening price
timestamp Yes decimal as string UTC timestamp for the the event. In milliseconds

Useful links:

Event example:

{"volume":"0.00000000","symbol":"XBTEUR","high":"0.00","last":"0.00","low":"0.00","volumeQuote":"0","ask":"470.02","bid":"459.38","open":"460.00","timestamp":1477466606204}
Back to platform