5. Book of Rites
٥۔ كِتَابُ الْمَنَاسِكِ
[Machine] The Messenger of Allah, peace be upon him, said, "Hajj (pilgrimage) has been ordained upon you." It was said, "O Messenger of Allah, is it obligatory every year?" He said, "No, if I had said it was obligatory to perform Hajj every year, it would have become obligatory and anything beyond that would be voluntary."
قَالَ رَسُولُ اللَّهِ ﷺ «كُتِبَ عَلَيْكُمُ الْحَجُّ» فَقِيلَ يَا رَسُولَ اللَّهِ فِي كُلِّ عَامٍ؟ قَالَ «لَا وَلَوْ قُلْتُهَا لَوَجَبَتْ الْحَجُّ مَرَّةٌ فَمَا زَادَ فَهُوَ تَطَوُّعٌ»
Another chain with similar narration. (Using translation from Tirmidhī 1599)
عَنْ ابْنِ عَبَّاسٍ نَحْوَهُ