Skip to main content

Exchange FIX Order Entry Messages 5.0

About this API:

Environment URLs
  • 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.

TagNameTypeRequiredDescription
8BeginStringStringYMust 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.)
9BodyLengthIntYMessage length in bytes up to the checksum field (tags after BodyLength (9) and before Checksum (10)). This must be the second field in message.
35MsgTypeStringYThe type of message proceeding the header, must be the third field in the message.

Supported values include:
Admin Messages
A = Logon
0 = Heartbeat
1 = TestRequest
3 = Reject
5 = Logout

Application Messages
D = NewOrderSingle
F = OrderCancelRequest
G = OrderCancelReplaceRequest
H = OrderStatusRequest
j = BusinessMessageReject
8 = ExecutionReport
9 = OrderCancelReject
U4 = OrderCancelBatch
U5 = OrderCancelBatchReject
U6 = NewOrderBatch
U7 = NewOrderBatchReject
49SenderCompIDStringYClient API key (on messages from the client).
56TargetCompIDStringYMust be Coinbase (on messages from client).
34MsgSeqNumIntYMonotonically increasing sequence number of the message.
97PossResendBooleanCIndicates 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
52SendingTimeUTCTimestampYUTC time that the order was sent down to millisecond resolution in the format YYYYMMDD-HH:MM:SS.sss
83RptSeqIntCThe 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.

TagNameTypeRequiredDescription
10CheckSumStringYThree 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 0s (if necessary) to meet the 3 byte requirement.

Administrative

Logon (35=A)

First message that is required immediately upon connection to authenticate the connection.

TagNameTypeRequiredDescription
98EncryptMethodIntNMust be 0 (None)
108HeartBtIntIntOMust 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.
141ResetSeqNumFlagBooleanYSequence numbers always get reset after a disconnect. Defaults to Y and a value of N will result in a Reject on the Login message.
553UsernameStringYAny string is accepted.
554PasswordStringYPassphrase for Client API key.
95RawDataLengthIntYNumber of bytes in RawData field.
96RawDataStringYClient message signature (see Signing a message)
1137DefaultApplVerIDStringYContains the version of the FIX protocol the exchange uses. Only FIX50SP2 is supported.

Supported values:
  • 9 (FIX50SP2)
8001DefaultSelfTradePreventionStrategyCharNThe 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 order
Q = Cancel both orders

Default if not specified is Cancel both orders (Q).
8013CancelOrdersOnDisconnectCharNS = Cancel all session orders on disconnect
Y = Cancel all profile orders on disconnect (recommended)
9406DropCopyFlagCharNN = Normal order-entry session
Y = 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).

TagNameTypeRequiredDescription
112TestReqIDStringCConditionally 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.

TagNameTypeRequiredDescription
112TestReqIDStringYA 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.

TagNameTypeRequiredDescription
45RefSeqNumIntYThe MsgSeqNum of the referenced message that was rejected.
371RefTagIDIntNThe tag number of the FIX field referenced in the reject.
372RegMsgTypeStringNThe MsgType of the FIX message referenced in the reject.
373SessionRejectReasonIntNA code to quickly identify common reasons for a reject.

Supported values:
0 = Invalid Tag Number
1 = Required Tag Missing
2 = Tag not defined for this message type
3 = Undefined tag
4 = Tag specified without a value
5 = Value is incorrect (out of range) for this tag
6 = Incorrect data format for value
8 = Signature problem
9 = CompID problem
10 = SendingTime Accuracy Problem
11 = Invalid MsgType
13 = Tag appears more than once
14 = Tag specified out of required order
15 = Repeating group fields out of order
16 = Incorrect NumInGroup count for repeating group
17 = Non "Data" value includes field delimiter (<SOH> character)
18 = Invalid/Unsupported Application Version
99 = Other
58TextStringNA 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.

TagNameTypeRequiredDescription
58TextStringNDescription of the disconnection reason.

Trading

NewOrderSingle (35=D)

Used to submit a new spot order to the Exchange matching engine.

TagNameTypeRequiredDescription
11ClOrdIDUUIDYAn 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.
18ExecInstCharNThe execution instruction flags for the order.

Supported values:
A = Add Liquidity Only (Post Only)
38OrderQtyDecimalCThe amount of the base asset to be transacted. Required except for market orders with CashOrderQty specified.
1138DisplayQtyDecimalCMaximum size within an order to be displayed. Must be > 10% of OrderQty
152CashOrderQtyDecimalCThe order size in quote units (e.g., USD) (Market order only).
40OrdTypeCharYThe type of order for the request which can be.

