A cartridge assembly for use with a drug delivery device is specified. The cartridge assembly comprises a cartridge (120, 200, 400, 600, 700, 800, 900)with a retention cap (210, 410, 610, 710, 810, 910)and a cartridge holder (104, 300, 500, 650, 750, 850, 950). According to one aspect,the cartridge (120, 200, 400, 600, 700, 800, 900) and the cartridge holder (104, 300, 500, 650, 750, 850, 950) may be configured to be fixed to each other in a predetermined position According to another aspect, the retention cap (210, 410, 610, 710, 810, 910) comprises at least one coding feature (214, 414, 612, 712, 912) configured to affix said cartridge (120, 200, 400, 600,700, 800, 900) to said cartridge holder (104, 300, 500, 650, 750, 850, 950) in the predetermined position by the mating of said coding feature (214, 414, 612, 712, 912) with a corresponding coding feature (310, 512, 660, 670, 762, 960) on the cartridge holder (104, 300, 500, 650, 750, 850, 950).