Language:
كتاب المغازى
64  
Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi)
(35)
Chapter: The Ghazwa of Al-Hudaibiya
(35)
باب غَزْوَةِ الْحُدَيْبِيَةِ
Sahih al-Bukhari 4172

Narrated Anas bin Malik:

regarding Allah's Statement: "Verily! We have granted you (O, Muhammad) Manifest victory." (48.1) It refers to the Al-Hudaibiya Pledge. And the companions of the Prophet (ﷺ) said (to the Prophet), "Congratulations and happiness for you; but what reward shall we get?" So Allah revealed:-- "That He may admit the believing men and women to gardens beneath which rivers flow." (48.5)

حَدَّثَنِي أَحْمَدُ بْنُ إِسْحَاقَ، حَدَّثَنَا عُثْمَانُ بْنُ عُمَرَ، أَخْبَرَنَا شُعْبَةُ، عَنْ قَتَادَةَ، عَنْ أَنَسِ بْنِ مَالِكٍ ـ رضى الله عنه ‏{‏إِنَّا فَتَحْنَا لَكَ فَتْحًا مُبِينًا‏}‏ قَالَ الْحُدَيْبِيَةُ‏.‏ قَالَ أَصْحَابُهُ هَنِيئًا مَرِيئًا فَمَا لَنَا فَأَنْزَلَ اللَّهُ ‏{‏لِيُدْخِلَ الْمُؤْمِنِينَ وَالْمُؤْمِنَاتِ جَنَّاتٍ‏}‏ قَالَ شُعْبَةُ فَقَدِمْتُ الْكُوفَةَ فَحَدَّثْتُ بِهَذَا كُلِّهِ عَنْ قَتَادَةَ ثُمَّ رَجَعْتُ فَذَكَرْتُ لَهُ فَقَالَ أَمَّا ‏{‏إِنَّا فَتَحْنَا لَكَ‏}‏ فَعَنْ أَنَسٍ، وَأَمَّا هَنِيئًا مَرِيئًا فَعَنْ عِكْرِمَةَ‏.‏
Reference : Sahih al-Bukhari 4172
In-book reference : Book 64, Hadith 214
USC-MSA web (English) reference : Vol. 5, Book 59, Hadith 490
  (deprecated numbering scheme)