There are several scholarly views on this:
The position of the madhhab is that it is a sunnah, and it is disliked for one who is able to offer it to neglect it.
The second view is that the udhiyah is obligatory. This is the position of Abu Hanifah and one narration from Imam Ahmad—may Allah have mercy on them both—and it was also preferred by Shaykh al-Islam Ibn Taymiyyah—may Allah have mercy on him. He said: Its apparent ruling is that it is obligatory, and whoever is able to offer it but does not do so is sinful. For Allah, Exalted is He, mentioned it alongside prayer in His saying:
“So pray to your Lord and sacrifice.” [al-Kawthar]
And in His saying:
“Say, ‘Indeed, my prayer, my rites of sacrifice, my living and my dying are for Allah, Lord of the worlds.’” [al-An‘am]
Moreover, in Surah al-Hajj, He repeatedly set forth its rulings, benefits, and advantages. Something of such significance ought to be obligatory and binding upon everyone who is able to perform it.
It is part of Allah’s blessing upon mankind that He has legislated for them something through which they may share with the pilgrims during the Hajj season. For the pilgrims have Hajj and hady, while the people of the towns and regions have the udhiyah. Thus, among Allah’s bounty and mercy is that He has granted those living outside the Sacred Precinct a share of what is granted to those performing the rites. An example is their refraining from trimming the hair and nails during the first ten days, so that those in the towns may join those in ihram in worshipping Allah Most High by abstaining from taking from these things; and so that they may join the pilgrims in drawing near to Allah Most High through slaughtering the udhiyah. Were it not for this legislation, slaughtering them would be an innovation, and people would have been forbidden from doing so. But Allah legislated it for these great benefits.
Thus, the view that it is obligatory is more evident than the view that it is not obligatory, on condition that one is able. As for one who is unable and possesses only the maintenance of his family, or