You need a photocard.
Some machines will ask you to input your photocard number as part of the buying process, others will leave a space for you to write it on yourself in ink. The machine warns you that your ticket is not valid without the photocard number on it, in ink.