An electronic capsule (100) is provided. The capsule (100) has a discrete drive element (300) comprising: a housing (109), electronics for making the electronic capsule (100) operable, a pumping mechanism (115) for dosing and displacing a substance, a power source (105) for powering the electronic capsule (100) and enabling the electronics and the pumping mechanism (115) to operate, and a locking mechanism (130) and a discrete payload element (200) comprising: a housing (109), a reservoir (210) for storing the substance, one or more openings (250) in the housing (109) for releasing the substance from the reservoir (210) and a locking mechanism (230) for engaging the drive element locking mechanism (130). Engagement of the drive element locking mechanism (130) with the payload element locking mechanism (230) secures the drive element (300) to the payload element (200), thereby making the electronic capsule (100) operable and specific.