# Enforcing order of FIX tags

**URL:** <https://forum.fixtrading.org/t/enforcing-order-of-fix-tags/4628>\
**Category:** General Q&A\
**Tags:** general-qa, xid\_167703, imported\
**Created:** [August 29, 2008, 6:36pm UTC](https://forum.fixtrading.org/t/enforcing-order-of-fix-tags/4628 "2008-08-29T18:36:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![alimorton\_x](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@alimorton\_x](https://forum.fixtrading.org/u/alimorton_x)\
**Post date:** [August 29, 2008, 6:36pm UTC](https://forum.fixtrading.org/t/enforcing-order-of-fix-tags/4628/1 "2008-08-29T18:36:21Z")

</div>

Imported from previous forum

---

<div class="post-metadata">

**Author:** ![alimorton\_x](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@alimorton\_x](https://forum.fixtrading.org/u/alimorton_x)\
**Post date:** [August 29, 2008, 6:36pm UTC](https://forum.fixtrading.org/t/enforcing-order-of-fix-tags/4628/2 "2008-08-29T18:36:21Z")

</div>

We are sending FIX messages to another company who has very strict FIX parsing for the order of the fields.

For example, in TradeCaptureReport message, we are sending a stipulation block.

NoSides(552)=1|Side(54)=1|NoStipulations(232)=1|StipulationType(233)=TEST|StipulationValue(234)=N

The other side is rejecting our message, and is saying stipulations “need to be sent later in the message - after the account (tag 1)”.

In addition, they also complain that we send OrderID tag out of place. They claim we need to send tag NoSides(552), then Side(54), then 37 (OrderID). We are sending tag 37 after PartyRole(452).

Unfortunately we don’t have control over this. We are using TransactTools which orders these automatically. We have tried contacting their support and they say order does not matter in FIX except for in repeating groups and there is nothing we can do.

So what is the official word on ordering here?

---

<div class="post-metadata">

**Author:** ![fplpo\_x](https://avatars.discourse-cdn.com/v4/letter/f/7ab992/32.png) [@fplpo\_x](https://forum.fixtrading.org/u/fplpo_x)\
**Post date:** [August 29, 2008, 6:49pm UTC](https://forum.fixtrading.org/t/enforcing-order-of-fix-tags/4628/3 "2008-08-29T18:49:05Z")

</div>

[original email was from Dean Kauffman - [dean.kauffman@tradeweb.com](mailto:dean.kauffman@tradeweb.com) ]  
Ali,

Your response TransactTools is correct. Send this (from vol 1 of the FIX 4.4 spec) to your counterparty:

vvvvv  
Except where noted, fields within a message can be defined in any sequence (Relative position of a field within a message is inconsequential.) The exceptions to this rule are:  
. . .  
4. Fields within repeating data groups must be specified in the order that the fields are specified in the message definition within the FIX specification document. The NoXXX field where XXX is the field being counted specifies the number of repeating group instances that must immediately precede the repeating group contents.  
. . .  
^^^^^

> We are sending FIX messages to another company who has very strict FIX  
> parsing for the order of the fields.
> 
> For example, in TradeCaptureReport message, we are sending a  
> stipulation block.
> 
> NoSides(552)=1|Side(54)=1|NoStipulations(232)=1|StipulationType(233)=TE-  
> ST|StipulationValue(234)=N
> 
> The other side is rejecting our message, and is saying stipulations  
> “need to be sent later in the message - after the account (tag 1)”.
> 
> In addition, they also complain that we send OrderID tag out of place.  
> They claim we need to send tag NoSides(552), then Side(54), then 37  
> (OrderID). We are sending tag 37 after PartyRole(452).
> 
> Unfortunately we don’t have control over this. We are using  
> TransactTools which orders these automatically. We have tried contacting  
> their support and they say order does not matter in FIX except for in  
> repeating groups and there is nothing we can do.
> 
> So what is the official word on ordering here?

---

<div class="post-metadata">

**Author:** ![jaydeyoung\_x](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jaydeyoung\_x](https://forum.fixtrading.org/u/jaydeyoung_x)\
**Post date:** [August 29, 2008, 7:01pm UTC](https://forum.fixtrading.org/t/enforcing-order-of-fix-tags/4628/4 "2008-08-29T19:01:16Z")

</div>

I thought there was also wording (but I don’t recall where specifically) that tags defined as part of the header should come before any body tags. There is no ordering requirement within header or body tags except as it relates to specific repeating groups as already mentioned.  
I know this behavior is part of the way QuickFIX expects to parse messages.

> Ali,
> 
> Your response TransactTools is correct. Send this (from vol 1 of the FIX  
> 4.4 spec) to your counterparty:
> 
> vvvvv Except where noted, fields within a message can be defined in any  
> sequence (Relative position of a field within a message is  
> inconsequential.) The exceptions to this rule are:  
> . . .  
> 4. Fields within repeating data groups must be specified in the order  
> that the fields are specified in the message definition within the  
> FIX specification document. The NoXXX field where XXX is the field  
> being counted specifies the number of repeating group instances that  
> must immediately precede the repeating group contents.  
> . . . ^^^^^
> 
> > We are sending FIX messages to another company who has very strict FIX  
> > parsing for the order of the fields.
> > 
> > For example, in TradeCaptureReport message, we are sending a  
> > stipulation block.
> > 
> > Sides(552)=1|Side(54)=1|NoStipulations(232)=1|StipulationType(233)=TE-  
> > ST|StipulationValue(234)=N
> > 
> > The other side is rejecting our message, and is saying stipulations  
> > “need to be sent later in the message - after the account (tag 1)”.
> > 
> > In addition, they also complain that we send OrderID tag out of place.  
> > They claim we need to send tag NoSides(552), then Side(54), then 37  
> > (OrderID). We are sending tag 37 after PartyRole(452).
> > 
> > Unfortunately we don’t have control over this. We are using  
> > TransactTools which orders these automatically. We have tried  
> > contacting their support and they say order does not matter in FIX  
> > except for in repeating groups and there is nothing we can do.
> > 
> > So what is the official word on ordering here?

---

<div class="post-metadata">

**Author:** ![fplpo\_x](https://avatars.discourse-cdn.com/v4/letter/f/7ab992/32.png) [@fplpo\_x](https://forum.fixtrading.org/u/fplpo_x)\
**Post date:** [August 29, 2008, 6:51pm UTC](https://forum.fixtrading.org/t/enforcing-order-of-fix-tags/4628/5 "2008-08-29T18:51:38Z")

</div>

[original email was from John Prewett - [jprewett@lavatrading.com](mailto:jprewett@lavatrading.com) ]  
TransactTools support is correct (although field order is also important for BeginString, MsgLength, MsgType & CheckSum too).  
The other company isn’t obeying FIX protocol standards that basically permits fields to occur in any order.

JohnP

> We are sending FIX messages to another company who has very strict FIX  
> parsing for the order of the fields.
> 
> For example, in TradeCaptureReport message, we are sending a  
> stipulation block.
> 
> NoSides(552)=1|Side(54)=1|NoStipulations(232)=1|StipulationType(233)=TE-  
> ST|StipulationValue(234)=N
> 
> The other side is rejecting our message, and is saying stipulations  
> “need to be sent later in the message - after the account (tag 1)”.
> 
> In addition, they also complain that we send OrderID tag out of place.  
> They claim we need to send tag NoSides(552), then Side(54), then 37  
> (OrderID). We are sending tag 37 after PartyRole(452).
> 
> Unfortunately we don’t have control over this. We are using  
> TransactTools which orders these automatically. We have tried contacting  
> their support and they say order does not matter in FIX except for in  
> repeating groups and there is nothing we can do.
> 
> So what is the official word on ordering here?

---

<div class="post-metadata">

**Author:** ![fplpo\_x](https://avatars.discourse-cdn.com/v4/letter/f/7ab992/32.png) [@fplpo\_x](https://forum.fixtrading.org/u/fplpo_x)\
**Post date:** [August 29, 2008, 8:15pm UTC](https://forum.fixtrading.org/t/enforcing-order-of-fix-tags/4628/6 "2008-08-29T20:15:03Z")

</div>

[original email was from Greg Orsini - [greg.orsini@orcsoftware.com](mailto:greg.orsini@orcsoftware.com) ]  
I agree with the counter-party - order is enforced in this case.

The question relates to repeating groups. Note the fields in question:

> > NoSides(552)=1|Side(54)=1|NoStipulations(232)=1|StipulationType(233)=TE-  
> > ST|StipulationValue(234)=N

NoSides(552) is a NumInGroup type that defines the number of ‘TrdCapRptSideGrp’ elements to follow. The order of the tags in this element is fixed and must follow the order in the specification.

Greg.

> TransactTools support is correct (although field order is also important  
> for BeginString, MsgLength, MsgType & CheckSum too). The other company  
> isn’t obeying FIX protocol standards that basically permits fields to  
> occur in any order.
> 
> JohnP
> 
> > We are sending FIX messages to another company who has very strict FIX  
> > parsing for the order of the fields.
> > 
> > For example, in TradeCaptureReport message, we are sending a  
> > stipulation block.
> > 
> > Sides(552)=1|Side(54)=1|NoStipulations(232)=1|StipulationType(233)=TE-  
> > ST|StipulationValue(234)=N
> > 
> > The other side is rejecting our message, and is saying stipulations  
> > “need to be sent later in the message - after the account (tag 1)”.
> > 
> > In addition, they also complain that we send OrderID tag out of place.  
> > They claim we need to send tag NoSides(552), then Side(54), then 37  
> > (OrderID). We are sending tag 37 after PartyRole(452).
> > 
> > Unfortunately we don’t have control over this. We are using  
> > TransactTools which orders these automatically. We have tried  
> > contacting their support and they say order does not matter in FIX  
> > except for in repeating groups and there is nothing we can do.
> > 
> > So what is the official word on ordering here?

---

<div class="post-metadata">

**Author:** ![fplpo\_x](https://avatars.discourse-cdn.com/v4/letter/f/7ab992/32.png) [@fplpo\_x](https://forum.fixtrading.org/u/fplpo_x)\
**Post date:** [August 29, 2008, 8:54pm UTC](https://forum.fixtrading.org/t/enforcing-order-of-fix-tags/4628/7 "2008-08-29T20:54:54Z")

</div>

[original email was from John Prewett - [jprewett@lavatrading.com](mailto:jprewett@lavatrading.com) ]  
Greg, I respectfully suggest that you may have misread the original question.

The original posting indicates that the receiver is obligating that the Stipulations repeating group (in its entirety) must appear in the message after the Account tag. I still believe this doesn’t match with standard FIX protocol.

The original posting has nothing to do with the order of fields within a repeating group or the repeat count that must occur prior to the repeating group. Incidentally, the sender does indeed correctly honor the repeat count field followed by the repeating block fields in the correct order according to his original posting.

JohnP

> I agree with the counter-party - order is enforced in this case.
> 
> The question relates to repeating groups. Note the fields in question:
> 
> > > des(552)=1|Side(54)=1|NoStipulations(232)=1|StipulationType(233)=TE-  
> > > ST|StipulationValue(234)=N
> 
> NoSides(552) is a NumInGroup type that defines the number of  
> ‘TrdCapRptSideGrp’ elements to follow. The order of the tags in this  
> element is fixed and must follow the order in the specification.
> 
> Greg.
> 
> > TransactTools support is correct (although field order is also  
> > important for BeginString, MsgLength, MsgType & CheckSum too). The  
> > other company isn’t obeying FIX protocol standards that basically  
> > permits fields to occur in any order.
> > 
> > JohnP
> > 
> > > We are sending FIX messages to another company who has very strict  
> > > FIX parsing for the order of the fields.
> > > 
> > > For example, in TradeCaptureReport message, we are sending a  
> > > stipulation block.
> > > 
> > > des(552)=1|Side(54)=1|NoStipulations(232)=1|StipulationType(233)=TE-  
> > > ST|StipulationValue(234)=N
> > > 
> > > The other side is rejecting our message, and is saying stipulations  
> > > “need to be sent later in the message - after the account (tag 1)”.
> > > 
> > > In addition, they also complain that we send OrderID tag out of  
> > > place. They claim we need to send tag NoSides(552), then Side(54),  
> > > then 37 (OrderID). We are sending tag 37 after PartyRole(452).
> > > 
> > > Unfortunately we don’t have control over this. We are using  
> > > TransactTools which orders these automatically. We have tried  
> > > contacting their support and they say order does not matter in FIX  
> > > except for in repeating groups and there is nothing we can do.
> > > 
> > > So what is the official word on ordering here?

---

<div class="post-metadata">

**Author:** ![fplpo\_x](https://avatars.discourse-cdn.com/v4/letter/f/7ab992/32.png) [@fplpo\_x](https://forum.fixtrading.org/u/fplpo_x)\
**Post date:** [August 29, 2008, 9:19pm UTC](https://forum.fixtrading.org/t/enforcing-order-of-fix-tags/4628/8 "2008-08-29T21:19:59Z")

</div>

[original email was from Greg Orsini - [greg.orsini@orcsoftware.com](mailto:greg.orsini@orcsoftware.com) ]  
\> Greg, I respectfully suggest that you may have misread the

> original question.

John,

Okay, I may be missing the boat here, but the original question says:

> For example, in TradeCaptureReport message, we are sending a stipulation block.  
> NoSides(552)=1|Side(54)=1|NoStipulations(232)=1|StipulationType(233)=TEST|StipulationValue(234)=N
> 
> The other side is rejecting our message, and is saying stipulations “need to be sent later in the message - after the account (tag 1)”.
> 
> In addition, they also complain that we send OrderID tag out of place. They claim we need to send tag NoSides(552), then Side(54), then 37 (OrderID). We are sending tag 37 after PartyRole(452).

In a TradeCaptureReport, the sequence of tags would need to be 552, 54, 37, … 1, …, then 232…

Stipulations needs to follow Account since it is part of the TrdCapRptSideGrp and that is the order defined in the spec.

Kind regards, Greg.

---

<div class="post-metadata">

**Author:** ![fplpo\_x](https://avatars.discourse-cdn.com/v4/letter/f/7ab992/32.png) [@fplpo\_x](https://forum.fixtrading.org/u/fplpo_x)\
**Post date:** [August 29, 2008, 9:53pm UTC](https://forum.fixtrading.org/t/enforcing-order-of-fix-tags/4628/9 "2008-08-29T21:53:49Z")

</div>

[original email was from John Prewett - [jprewett@lavatrading.com](mailto:jprewett@lavatrading.com) ]  
OK, I’m humble enough to eat some pie here.

I didn’t notice that the Stipulations themselves were a member the repeating group TrdCapRptSideGrp and thus the order of fields becomes significant.

You are absolutely correct.  
I thought it strange that you were making a mistake in the first place.  
I should have known better.

JohnP

> > Greg, I respectfully suggest that you may have misread the original  
> > question.
> 
> John,
> 
> Okay, I may be missing the boat here, but the original question says:
> 
> > For example, in TradeCaptureReport message, we are sending a  
> > stipulation block. NoSides(552)=1|Side(54)=1|NoStipulations(232)=1|Sti-  
> > pulationType(233)=TEST|StipulationValue(234)=N
> > 
> > The other side is rejecting our message, and is saying stipulations  
> > “need to be sent later in the message - after the account (tag 1)”.
> > 
> > In addition, they also complain that we send OrderID tag out of place.  
> > They claim we need to send tag NoSides(552), then Side(54), then 37  
> > (OrderID). We are sending tag 37 after PartyRole(452).
> 
> In a TradeCaptureReport, the sequence of tags would need to be 552, 54,  
> 37, … 1, …, then 232…
> 
> Stipulations needs to follow Account since it is part of the  
> TrdCapRptSideGrp and that is the order defined in the spec.
> 
> Kind regards, Greg.

---

<div class="post-metadata">

**Author:** ![srithayaparan\_x](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@srithayaparan\_x](https://forum.fixtrading.org/u/srithayaparan_x)\
**Post date:** [September 2, 2008, 5:43am UTC](https://forum.fixtrading.org/t/enforcing-order-of-fix-tags/4628/10 "2008-09-02T05:43:55Z")

</div>

Hi everyone,

I just thought to share my views with regard to repeating groups as my perception varies slightly from whats being discussed here.

As far as I understand, if a “No” field has a greater than 0 value, generally the first field in the repeating group referred to, by the is a required field. This is because, it is the delimiter between individual sub-messages.

But, within a repeating sub message, you can have non-required fields in-between which gives the user the flexibility to _not_ send such tags always.

My stance is, you can have repeating group fields skipped (and technically even out of order) so long as the first field in the repeating group is always stamped first and is made required.

> > > For example, in TradeCaptureReport message, we are sending a  
> > > stipulation block. NoSides(552)=1|Side(54)=1|NoStipulations(232)=1|Sti-  
> > > pulationType(233)=TEST|StipulationValue(234)=N

With reference to the 4.4 spec, Order ID is a required field of the side block. Hence, it has to be there. But then again I assume, its a custom spec for which you are connecting, where Order ID is made non-required in the side block. If thats the case, the side block looks fine, because you have the first field “Side” stamped properly.

As for the stipulation sub-sub block, only the first field “StipulationType” is required. This also looks fine since you again have the first field stamped properly.

I would emphasize, that a FIX sub-message parser should not deviate much from the main body parser except for the enforcing of the first field, thats to make it the delimiter rather than introducing an additional repeating group delimiter character.

Please provide feedback on your views.

Thanks!

Regards,  
Thaya.

> OK, I’m humble enough to eat some pie here.
> 
> I didn’t notice that the Stipulations themselves were a member the  
> repeating group TrdCapRptSideGrp and thus the order of fields becomes  
> significant.
> 
> You are absolutely correct. I thought it strange that you were making a  
> mistake in the first place. I should have known better.
> 
> JohnP
> 
> > > Greg, I respectfully suggest that you may have misread the original  
> > > question.
> > 
> > John,
> > 
> > Okay, I may be missing the boat here, but the original question says:
> > 
> > > For example, in TradeCaptureReport message, we are sending a  
> > > stipulation block. NoSides(552)=1|Side(54)=1|NoStipulations(232)=1|Sti-  
> > > pulationType(233)=TEST|StipulationValue(234)=N
> > > 
> > > The other side is rejecting our message, and is saying stipulations  
> > > “need to be sent later in the message - after the account (tag 1)”.
> > > 
> > > In addition, they also complain that we send OrderID tag out of  
> > > place. They claim we need to send tag NoSides(552), then Side(54),  
> > > then 37 (OrderID). We are sending tag 37 after PartyRole(452).
> > 
> > In a TradeCaptureReport, the sequence of tags would need to be 552,  
> > 54, 37, … 1, …, then 232…
> > 
> > Stipulations needs to follow Account since it is part of the  
> > TrdCapRptSideGrp and that is the order defined in the spec.
> > 
> > Kind regards, Greg.
