There is a way of checking that your VAT number is valid before entering it into Shopify, and this can tell you if there is an issue with the number you are providing. If you head to this website, you can choose Spain from the member state drop-down before then entering in your number into the appropriate field. You can then hit "Verify" to see if there is any issue with the number.
If the ID number shows as invalid, then you will need to contact your local tax authority to get this issue resolved. You may also receive a message that states "No, invalid VAT number for cross-border transactions in the EU", which means that the number cannot be inputted into Shopify as we do require cross border VAT IDs to be used.
If you receive no errors and the ID shows as valid, then the number should be accepted by our system. Please ensure that you are manually entering in the number correctly with no spaces at the front or end of the ID, and that your store's address is set to the same country as the first two letters of your VAT ID.
Please let me know how you get on and I will be happy to continue helping if you're still having an issue.
Victor | Social Care @ Shopify - Was my reply helpful? Click Like to let me know! - Was your question answered? Mark it as an Accepted Solution - To learn more visit the Shopify Help Center or the Shopify Blog