The condictio indebiti is an action in civil (Roman) law whereby a plaintiff may recover what he has paid the defendant by mistake; such mistaken payment is known as solutio indebiti. This action does not lie
if the sum was due ex aequitate, or by a natural obligation; if he who made the payment knew that nothing was due, for qui consulto dat quod non debet, praesumitur donare (who gives purposely what he does not owe, is presumed to make a gift).
The action is extant in civil (Roman) or hybrid law regimes, e.g. Norway, South Africa and Scotland .
See also
Condictio causa data causa non secuta
§ 812 I 1 1. Alt BGB (German Civil Code)
Further reading
Outlines of Roman Law By Thomas Whitcombe Greene
Roman-Frisian law of the 17th and 18th century By J. H. A. Lokin, Frits Brandsma, C. J. H. Jansen Imperatoris Iustiniani Institutionum Libri Quattuor By John Baron Moyle, Justinian "The evolution of the law of unjustified enrichment"