Back to top

itBit FIX API

FIX (Financial Information eXchange) is an electronic messaging protocol widely adopted by financial institutions to transmit trading activity such as submitting or canceling orders and receiving execution information. itBit’s FIX api is based on FIX 4.2 and modeled after common forex FIX implementations.

Getting Started

Contact api@itbit.com for information regarding fix connectivity. Before an initial FIX connection, itBit will reach out with information about setting up your account via email. It will also contain instructions on creating a staging account.

The informational section of the email may look like this:

Our CompID will be: ITBIT or ITBIT_STAGING (if staging)

Your CompID will be: CLIENTNAME

Your UserID will be: D46G82B9-52BF-4617-A78D-REDACTED

Your WalletID will be: D75H2D-D14B-477A-REDACTED

Our FIX service Host: fix.itbit.com or staging-fix.itbit.com (if staging)

The port number you will connect on is: 4459


Identity Mapping

itBit Identity FIX Tag
User ID Account (1)
Wallet ID ClientID (109)
Client’s CompID SenderCompID (49)
itBit’s CompID TargetCompID (56)

Cancel on Disconnect

Cancel on Disconnect is an itBit FIX API feature that will automatically submit a request to the exchange to cancel all open FIX orders whenever you disconnect from the FIX API. It is enabled by default.


FIX Connection

We will expect an SSL connection over TCP to the host and port you are assigned. We have SSL Termination based on a CA cert. You will be required to authenticate through SSL.

NOTE: itBit’s FIX and REST APIs will be down for scheduled maintenance every Friday from 10-10:30pm GMT (5-5:30pm EST, 5-5:30am SGT). Sequence numbers on the FIX connection are reset during this period.


Message Types

The supported message types and corresponding fields are listed in this section. The required fields outside of the standard headers for the message type are highlighted.

Logon

A FIX session is initiated by the client with a logon message. EncryptedMethod (FIX tag 98) must be set to 0. HeartBtInt (108) needs to be set, the default value is 30 seconds.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 72
35 MsgType A Logon
49 SenderCompID CLIENT01
56 TargetCompID ITBIT
34 MsgSeqNum 1
52 SendingTime 20150607-15:43:16.543
98 EncryptedMethod Y 0 None other
108 HeartBtInt Y 30
10 CheckSum 078

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 72
35 MsgType A Logon
49 SenderCompID ITBIT
56 TargetCompID CLIENT01
34 MsgSeqNum 1
52 SendingTime 20150607-15:43:16.543
98 EncryptedMethod Y 0 None other
108 HeartBtInt Y 30
10 CheckSum 078

Logon with Reset Seq Num

itBit supports client initiated message sequence number resets via logon with ResetSeqNumFlag (141) set to Y.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 78
35 MsgType A Logon
49 SenderCompID CLIENT01
56 TargetCompID ITBIT
34 MsgSeqNum 1
52 SendingTime 20150607-15:43:16.543
98 EncryptedMethod Y 0 None other
108 HeartBtInt Y 30
141 ResetSeqNumFlag Y Y Yes reset sequence numbers
10 CheckSum 133

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 78
35 MsgType A Logon
49 SenderCompID ITBIT
56 TargetCompID CLIENT01
34 MsgSeqNum 1
52 SendingTime 20150607-15:43:16.543
98 EncryptedMethod Y 0 None other
108 HeartBtInt Y 30
141 ResetSeqNumFlag Y Y Yes reset sequence numbers
10 CheckSum 017

Heartbeat

In standard FIX, when either end of the FIX connection has not received a message in HeartBtInt (108) seconds, a heartbeat message will be transmitted (MsgType 0). As noted above, the default value for HeartBtInt is 30 seconds.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 60
35 MsgType Y 0 Heartbeat
49 SenderCompID CLIENT01
56 TargetCompID ITBIT
34 MsgSeqNum 2
52 SendingTime 20150607-15:43:16.543
10 CheckSum 017

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 0056
35 MsgType Y 0 Heartbeat
49 SenderCompID ITBIT
56 TargetCompID CLIENT01
34 MsgSeqNum 2
52 SendingTime 20150607-15:43:16.534
10 CheckSum 185

