If you wish to buy a property in Italy you will need an Italian tax identification number, called codice fiscale.
If you live abroad
Non-resident individuals who need to obtain the tax identification number can apply for it to the Italian consular authorities in the Country of residence. The consular often will allow you to apply online and will send you the tax code at your home address.
If you are already here in Italy
You can apply in different places depending on your situation.
At the Questura or Sportelli Unici per l’immigrazione if you also need a VISA – at the Single desk for immigration “Sportelli Unici per l’immigrazione” or by any Police headquarters “Questure”. The Single desk for immigration issues the tax identification number to citizens who apply for entry into the Country either for employment purposes or for reunite with their family or foreign nationals who require either the issuance or the renewal of a residence permit (Visa).
At L’Agenzia delle Entrate office – Citizens of European Union may apply for the tax identification number to any office of the Italian Revenue Agency showing, along with the request for the assignment, a valid identification document (identity card or passport) by filling in the following form.