Ibn Abbas (may Allah be pleased with them both) narrates that Usama bin Zaid (may Allah be pleased with him) informed me that the Prophet (ﷺ) said: "Riba (usury) occurs only in the case of credit."
Hadith Referenceمسند الإمام الشافعي / كتاب البيوع / 1396
Hadith Takhrijاخرجه البخاري، البيوع، باب بيع الدينار بالدينار نساء (2178)، (2179) ومسلم، المساقاة، باب بيع الطعام مثلا بمثل (1596)۔