New Order

Orders should be submitted as New Order Single (MsgType D), itBit currently supports only limit orders (OrdType 2). Both HandlInst (21) and TimeInForce (59) must be set with a value of 1. Along with the currency pair populated in Symbol (55), the SecurityType (167) must be set to FOR.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 230
35 MsgType D Order Single
49 SenderCompID CLIENT01
56 TargetCompID ITBIT
34 MsgSeqNum 209
52 SendingTime 20150607-15:43:16.543
11 CIOrdID Y Order_762
109 ClientID Y 5A196279-2203-XC44-9102-KL9E4E16A36F
1 Account Y 6CKH6123-09XC-5611-671K-1900KBO6A889
21 HandlInst Y 1 Automated execution order private no broker intervention
55 Symbol Y XBTUSD
167 SecurityType Y FOR Foreign Exchange Contract
54 Side Y 1 Buy
60 TransactTime Y 20150607-15:43:16.543
38 OrderQty Y 1
40 OrdType Y 2 Limit
44 Price Y 230
59 TimeInForce Y 1 Good till cancel
10 CheckSum 185

Order Cancel Request

Orders should referenced by their ClOrdID (11) and OrigClOrdID (41)

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 257
35 MsgType F Order cancel request
49 SenderCompID CLIENT01
56 TargetCompID ITBIT
34 MsgSeqNum 210
52 SendingTime 20150607-15:43:16.543
41 OrigClOrdID Y Order_762
11 ClOrdID Y Cancel763
1 Account Y 6CKH6123-09XC-5611-671K-1900KBO6A889
109 ClientID Y 5A196279-2203-XC44-9102-KL9E4E16A36F
55 Symbol Y XBTUSD
167 SecurityType Y FOR Foreign Exchange Contract
54 Side Y 1 Buy
60 TransactTime Y 20150607-15:43:16.543
38 OrderQty Y 1
10 CheckSum 246

Order Cancel Reject

If an order can not be canceled, an Order Cancel Reject message will be sent to the client with CxRejReason (102) populated with a reason

Message Format

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 0180
35 MsgType 9 Order cancel reject
49 SenderCompID ITBIT
56 TargetCompID CLIENT01
34 MsgSeqNum 221
52 SendingTime 20150607-15:43:16.543
434 CxlRejResponseTo Y 1
11 ClOrdID Y Cancel764
39 OrdStatus Y 4 Canceled
41 OrigClOrdID Y Order_762
37 OrderID Y 11196679-9103-JK44-0901-XKNE4E16A12K
1 Account Y 6CKH6123-09XC-5611-671K-1900KBO6A889
102 CxlRejReason Y 0 Too late to cancel
10 CheckSum 112

Order Status Request

Order Status Request (MsgType H) is used to query the current status of an order.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 170
35 MsgType H Order status request
49 SenderCompID CLIENT01
56 TargetCompID ITBIT
34 MsgSeqNum 341
52 SendingTime 20150607-15:43:16.543
11 ClOrdID Y Order_782
109 ClientID Y 5A196279-2203-XC44-9102-KL9E4E16A36F
1 Account Y 6CKH6123-09XC-5611-671K-1900KBO6A889
55 Symbol Y XBTUSD
54 Side Y 1 Buy
10 CheckSum 247

Execution Report - Pending New

New Orders will return a Pending New Order Execution Report response (MsgType 8), (OrdStatus A)

Message Format

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 296
35 MsgType 8 Execution report
49 SenderCompID ITBIT
56 TargetCompID CLIENT01
34 MsgSeqNum 208
52 SendingTime 20150607-15:43:16.500
54 Side Y 1 Buy
150 ExecType Y A Pending New
32 lastShares Y 0
1 Account Y 6CKH6123-09XC-5611-671K-1900KBO6A889
31 LastPx Y 0
151 LeavesQty Y 1
12 Commission Y 0.0
60 TransactTime Y 20150607-15:43:16.500
58 Text Y Pending New Order
20 ExecTransType Y 0 New
55 Symbol Y XBTUSD
17 ExecID Y 0
14 CumQty Y 0
13 CommType Y 3
11 ClOrdID Y 1806809709
44 Price Y 6000
6 AvgPx Y 0
41 OrigClOrdID Y 1806809709
40 OrdType Y 2 Limit
39 OrdStatus Y A Pending New
38 OrderQty Y 1
37 OrderID Y 11196679-9103-JK44-0901-XKNE4E16A12K
10 CheckSum 224

