Hadithcore
Sahih Muslim, 1961 h
sahih

Al-Bara' b. 'Azib reported:

Allah's Messenger (ﷺ) addressed us on the day of Nahr and said: None should sacrifice the animal unless he has completed the ('Id) prayer. A person said: I have a milch goat of less than one year, better than two fat goats. Thereupon he said: Sacrifice it, and no goat of less than a year of age will be accepted as sacrifice after you.

وَحَدَّثَنِي أَحْمَدُ بْنُ سَعِيدِ بْنِ صَخْرٍ الدَّارِمِيُّ، حَدَّثَنَا أَبُو النُّعْمَانِ، عَارِمُ بْنُ الْفَضْلِ حَدَّثَنَا عَبْدُ الْوَاحِدِ، - يَعْنِي ابْنَ زِيَادٍ - حَدَّثَنَا عَاصِمٌ الأَحْوَلُ، عَنِ الشَّعْبِيِّ، حَدَّثَنِي الْبَرَاءُ، بْنُ عَازِبٍ قَالَ خَطَبَنَا رَسُولُ اللَّهِ صلى الله عليه وسلم فِي يَوْمِ نَحْرٍ فَقَالَ ‏"‏ لاَ يُضَحِّيَنَّ أَحَدٌ حَتَّى يُصَلِّيَ ‏"‏ ‏.‏ قَالَ رَجُلٌ عِنْدِي عَنَاقُ لَبَنٍ هِيَ خَيْرٌ مِنْ شَاتَىْ لَحْمٍ قَالَ ‏"‏ فَضَحِّ بِهَا وَلاَ تَجْزِي جَذَعَةٌ عَنْ أَحَدٍ بَعْدَكَ ‏"‏ ‏.‏

References2 variants
In-Book Reference
Book 35, Hadith 13
USC-MSA web (English) reference
Book 22, Hadith 4830 (deprecated numbering scheme)