The personal identification number NIE ("Número de Identificación de Extranjero") is an important requirement for VAT registration in Spain. It is assigned to foreigners who wish to engage in business in Spain.
The NIE has to be applied for – in person – at a Spanish embassy or a Spanish consulate. Your registration can't commence without the NIE!
Useful information on applying for the NIE can be found via the following link, for example: http://www.exteriores.gob.es/Consulados/HAMBURGO/de/InfoAus/Paginas/NIE.aspx. Besides other documents, "Application form (EX-15)" plays a key role here.