It is rare, but it may have happened to everyone at some time: is it normal to be asked for your ID when paying with a card in an establishment? It is not usual, but it can happen and there is no surprise. From the Bank of Spain they have published a post on their Banking Client portal to resolve the doubts of citizens in this regard.
From the Bank of Spain they warn that there are no laws that establish that this is mandatory, although it depends more “on the decision of each commercial establishment”. The most obvious reason: to avoid fraud and that users can buy with a card that is not theirs. It is a practice, they say, inherited from a time when credit and debit cards did not have the current security measures.
It's an 'extra security measure'
Currently, credit cards have a chip and pin as a security measure, in addition to 'contactless' technology, which makes payment by card, in general, a secure transaction. However, there are establishments that continue to ask for the DNI as an 'extra' security measure, to verify the identity of who is buying.
From the Bank of Spain they recommend that, although it is not generally necessary, if they ask us for the DNI when paying with a card, we accept it, since it is a simple security measure. If you cannot or do not want to deliver your DNI, it also works for the same purpose to deliver your passport or driving license.
The banking institution also invites you to request a copy of the transaction, as well as review the amount entered into the dataphone, each time you pay by card.