It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) ordered the giving of Sadaqat al-Fitr before the people go out for the Eid al-Fitr prayer.
Hadith Referenceصحيح ابن خزيمه / جماع أبواب صدقة الفطر فى رمضان / 2422