Execution Report - New

New Orders will return a New Order Execution Report response (MsgType D), (OrdStatus 0)

Message Format

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 230
35 MsgType D Execution report
49 SenderCompID ITBIT
56 TargetCompID CLIENT01
34 MsgSeqNum 209
52 SendingTime 20150607-15:43:16.543
54 Side Y 1 Buy
150 ExecType Y 0 New
32 lastShares Y 0
1 Account Y 6CKH6123-09XC-5611-671K-1900KBO6A889
31 LastPx Y 0
151 LeavesQty Y 1
60 TransactTime Y 20150607-15:43:16.543
58 Text Y New Order
20 ExecTransType Y 0 New
55 Symbol Y XBTUSD
17 ExecID Y 0
14 CumQty Y 0
11 ClOrdID Y Order_762
44 Price Y 230
6 AvgPx Y 0
41 OrigClOrdID Y Order_762
40 OrdType Y 2 Limit
39 OrdStatus Y 0 New
38 OrderQty Y 1
37 OrderID Y 11196679-9103-JK44-0901-XKNE4E16A12K
10 CheckSum 039

Execution Report - Filled

Filled Order Execution Report responses are returned for entirely filled orders

Message Format

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 273
12 Commission 0.1234 Commission Paid
13 CommType 3 Abasolute Value
35 MsgType 8 Execution report
49 SenderCompID ITBIT
56 TargetCompID CLIENT01
34 MsgSeqNum 262
52 SendingTime 20150607-15:43:16.543
54 Side Y 1 Buy
150 ExecType Y 2 New
32 lastShares Y 1
1 Account Y 6CKH6123-09XC-5611-671K-1900KBO6A889
31 LastPx Y 231
151 LeavesQty Y 0
60 TransactTime Y 20150607-15:43:16.543
58 Text Y Filled Order
20 ExecTransType Y 0 New
55 Symbol Y XBTUSD
17 ExecID Y 11365
14 CumQty Y 1
11 ClOrdID Y Order_762
44 Price Y 230
6 AvgPx Y 230
40 OrdType Y 2 Limit
39 OrdStatus Y 2 Filled
38 OrderQty Y 1
37 OrderID Y 11196679-9103-JK44-0901-XKNE4E16A12K
10 CheckSum 026
5851 LiquidityInd 1 1-Add, 2-Remove

Execution Report - Partial Fill

Partial Fill Execution Report responses are returned for partially filled orders.

Message Format

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 0279
12 Commission 0.1234 Commission Paid
13 CommType 3 Abasolute Value
35 MsgType 8 Execution report
49 SenderCompID ITBIT
56 TargetCompID CLIENT01
34 MsgSeqNum 250
52 SendingTime 20150607-15:43:16.543
54 Side Y 1 Buy
150 ExecType Y 1 New
32 lastShares Y 0.2
1 Account Y 6CKH6123-09XC-5611-671K-1900KBO6A889
31 LastPx Y 250
151 LeavesQty Y 0.8
60 TransactTime Y 20150607-15:43:16.543
58 Text Y Filled Order
20 ExecTransType Y 0 New
55 Symbol Y XBTUSD
17 ExecID Y 11361
14 CumQty Y 0.2
11 ClOrdID Y Order_774
44 Price Y 345
6 AvgPx Y 250
40 OrdType Y 2 Limit
39 OrdStatus Y 1 Partially Filled
38 OrderQty Y 1
37 OrderID Y 11196679-9103-JK44-0901-XKNE4E16A12K
10 CheckSum 082
5851 LiquidityInd 1 1-Add, 2-Remove

Execution Report - Pending Cancel

A Pending Cancel Execution Report is an acknowledgement that a cancel request has been received by itBit. It is not an indication the order has been canceled.

