In Spain, every citizen has a personal fiscal identification number (NIF), which is necessary for any tax declaration and communication with the tax authority.
In general, the fiscal identification number for Spanish citizens is their identity card number (DNI), and for foreigners, the NIF is the NIE-Number, Número de Identificación de Extranjeros.
The application for those numbers has to be made before the Main Police Direction.
However, any foreigner who wishes to carry out any transaction that requires fiscal openness has to apply for a fiscal number at the tax authority. This is applicable for the case that the NIE-Number is in process of application or when the citizens aren’t required to have a NIE-Number.
The application for the NIE-Number can be made personally or through a third party with the corresponding POA. The second option is very recommendable since the applicant avoids inconveniences and long waiting times that come with the complicated application process.