Hello and welcome, klandes :)
Been searching high and lo but I can't seem to find a direct link to where you can register for a VAT ID (impuesto sobre el valor añadido) in Spain. Although I did read that VAT ID registration cannot be done voluntarily, rather your income/business need to be assessed prior to applying for VAT.
You might find these helpful -
Link hidden: Login to view
Link hidden: Login to view
Please feel free to contact us should you need any further assistance. Cheers!