This was the one I bought for my M54 engine although it was a £100 cheaper in August 2019.
https://www.ebay.co.uk/itm/153004754976
If you've the later 6 cylinder engine (N52?) you'll need the one with the flanges that link to the down pipes that are 90 degrees out from each other.
There are various threads discussing these exhausts on this excellent forum like the following link. The flange issue is shown in the photos halfway down the first page. Pages 8, 9 and 10 cover my experience, which except for the delayed delivery were all good.
https://z4-forum.com/forum/viewtopic.php?f=2&t=109995&p=1590254&hilit=Ebay+exhaust#p1590254.
Be prepared for the bolts from down pipes to exhaust to be completely corroded and a right pain to remove. I recommend an angle grinder, a selection of cobolt drill bits, some oil to use on those drill bits and a fair bit of patience. Very satisfying when you get them out though.
Sorry for the multiple edits, not enough sleep off night shifts!