It is narrated from Shaddad bin Aws (may Allah be pleased with him) that he said: During the conquest of Makkah, we were with the Messenger of Allah (peace be upon him). He (peace be upon him) saw a man who had undergone cupping, while eighteen days of Ramadan had passed. The Prophet (peace be upon him) was holding my hand and said: "Both the one who performs cupping and the one who gets cupped have broken their fast."
Hadith Referenceمسند الإمام الشافعي / كتاب الصيام / 654
Hadith Takhrijاخرجه ابوداود، الصيام، باب في الصائم يحتجم (2369) وابن ماجة ، الصيام، باب ماجاء في الحجامة للصائم (1681) ۔ وصححه الحاكم: (1/ 429 428)۔
It is narrated from Ibn Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) had cupping done while in the state of ihram and while fasting.
Hadith Referenceمسند الإمام الشافعي / كتاب الصيام / 655
Hadith Takhrijصحيح من غير هذا الطريق ، اخرجه البخاري، الصوم، باب الحجامة والقئ للصائم (1938) ، (1939)۔
It is narrated from Nafi' (may Allah have mercy on him) that he reports from Ibn Umar (may Allah be pleased with them) that Ibn Umar (may Allah be pleased with them) used to get cupped while fasting, then later he abandoned it.
Hadith Referenceمسند الإمام الشافعي / كتاب الصيام / 656
Hadith Takhrijاسناده صحیح اخرجه مالك في الموطا الصيام، باب حجامة الصائم والبيهقي: 4/ 269 ـ وفي المعرفة السنن والآثار له ، رقم : (2545)۔