Skip to main content
The FIX API uses FIX 4.2 over TCP/IP. Each FIX message contains a standard header, a message body, and a standard trailer. Fields use the tag=value<SOH> format, where <SOH> is ASCII 0x01.

Standard header

TagNameReqTypeDescription
8BeginStringYStringFIX version. Use FIX.4.2. This field must be the first field in the message.
9BodyLengthYLengthMessage body length in bytes, calculated from the field after BodyLength (9) through the delimiter before CheckSum (10).
34MsgSeqNumYSeqNumSequence number for the current message direction.
35MsgTypeYStringFIX message type.
43PossDupFlagNBooleanSet to Y when resending a message that may duplicate a previous transmission.
49SenderCompIDYStringSender identifier assigned for the FIX session.
52SendingTimeYUTCTimestampTime when the message is sent.
56TargetCompIDYStringTarget identifier assigned for the FIX session.
122OrigSendingTimeNUTCTimestampOriginal send time for a resent message. Required when PossDupFlag (43)=Y.

Standard trailer

TagNameReqTypeDescription
10CheckSumYStringThree-digit modulo 256 checksum for the message. This field must be the final field.

Sequence numbers

Each side maintains its own outbound sequence number. MsgSeqNum (34) starts at 1 for a reset session and increments by 1 for every session and application message sent in that direction. If a sequence gap is detected, the receiving side requests retransmission with ResendRequest (35=2). If a sequence number is lower than expected and is not a permitted duplicate, the service rejects the session state and requires a corrected logon.

Logon and reconnect behavior

ScenarioClient behaviorService behavior
First logon for the trading daySend Logon (35=A) with MsgSeqNum (34)=1.Accepts the session when credentials, identifiers, and sequence state are valid.
Normal relogonSend ResetSeqNumFlag (141)=N and MsgSeqNum (34) equal to the last client-sent sequence plus 1.Accepts the logon when the sequence matches.
Client sequence is higher than expectedSend the current client sequence.Accepts the logon, then sends ResendRequest (35=2) for the missing range.
Client sequence is lower than expectedRelogon with the expected value returned in Logout (35=5) text.Sends Logout (35=5) with text in the form MsgSeqNum too low, expecting X but received Y.
Service sequence is higher than client expectedSend ResendRequest (35=2) for the missing service messages.Resends the requested application messages or sends gap fills for non-resendable messages.

Heartbeat rules

RuleRequirement
Heartbeat intervalHeartBtInt (108) must be greater than 15 seconds and less than 100 seconds. The recommended value is 30 seconds.
Idle connection checkIf no application message is received within the heartbeat interval, send TestRequest (35=1).
Test responseThe peer must respond with Heartbeat (35=0) containing the received TestReqID (112) when applicable.
Disconnect thresholdIf no message is received for two heartbeat intervals, close the TCP connection.

Resend and gap fill

CaseRequired behavior
Service requests client messagesThe service sends ResendRequest (35=2) with BeginSeqNo (7) equal to the expected sequence and EndSeqNo (16)=0 when requesting all messages from that point onward.
Client requests service messagesThe client sends ResendRequest (35=2) with BeginSeqNo (7) equal to the expected sequence and EndSeqNo (16) equal to the last missing sequence, or 0 for all messages from that point onward.
Resent application messageSet PossDupFlag (43)=Y and include OrigSendingTime (122). Preserve the original application payload.
One non-resendable messageSend SequenceReset (35=4) with MsgSeqNum (34)=x, NewSeqNo (36)=x+1, and GapFillFlag (123)=Y.
Non-resendable rangeSend SequenceReset (35=4) with MsgSeqNum (34)=x, NewSeqNo (36)=y+1, and GapFillFlag (123)=Y for range x through y.

Endpoint failover

Primary and secondary endpoints do not share FIX session state. Use the secondary endpoint only when the primary endpoint cannot be reconnected after 30 seconds and the switch is authorized for the session.
SwitchSequence behaviorOrder behavior
Reconnect to primary endpointSend ResetSeqNumFlag (141)=N and continue with the next expected sequence number.Existing orders continue on the same route.
Switch to secondary endpointSend ResetSeqNumFlag (141)=Y and MsgSeqNum (34)=1.Orders routed before the switch are not automatically cancelled and do not update through the secondary session. Confirm or cancel active orders before switching when operationally required.

Logout

To close a FIX session, the initiating side sends Logout (35=5). The receiving side replies with Logout (35=5), then the TCP connection closes.