Supported values:
1 = Market
2 = Limit
4 = Stop Limit
44PriceDecimalCThe 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.
54SideCharYSide of the order.

Supported values:
1 = Buy
2 = Sell
55SymbolStringYSymbol of the instrument being traded (e.g. BTC-USDC)
59TimeInForceCharYSpecifies 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)
126ExpireTimeUTCTimestampCRequired 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.
99StopPxDecimalCSpecifies the quote price at which the order activates for Stop Limit order types (40=4)
1109TriggerPriceDirectionCharNSupported 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.
7928SelfTradeTypeCharNThe 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.

TagNameTypeRequiredDescription
8014BatchIDUUIDYAn 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.
73NoOrdersIntYNumber of orders in the request.
=>11ClOrdIDUUIDYAn 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.
=>18ExecInstCharNThe execution instruction flags for the order.

Supported values:
A = Add Liquidity Only (Post Only)
=>38OrderQtyDecimalCThe amount of the base asset to be transacted. Required except for market orders with CashOrderQty specified.
=>152CashOrderQtyDecimalCThe order size in quote units (e.g., USD) (Market order only).
=>40OrdTypeCharYThe type of order for the request which can be.

Supported values:
1 = Market
2 = Limit
4 = Stop Limit
=>44PriceDecimalCThe 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.
=>54SideCharYSide of the order.

Supported values:
1 = Buy
2 = Sell
=>55SymbolStringYSymbol of the instrument being traded (e.g. BTC-USDC)
=>59TimeInForceCharYSpecifies 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)
=>126ExpireTimeUTCTimestampCRequired 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.
=>99StopPxDecimalCSpecifies the quote price at which the order activates for Stop Limit order types (40=4).
=>7928SelfTradeTypeCharNRepresents 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.

TagNameTypeRequiredDescription
8014BatchIDUUIDYClient-supplied ID identifying the new order batch request.
58TextStringYThe reason the batch of orders was rejected.

OrderCancelRequest (35=F)

Coinbase Recommends

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.

TagNameTypeRequiredDescription
11ClOrdIDUUIDYAn 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.
37OrderIDUUIDYThe exchange order ID of the order to be canceled.
41OrigClOrdIDUUIDYThe client order ID of the order to be canceled.

At least one of OrigClOrdID or OrderID must be specified.
55SymbolStringYMust 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:

TagNameTypeRequiredDescription
11ClOrdIDUUIDYEchoed back from the client request.
37OrderIDUUIDCEchoed back from the client request.
41OrigClOrdIDUUIDYEchoed back from the client request.
58TextStringNDescription of why the order could not be canceled.
39OrdStatusCharYAlways:
8 = Rejected
102CxlRejReasonIntNSupported values:
1 = Unknown Order
2 = Broker
434CxlRejResponseToCharYSupported values:
1 = Order Cancel Request
2 = Order Cancel/Replace Request

OrderCancelBatch (35=U4)

Coinbase Recommends

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.

TagNameTypeRequiredDescription
8014BatchIDUUIDYClient-supplied ID identifying the order cancel batch request.
73NoOrdersIntYNumber of orders in the request.
=>11ClOrdIDUUIDYClient-supplied ID identifying the order cancel request.
=>37OrderIDUUIDYThe exchange order ID of the order to be canceled.
=>41OrigClOrdIDUUIDYThe client order ID of the order to be canceled.

At least one of OrigClOrdID or OrderID must be specified.
=>55SymbolStringYMust 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.

TagNameTypeRequiredDescription
8014BatchIDUUIDYClient-supplied ID identifying the order cancel batch request.
58TextStringNThe reason the order cancel batch request was rejected.

OrderCancelReplaceRequest (35=G)

Use Original FIX Connection

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).

TagNameTypeRequiredDescription
11ClOrdIDUUIDYThe client order ID of the new order (that will replace an existing order).
37OrderIDUUIDYAn identifier matching the OrderID from the NewOrderSingle, NewOrderBatch, or OrderCancelReplaceRequest that this request applies to.
41OrigClOrdIDStringYAn identifier matching the ClOrdID from the NewOrderSingle, NewOrderBatch, or OrderCancelReplaceRequest that this request applies to.
38OrderQtyDecimalYThe new amount of the base asset to be transacted.
44PriceDecimalYThe new desired limit price of the order.
55SymbolStringYMust match the symbol on the message that the OrigClOrdID references.
40OrdTypeCharYMust 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).

