If you're self-employed or run a company in Spain and start invoicing clients in other EU countries, you'll run into intra-EU VAT. The basic rule differs from invoicing within Spain, and getting it wrong can cause problems with the tax authorities.
The prerequisite: registering for the ROI
Before issuing your first invoice to an EU client, you must register with the Register of Intra-Community Operators (ROI), by filing form 036 with the Spanish Tax Agency. Once registered, you're assigned an EU VAT number (your NIF with the "ES" prefix) and appear in VIES (VAT Information Exchange System), the EU database used to verify that an operator is registered for intra-community transactions.
How to invoice: the reverse charge mechanism
For B2B transactions (between businesses or freelancers) within the EU, the reverse charge rule applies: you issue the invoice without VAT, and the client self-assesses the VAT due in their own country, at the rate that applies there. The invoice must state that the transaction is VAT-exempt under the relevant VAT law article (intra-community transaction), and show both parties' EU VAT numbers.
For this to be valid, the client must also be registered in VIES in their own country — worth checking before invoicing without VAT, because if the client isn't properly registered, the tax authorities can demand the VAT you didn't charge.
What if the client is a private individual (B2C)?
If you sell to a private individual in another EU country (not a business), the rule changes: generally you must apply Spanish VAT (or the buyer's country VAT, depending on sales volume and the type of good or service, with specific rules for digital services and distance sales of goods). It's a more complex regime, and above certain turnover thresholds you may need to register for the One-Stop Shop (OSS) to declare VAT for several countries through a single return.
Returns you'll need to file
Besides your regular VAT return (Modelo 303), once you deal with intra-community clients you'll need to file Modelo 349, a summary return listing all intra-community transactions, filed monthly, quarterly or annually depending on your volume.
A practical summary
Before your first sale to an EU client: register for the ROI (Modelo 036), check that your client is in VIES, invoice without VAT stating the reverse charge exemption, and don't forget Modelo 349. If you're unsure about your specific case, an accountant can confirm the details — the rules vary depending on whether you sell goods or services, and on your business volume.