Exchange FIX Order Entry Messages 5.0
About this API:
- Baseline: FIX 5.0 SP2 specification.
- Environments: Production, Sandbox
- Production:
tcp+ssl://fix-ord.exchange.coinbase.com:6121
- Sandbox:
tcp+ssl://fix-ord.sandbox.exchange.coinbase.com:6121
Components
Standard Header
Fields that go at the beginning of every message. This exists for all messages sent and received.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
8 | BeginString | String | Y | Must be set to FIXT.1.1 and be the first field in the message.(Since FIX version 5.0 this field now represents the session version. The application version gets specified in Logon message's DefaultApplVerID (1137) tag.) |
9 | BodyLength | Int | Y | Message length in bytes up to the checksum field (tags after BodyLength (9) and before Checksum (10) ). This must be the second field in message. |
35 | MsgType | String | Y | The type of message proceeding the header, must be the third field in the message. Supported values include: Admin Messages A = Logon0 = Heartbeat1 = TestRequest3 = Reject5 = LogoutApplication Messages D = NewOrderSingleF = OrderCancelRequestG = OrderCancelReplaceRequestH = OrderStatusRequestj = BusinessMessageReject8 = ExecutionReport9 = OrderCancelRejectU4 = OrderCancelBatchU5 = OrderCancelBatchRejectU6 = NewOrderBatchU7 = NewOrderBatchReject |
49 | SenderCompID | String | Y | Client API key (on messages from the client). |
56 | TargetCompID | String | Y | Must be Coinbase (on messages from client). |
34 | MsgSeqNum | Int | Y | Monotonically increasing sequence number of the message. |
97 | PossResend | Boolean | C | Indicates if the message may have already been sent with a different sequence number. This is useful when performing an application level replay on the drop copy session. N = Original transmission Y = Possible resend |
52 | SendingTime | UTCTimestamp | Y | UTC time that the order was sent down to millisecond resolution in the format YYYYMMDD-HH:MM:SS.sss |
83 | RptSeq | Int | C | The feed sequence number of the message corresponding to the RptSeq in FIX 5.0 Market Data |
Standard Trailer
Fields that go at the end of every message.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
10 | CheckSum | String | Y | Three byte checksum calculated by summing every byte in the message up to and not including the checksum field itself. This value is then moduloed by 256 and written with prefixed 0 s (if necessary) to meet the 3 byte requirement. |
Administrative
Logon (35=A)
First message that is required immediately upon connection to authenticate the connection.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
98 | EncryptMethod | Int | N | Must be 0 (None) |
108 | HeartBtInt | Int | O | Must be ≤ 30 (secs). Server sends Test Request if client messages are not received in approximately (HeartBtInt x 1.5 ) seconds. Server terminates session if client messages are not received in approximately (HeartBtInt x 2 ) seconds. Defaults to 10 seconds if not value provided. |
141 | ResetSeqNumFlag | Boolean | Y | Sequence numbers always get reset after a disconnect. Defaults to Y and a value of N will result in a Reject on the Login message. |
553 | Username | String | Y | Any string is accepted. |
554 | Password | String | Y | Passphrase for Client API key. |
95 | RawDataLength | Int | Y | Number of bytes in RawData field. |
96 | RawData | String | Y | Client message signature (see Signing a message) |
1137 | DefaultApplVerID | String | Y | Contains the version of the FIX protocol the exchange uses. Only FIX50SP2 is supported. Supported values:
|
8001 | DefaultSelfTradePreventionStrategy | Char | N | The default SelfTradePreventionStrategy applied to all orders sent on the session unless overridden on a per order basis using the SelfTradePreventionStrategy (8000) in the order request message. The following values specify what to do when two orders submitted by the same portfolio attempt to match: N = Cancel aggressing orderQ = Cancel both ordersDefault if not specified is Cancel both orders ( Q ). |
8013 | CancelOrdersOnDisconnect | Char | N | S = Cancel all session orders on disconnectY = Cancel all profile orders on disconnect (recommended) |
9406 | DropCopyFlag | Char | N | N = Normal order-entry sessionY = Drop copy session that only returns Execution Reports and Quote Status Reports |
Heartbeat (35=0)
Sent at a prearranged interval from both sides to indicate liveness of the connections and used in response to a TestRequest message (35=1).
Tag | Name | Type | Required | Description |
---|---|---|---|---|
112 | TestReqID | String | C | Conditionally required when the heartbeat message is sent in response to a TestRequest (35=1) message. |
TestRequest (35=1)
This message forces the other side of the connection to send a Heartbeat message (35=0) with the TestReqID
(tag 112) populated with the same value provided on this message.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
112 | TestReqID | String | Y | A unique identifier used to track the response to a test request. |
Reject (35=3)
A session level reject message sent when the FIX session can't process a message.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
45 | RefSeqNum | Int | Y | The MsgSeqNum of the referenced message that was rejected. |
371 | RefTagID | Int | N | The tag number of the FIX field referenced in the reject. |
372 | RegMsgType | String | N | The MsgType of the FIX message referenced in the reject. |
373 | SessionRejectReason | Int | N | A code to quickly identify common reasons for a reject. Supported values: 0 = Invalid Tag Number1 = Required Tag Missing2 = Tag not defined for this message type3 = Undefined tag4 = Tag specified without a value5 = Value is incorrect (out of range) for this tag6 = Incorrect data format for value8 = Signature problem9 = CompID problem10 = SendingTime Accuracy Problem11 = Invalid MsgType 13 = Tag appears more than once14 = Tag specified out of required order15 = Repeating group fields out of order16 = Incorrect NumInGroup count for repeating group17 = Non "Data" value includes field delimiter (<SOH> character)18 = Invalid/Unsupported Application Version99 = Other |
58 | Text | String | N | A message explaining why the message was rejected. |
Logout (35=5)
Sent by either side to initiate session termination. The side which receives this message first should reply with the same message type to confirm session termination.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
58 | Text | String | N | Description of the disconnection reason. |
Trading
NewOrderSingle (35=D)
Used to submit a new spot order to the Exchange matching engine.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
11 | ClOrdID | UUID | Y | An identifier specified by the sender to uniquely identify other messages correlating to this request. It must be a variant 1 UUIDv4 that follows the standard format. This means all lowercase and hyphens that group the characters in sequences of 8, 4, 4, 4, 12 (e.g. 1985ca2d-61ef-49f1-bfce-6c39d8462914 ). Failure to follow this formatting will result in a reject. |
18 | ExecInst | Char | N | The execution instruction flags for the order. Supported values: A = Add Liquidity Only (Post Only) |
38 | OrderQty | Decimal | C | The amount of the base asset to be transacted. Required except for market orders with CashOrderQty specified. |
1138 | DisplayQty | Decimal | C | Maximum size within an order to be displayed. Must be > 10% of OrderQty |
152 | CashOrderQty | Decimal | C | The order size in quote units (e.g., USD) (Market order only). |
40 | OrdType | Char | Y | The type of order for the request which can be. Supported values: 1 = Market2 = Limit4 = Stop Limit |
44 | Price | Decimal | C | The limit price for limit orders of the quote asset. The decimal precision must fall within the requirements for each market, see the REST API for precision and decimal limits. |
54 | Side | Char | Y | Side of the order. Supported values: 1 = Buy2 = Sell |
55 | Symbol | String | Y | Symbol of the instrument being traded (e.g. BTC-USDC ) |
59 | TimeInForce | Char | Y | Specifies how long the order remains in effect. Supported values: 1 = Good Till Cancel (GTC)3 = Immediate Or Cancel (IOC)4 = Fill Or Kill (FOK)6 = Good Till Date (GTD) |
126 | ExpireTime | UTCTimestamp | C | Required when TimeInForce (59) is set to GTD (6). Specifies the time when a GTD order expires. Required for GTD orders and should not be set for other orders. |
99 | StopPx | Decimal | C | Specifies the quote price at which the order activates for Stop Limit order types (40=4) |
1109 | TriggerPriceDirection | Char | N | Supported values:U = Trigger if market price goes UP to or through StopPx (default if StopPx is greater than current market price)D = Trigger if market price goes DOWN to or through StopPx (default if StopPx is less than current market price)For stop-limit orders, this field is optional but recommended. |
7928 | SelfTradeType | Char | N | The following values specify what to do when two orders are submitted by the same user attempt to match:D = Decrement and Cancel (default if not specified)O = Cancel Oldest (resting order)N = Cancel Newest (aggressing order)B = Cancel Both |
NewOrderBatch (35=U6)
Used to submit new spot orders to the Exchange matching engine. Clients should use this message to submit multiple orders to the Exchange matching engine at the same time. Currently, all the orders submitted in a batch must be for the same symbol.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
8014 | BatchID | UUID | Y | An identifier specified by the sender to uniquely identify other messages correlating to this request. It must be a variant 1 UUIDv4 that follows the standard format. This means all lowercase and hyphens that group the characters in sequences of 8, 4, 4, 4, 12 (e.g. 1985ca2d-61ef-49f1-bfce-6c39d8462914 ). Failure to follow this formatting will result in a reject. |
73 | NoOrders | Int | Y | Number of orders in the request. |
=>11 | ClOrdID | UUID | Y | An identifier specified by the sender to uniquely identify other messages correlating to this request. It must be a variant 1 UUIDv4 that follows the standard format. This means all lowercase and hyphens that group the characters in sequences of 8, 4, 4, 4, 12 (e.g. 1985ca2d-61ef-49f1-bfce-6c39d8462914 ). Failure to follow this formatting will result in a reject. |
=>18 | ExecInst | Char | N | The execution instruction flags for the order. Supported values: A = Add Liquidity Only (Post Only) |
=>38 | OrderQty | Decimal | C | The amount of the base asset to be transacted. Required except for market orders with CashOrderQty specified. |
=>152 | CashOrderQty | Decimal | C | The order size in quote units (e.g., USD) (Market order only). |
=>40 | OrdType | Char | Y | The type of order for the request which can be. Supported values: 1 = Market2 = Limit4 = Stop Limit |
=>44 | Price | Decimal | C | The limit price for limit orders of the quote asset. The decimal precision must fall within the requirements for each market, see the REST API for precision and decimal limits. |
=>54 | Side | Char | Y | Side of the order. Supported values: 1 = Buy2 = Sell |
=>55 | Symbol | String | Y | Symbol of the instrument being traded (e.g. BTC-USDC ) |
=>59 | TimeInForce | Char | Y | Specifies how long the order remains in effect. Supported values: 1 = Good Till Cancel (GTC)3 = Immediate Or Cancel (IOC)4 = Fill Or Kill (FOK)6 = Good Till Date (GTD) |
=>126 | ExpireTime | UTCTimestamp | C | Required when TimeInForce (59) is set to GTD (6). Specifies the time when a GTD order expires. Required for GTD orders and should not be set for other orders. |
=>99 | StopPx | Decimal | C | Specifies the quote price at which the order activates for Stop Limit order types (40=4). |
=>7928 | SelfTradeType | Char | N | Represents type of cancel instruction when two orders submitted by the same user attempt to match. Supported values: D =Decrement and Cancel (default if not specified)O =Cancel Oldest (resting order)N =Cancel Newest (aggressing order)B =Cancel Both |
NewOrderBatchReject (35=U7)
This message is sent by Coinbase Exchange back to clients when all the orders in a New Order Batch (35=U6) Request are rejected. When only some of the orders are rejected, Execution Report - Rejected messages are sent out for each of the orders individually.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
8014 | BatchID | UUID | Y | Client-supplied ID identifying the new order batch request. |
58 | Text | String | Y | The reason the batch of orders was rejected. |
OrderCancelRequest (35=F)
For order cancel requests, Coinbase recommends that you use the same FIX connection that was used to place the order.
Used to cancel an order that is still live on the Exchange matching engine.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
11 | ClOrdID | UUID | Y | An identifier specified by the sender to uniquely identify other messages correlating to this request. It must be a variant 1 UUIDv4 that follows the standard format. This means all lowercase and hyphens that group the characters in sequences of 8, 4, 4, 4, 12 (e.g. 1985ca2d-61ef-49f1-bfce-6c39d8462914 ). Failure to follow this formatting will result in a reject. |
37 | OrderID | UUID | Y | The exchange order ID of the order to be canceled. |
41 | OrigClOrdID | UUID | Y | The client order ID of the order to be canceled. At least one of OrigClOrdID or OrderID must be specified. |
55 | Symbol | String | Y | Must match the message that the OrigClOrdID references. |
OrderCancelReject (35=9)
This message is sent by Coinbase Exchange back to clients to reflect that an order could not be canceled on the matching engine in the following situations:
- When an Order Cancel Request (35=F) is rejected (CxlRejResponseTo 434=1)
- When an Order Cancel/Replace Request (35=G) is rejected (CxlRejResponseTo 434=2)
- When an Order Cancel Batch (35=U4) is partially rejected (CxlRejResponseTo 434=1)
Tag | Name | Type | Required | Description |
---|---|---|---|---|
11 | ClOrdID | UUID | Y | Echoed back from the client request. |
37 | OrderID | UUID | C | Echoed back from the client request. |
41 | OrigClOrdID | UUID | Y | Echoed back from the client request. |
58 | Text | String | N | Description of why the order could not be canceled. |
39 | OrdStatus | Char | Y | Always:8 = Rejected |
102 | CxlRejReason | Int | N | Supported values:1 = Unknown Order2 = Broker |
434 | CxlRejResponseTo | Char | Y | Supported values:1 = Order Cancel Request2 = Order Cancel/Replace Request |
OrderCancelBatch (35=U4)
For order cancel batch requests, Coinbase recommends that you use the same FIX connection that was used to place the order.
Clients should use this message to cancel multiple orders on the Exchange matching engine at the same time. Currently, all the orders canceled in a batch must be for the same symbol.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
8014 | BatchID | UUID | Y | Client-supplied ID identifying the order cancel batch request. |
73 | NoOrders | Int | Y | Number of orders in the request. |
=>11 | ClOrdID | UUID | Y | Client-supplied ID identifying the order cancel request. |
=>37 | OrderID | UUID | Y | The exchange order ID of the order to be canceled. |
=>41 | OrigClOrdID | UUID | Y | The client order ID of the order to be canceled. At least one of OrigClOrdID or OrderID must be specified. |
=>55 | Symbol | String | Y | Must match the message that the OrigClOrdID references. |
OrderCancelBatchReject (35=U5)
This message is sent by Coinbase Exchange back to clients when all the orders in an Order Cancel Batch (35=U4) Request could not be canceled. When only some of the orders could not be canceled, Order Cancel Reject (35=9) messages are sent out for the orders individually.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
8014 | BatchID | UUID | Y | Client-supplied ID identifying the order cancel batch request. |
58 | Text | String | N | The reason the order cancel batch request was rejected. |
OrderCancelReplaceRequest (35=G)
You must send order cancel replace requests via the same FIX connection through which the original order was placed.
Clients should use this message to modify a single order on the Exchange matching engine (only order price and order size can be modified). If order quantity is increased or order price is modified, queue priority is lost. Queue priority is maintained when order quantity is decreased.
Modified orders share the same exchange OrderID
(37) as the parent order.
Orders are modified with "in-flight mitigation" - i.e. any partially filled quantity on the parent order is carried over to the child order and is reflected in the new order's remaining quantity LeavesQty
(151).
Tag | Name | Type | Required | Description |
---|---|---|---|---|
11 | ClOrdID | UUID | Y | The client order ID of the new order (that will replace an existing order). |
37 | OrderID | UUID | Y | An identifier matching the OrderID from the NewOrderSingle, NewOrderBatch, or OrderCancelReplaceRequest that this request applies to. |
41 | OrigClOrdID | String | Y | An identifier matching the ClOrdID from the NewOrderSingle, NewOrderBatch, or OrderCancelReplaceRequest that this request applies to. |
38 | OrderQty | Decimal | Y | The new amount of the base asset to be transacted. |
44 | Price | Decimal | Y | The new desired limit price of the order. |
55 | Symbol | String | Y | Must match the symbol on the message that the OrigClOrdID references. |
40 | OrdType | Char | Y | Must be:2 = Limit |
ExecutionReport (35=8)
This message is sent by Coinbase Exchange back to clients to reflect changes to an order's state (accepted, replaced, restated, partially filled, filled, expired, or canceled).
Tag | Name | Type | Required | Description |
---|---|---|---|---|
11 | ClOrdID | UUID | Y | The client order ID of the (new) order. |
37 | OrderID | UUID | Y | A unique identifier assigned by the exchange for the order. |
41 | OrigClOrdID | String | C | The client order ID of the parent order for Order Cancel/Replace Requests. |
6 | AvgPx | Decimal | C | The volume-weighted average price of all fills on the order. |
14 | CumQty | Decimal | C | The cumulative base quantity (e.g. in BTC) filled on the order. |
151 | LeavesQty | Decimal | C | The remaining base quantity (e.g. in BTC) on the order. Not sent for market orders that were sent using CashOrderQty . |
17 | ExecID | UUID | Y | ID identifying this execution report. |
39 | OrdStatus | Char | Y | Supported values:0 = New1 = Partially Filled2 = Filled4 = Canceled5 = Replaced8 = RejectedC = Expired (For IOC expirations) |
150 | ExecType | Char | Y | Supported values:0 = New4 = Canceled5 = Replaced8 = RejectedC = Expired (For IOC expirations)D = Restated (in cases where orders are partially canceled unsolicited due to self-trade prevention)F = TradeI = Order Status (in response to Order Status Requests) |
55 | Symbol | String | Y | The symbol of the order (e.g. BTC-USD). |
54 | Side | Char | C | Supported values:1 = Buy2 = Sell |
40 | OrdType | Char | C | Supported values:1 = Market2 = Limit4 = Stop Limit |
32 | LastQty | Char | C | The base quantity (e.g. in BTC) of the most recent fill on the order when ExecType is F (Trade). |
31 | LastPx | Decimal | C | The price of the most recent fill on the order when ExecType is F (Trade). |
44 | Price | Decimal | C | The limit price of the order. |
38 | OrderQty | Decimal | C | The base quantity (e.g. in BTC) of the order. |
1138 | DisplayQty | Decimal | C | Maximum size within an order to be displayed. Must be > 10% of OrderQty |
198 | SecondaryOrderID | String | C | Assigned by party that accepts the order. Can be used to provide the OrderID (37) used by an exchange or executing system. |
152 | CashOrderQty | Decimal | C | The quote quantity (e.g. in USD) of the order. For market orders that were submitted using CashOrderQty instead of OrderQty , this is the remaining quote quantity of the order. |
58 | Text | String | N | Description of why the order was rejected, canceled, or expired. |
60 | TransactTime | UTCTimestamp | Y | Matching engine timestamp. |
103 | OrdRejReason | Int | N | Supported values:0 = Broker1 = Unknown Symbol5 = Unknown Order |
378 | ExecRestatementReason | Int | N | Supported values:5 = Partial Decline of OrderQty (in cases where orders are partially canceled unsolicited due to self-trade prevention). |
1003 | TradeID | String | C | Trade ID for a given fill used for reporting. |
1057 | AggressorIndicator | Boolean | C | Supported values:Y = Taker (if aggressor or auction trade)N = Maker |
59 | TimeInForce | Char | C | Supported values:1 = GTC3 = IOC4 = FOK6 = GTD |
99 | StopPx | Decimal | C | For stop-limit orders, the stop price of the order. |
1109 | TriggerPriceDirection | Char | N | For stop-limit orders. Supported values: U = Trigger if market price goes UP to or through StopPx D = Trigger if market price goes DOWN to or through StopPx |
18 | ExecInst | Char | N | Supported values:A = Add Liquidity Only. |
7928 | SelfTradeType | Char | N | Supported values:D = Decrement and Cancel (default if not specified)O = Cancel Oldest (resting order)N = Cancel Newest (aggressing order)B = Cancel Both |
126 | ExpireTime | UTCTimestamp | C | Timestamp at which a GTD order would expire. |
136 | NoMiscFees | Int | C | Repeating group for fees charged. Always 1 on an order partial fill or fill. |
=>137 | MiscFeeAmt | Decimal | C | See MiscFeeBasis . |
=>138 | MiscFeeCurr | String | C | The currency that the fee is charged in. |
=>139 | MiscFeeType | String | C | Always:4 = Exchange Fees. |
=>891 | MiscFeeBasis | Int | C | Supported values:0 = Absolute (MiscFeeAmt is in MiscFeeCurr terms)2 = Percentage (MiscFeeAmt should be multiplied by the fill quantity in MiscFeeCurr terms to calculate the fee in MiscFeeCurr terms) |
BusinessMessageReject (35=j)
An application level reject message sent when the FIX session can't process a message.
Tag | Name | Type | Required | Description |
---|---|---|---|---|
45 | RefSeqNum | Int | N | The MsgSeqNum of the referenced message that was rejected. |
372 | RefMsgType | Int | Y | The message type that this reject message applies to. Supported values include: Admin Messages A = Logon0 = Heartbeat1 = TestRequest3 = Reject5 = LogoutApplication Messages D = NewOrderSingleF = OrderCancelRequestG = OrderCancelReplaceRequestH = OrderStatusRequestj = BusinessMessageReject8 = ExecutionReport9 = OrderCancelRejectU4 = OrderCancelBatchU5 = OrderCancelBatchRejectU6 = NewOrderBatchU7 = NewOrderBatchReject |
379 | BusinessRejectRefID | String | N | The ClOrdID , OrderID , BatchID , or other identifying ID on the failed request. |
380 | BusinessRejectReason | Int | N | A code to quickly identify common reasons for a reject. Supported values include: 1 = Other2 = Unsupported Message Type |
58 | Text | String | N | A message explaining why the message was rejected. |