TagNameTypeRequiredDescription
11ClOrdIDUUIDYThe client order ID of the (new) order.
37OrderIDUUIDYA unique identifier assigned by the exchange for the order.
41OrigClOrdIDStringCThe client order ID of the parent order for Order Cancel/Replace Requests.
6AvgPxDecimalCThe volume-weighted average price of all fills on the order.
14CumQtyDecimalCThe cumulative base quantity (e.g. in BTC) filled on the order.
151LeavesQtyDecimalCThe remaining base quantity (e.g. in BTC) on the order.

Not sent for market orders that were sent using CashOrderQty.
17ExecIDUUIDYID identifying this execution report.
39OrdStatusCharYSupported values:
0 = New
1 = Partially Filled
2 = Filled
4 = Canceled
5 = Replaced
8 = Rejected
C = Expired (For IOC expirations)
150ExecTypeCharYSupported values:
0 = New
4 = Canceled
5 = Replaced
8 = Rejected
C = Expired (For IOC expirations)
D = Restated (in cases where orders are partially canceled unsolicited due to self-trade prevention)
F = Trade
I = Order Status (in response to Order Status Requests)
55SymbolStringYThe symbol of the order (e.g. BTC-USD).
54SideCharCSupported values:
1 = Buy
2 = Sell
40OrdTypeCharCSupported values:
1 = Market
2 = Limit
4 = Stop Limit
32LastQtyCharCThe base quantity (e.g. in BTC) of the most recent fill on the order when ExecType is F (Trade).
31LastPxDecimalCThe price of the most recent fill on the order when ExecType is F (Trade).
44PriceDecimalCThe limit price of the order.
38OrderQtyDecimalCThe base quantity (e.g. in BTC) of the order.
1138DisplayQtyDecimalCMaximum size within an order to be displayed. Must be > 10% of OrderQty
198SecondaryOrderIDStringCAssigned by party that accepts the order. Can be used to provide the OrderID (37) used by an exchange or executing system.
152CashOrderQtyDecimalCThe 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.
58TextStringNDescription of why the order was rejected, canceled, or expired.
60TransactTimeUTCTimestampYMatching engine timestamp.
103OrdRejReasonIntNSupported values:
0 = Broker
1 = Unknown Symbol
5 = Unknown Order
378ExecRestatementReasonIntNSupported values:
5 = Partial Decline of OrderQty (in cases where orders are partially canceled unsolicited due to self-trade prevention).
1003TradeIDStringCTrade ID for a given fill used for reporting.
1057AggressorIndicatorBooleanCSupported values:
Y = Taker (if aggressor or auction trade)
N = Maker
59TimeInForceCharCSupported values:
1 = GTC
3 = IOC
4 = FOK
6 = GTD
99StopPxDecimalCFor stop-limit orders, the stop price of the order.
1109TriggerPriceDirectionCharNFor 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
18ExecInstCharNSupported values:
A = Add Liquidity Only.
7928SelfTradeTypeCharNSupported values:
D = Decrement and Cancel (default if not specified)
O = Cancel Oldest (resting order)
N = Cancel Newest (aggressing order)
B = Cancel Both
126ExpireTimeUTCTimestampCTimestamp at which a GTD order would expire.
136NoMiscFeesIntCRepeating group for fees charged.

Always 1 on an order partial fill or fill.
=>137MiscFeeAmtDecimalCSee MiscFeeBasis.
=>138MiscFeeCurrStringCThe currency that the fee is charged in.
=>139MiscFeeTypeStringCAlways:
4 = Exchange Fees.
=>891MiscFeeBasisIntCSupported 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.

TagNameTypeRequiredDescription
45RefSeqNumIntNThe MsgSeqNum of the referenced message that was rejected.
372RefMsgTypeIntYThe message type that this reject message applies to.

Supported values include:
Admin Messages
A = Logon
0 = Heartbeat
1 = TestRequest
3 = Reject
5 = Logout

Application Messages
D = NewOrderSingle
F = OrderCancelRequest
G = OrderCancelReplaceRequest
H = OrderStatusRequest
j = BusinessMessageReject
8 = ExecutionReport
9 = OrderCancelReject
U4 = OrderCancelBatch
U5 = OrderCancelBatchReject
U6 = NewOrderBatch
U7 = NewOrderBatchReject
379BusinessRejectRefIDStringNThe ClOrdID, OrderID, BatchID, or other identifying ID on the failed request.
380BusinessRejectReasonIntNA code to quickly identify common reasons for a reject.

Supported values include:
1 = Other
2 = Unsupported Message Type
58TextStringNA message explaining why the message was rejected.

Was this helpful?