An ink cartridge is used mounted in a recording device with a hollow needle, a lever, a protruding wall, and an optical sensor. The lever and the optical sensor are located on either side of the hollow needle, but closer to the opening through which the ink cartridge is mounted. The ink cartridge is formed with two grooves open to the front and lower surfaces of the ink cartridge at positions that correspond to the protruding wall and the optical sensor. A light blocking member is disposed in the groove that corresponds to the optical sensor. When the ink cartridge is mounted into the recording device, one groove accommodates and is guided by the protruding wall. The other groove accommodates the sensor so that the light blocking member protrudes into the optical sensor. Also, the front surface of the ink cartridge abuts the lever, which uncovers the hollow needle so that ink supply hole in the front surface of the ink cartridge is inserted with the hollow needle.