Message Format

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 0286
35 MsgType 8 Execution report
49 SenderCompID ITBIT
56 TargetCompID CLIENT01
34 MsgSeqNum 218
52 SendingTime 20150607-15:43:16.543
54 Side Y 1 Buy
150 ExecType Y 6 Pending Cancel
32 lastShares Y 0
1 Account Y 6CKH6123-09XC-5611-671K-1900KBO6A889
31 LastPx Y 0
151 LeavesQty Y 1
60 TransactTime Y 20150607-15:43:16.543
58 Text Y Order Cancel Pending
20 ExecTransType Y 0 New
55 Symbol Y XBTUSD
17 ExecID Y 0
14 CumQty Y 0
11 ClOrdID Y Cancel763
44 Price Y 345
6 AvgPx Y 0
41 OrigClOrdID Y Order_762
40 OrdType Y 2 Limit
39 OrdStatus Y 6 Pending cancel
38 OrderQty Y 1
37 OrderID Y 11196679-9103-JK44-0901-XKNE4E16A12K
10 CheckSum 137

Execution Report - Canceled

An Execution Report with OrdStatus 4 is sent when an order has been canceled.

Message Format

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 0314
35 MsgType 8 Execution report
49 SenderCompID ITBIT
56 TargetCompID CLIENT01
34 MsgSeqNum 219
52 SendingTime 20150607-15:43:16.543
54 Side Y 1 Buy
150 ExecType Y 4 Canceled
32 lastShares Y 0
1 Account Y 6CKH6123-09XC-5611-671K-1900KBO6A889
31 LastPx Y 0
151 LeavesQty Y 1
60 TransactTime Y 20150607-15:43:16.543
58 Text Y Cancelled Order
20 ExecTransType Y 0 New
55 Symbol Y XBTUSD
17 ExecID Y 00000000-0000-0000-0000-000000000000
14 CumQty Y 0
11 ClOrdID Y Cancel763
44 Price Y 0
6 AvgPx Y 0
41 OrigClOrdID Y Order_762
40 OrdType Y 2 Limit
39 OrdStatus Y 4 Canceled
38 OrderQty Y 1
37 OrderID Y 11196679-9103-JK44-0901-XKNE4E16A12K
10 CheckSum 096

Execution Report - Order Reject

If an order is rejected for any reason, an Order Reject Execution Report will be sent with OrdRejReason populated

Message Format

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 0327
35 MsgType 8 Execution report
49 SenderCompID ITBIT
56 TargetCompID CLIENT01
34 MsgSeqNum 341
52 SendingTime 20150607-15:43:16.543
54 Side Y 1 Buy
150 ExecType Y 8 Rejected
32 lastShares Y 0
1 Account Y 6CKH6123-09XC-5611-671K-1900KBO6A889
31 LastPx Y 0
103 OrdrejReason Y 1 Refer to table below
151 LeavesQty Y 0
60 TransactTime Y 20150607-15:43:16.543
58 Text Y Symbol is invalid Reject message
20 ExecTransType Y 0 New
55 Symbol Y XBTUSD
17 ExecID Y dkcyba019-1ser-ace3-0193-nlandlb0911
14 CumQty Y 0
11 ClOrdID Y Cancel785
44 Price Y 230
6 AvgPx Y 0
41 OrigClOrdID Y Order_785
40 OrdType Y 2 Limit
39 OrdStatus Y 8 Rejected
38 OrderQty Y 1
37 OrderID Y 11196679-9103-JK44-0901-XKNE4E16A12K
10 CheckSum 174

An order can be rejected for different reason Reject Reason for tag 103

Tag Field Name Req. Value Description
103 OrdrejReason Y 0 Broker option
103 OrdrejReason Y 1 Unknown symbol
103 OrdrejReason Y 2 Exchange closed
103 OrdrejReason Y 3 Order exceeds limit
103 OrdrejReason Y 5 Unknown Order
103 OrdrejReason Y 6 Duplicate Order
103 OrdrejReason Y 8 Stale Order

Execution Report - Order Status

