If you will be traveling across multiple EU countries, you must collect all tickets and tax-exempt forms for the items and show them at the last airport before leaving the EU.
If a “tax refund” will be requested in Madrid in addition to carrying out the procedure at the billing visa offices of the Civil Guard, bills can be stamped through an electronic system. With this method, the traveler has to order the DIVA form in stores, which can be validated electronically at the stamp points provided at Madrid Barajas Airport. You can then claim a refund at the store where the purchases were made, or at the tax-exempt management entities located in the boarding areas, and pay the corresponding commission. Tax exemption process in Barcelona It is similar to Madrid Airport.
Source: penmediainc.com