GDPR:

44: Performance of Contract

Processing should be lawful where it is necessary in the context of a contract or the intention to enter into a contract.