An order status request message will return the current status of an order. The fields lastShares (32) and and lastPx (31) contain the price and amount of the the latest partial or full execution of the order, a completed order will have a value of 0 in the LeavesQty (151) field. Note: lastShares (32) was relabeled as lastQty in later versions of FIX, the tag number and purpose are identical.

Message Format

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 0300
35 MsgType 8 Execution report
49 SenderCompID ITBIT
56 TargetCompID CLIENT01
34 MsgSeqNum 330
52 SendingTime 20150607-15:43:16.543
54 Side Y 1 Buy
150 ExecType Y 0 New
32 lastShares Y 0
1 Account Y 6CKH6123-09XC-5611-671K-1900KBO6A889
31 LastPx Y 0
151 LeavesQty Y 0
60 TransactTime Y 20150607-15:43:16.543
58 Text Y
20 ExecTransType Y 0 New
55 Symbol Y XBTUSD
17 ExecID Y dkcyba019-1ser-ace3-0193-nlandlb0911
14 CumQty Y 0
11 ClOrdID Y Order_782
44 Price Y 230
6 AvgPx Y 0
41 OrigClOrdID Y Order_782
40 OrdType Y 2 Limit
39 OrdStatus Y 0 New
38 OrderQty Y 1
37 OrderID Y 11196679-9103-JK44-0901-XKNE4E16A12K
10 CheckSum 118

Logout

A logout message ends the FIX session. An unsolicited logout may indicate a connection or account issue, SendingTime (52) will have a human readable message indicating if there is an issue. In some cases, a logout message may be associated with an account’s trading permissions being suspended; if you are unable to reconnect with ResetSeqNumFlag (141) set to Y please engage with itBit support.

Message Format

Incoming message

Tag Field Name Req. Value Description
8 BeginString FIX.4.2
9 BodyLength 0056
35 MsgType 0 Heartbeat
49 SenderCompID CLIENT01
56 TargetCompID ITBIT
34 MsgSeqNum 2
52 SendingTime 20150607-15:43:16.534
58 Text 00140000000Wn1ynf_590- CODE: 1-200-A-141: Expected Logon Message with 141
10 CheckSum 107

Encoded Tags

Some FIX Tag short codes and their values are listed below. The description field in the message type tables above also contain this information.

1. MsgType:

Value Description
A Logon
D Execution report
8 Execution report

2. ExecType

Value Description
0 Logon
1 Fill
3 Done
4 Canceled
D Order Changed

Certification Process

Before connecting to the production FIX environment, clients will connect to itBit’s staging environment and test the following scenarios in order to verify their FIX implementation.

Required Test Cases

Symbology Certification Test Cases Notes
SYM1 Symbology - Valid Market User submits order for each of the itBit markets which the user expects to trade and processes corresponding confirmation response.
SYM2 Symbology - Invalid Market User submits order for invalid market symbol (eg. “XXXXXX”) and processes the corresponding reject response.
LIM1 Buy Limit (Buy 1.1 @ Limit $200 XBTUSD) User submits limit Buy order for valid quantity, price, and market and processes corresponding confirmation response.
LIM2 Sell Limit (Sell 0.001 @ Limit $200 XBTUSD) User submits limit Sell order for valid quantity, price, and market and processes corresponding confirmation response.
EX1 Single Execution - Fill User submits marketable limit order (limit price will be immediately executed, either partially or completely) and processes the corresponding confirmation and fill responses.
CXL1 Cancel New User submits a limit outside of current market price (so the order will not execute), processes the corresponding confirmation response, and then issues a cancel request and processes the corresponding cancel confirmation.
CXL2 Cancel Reject User attempts to cancel an invalid or non-existent order ID, or an order which has been previously completely filled, and processes the corresponding cancel reject response.

Optional Test Cases

Symbology Certification Test Cases Notes
OPT1 Cancel on Disconnect User submits multiple orders with the limit outside of current market price (so the orders will not execute), processes the corresponding confirmation responses, and then disconnects their FIX session to verify all open orders are canceled."
OPT2 Status Request User submits a status request for a previously submitted order processes the corresponding status response.

Generated by aglio on 20 Nov 2018