Assalammualaikum I heard that the only way to get a slave according to sharia is through legimaite war between muslim vs non-muslim, and a person born into slavery is a slave. Other type enslavement is invalid. But there is an athar by Ali R.A. saying "Whoever said that he is a slave then he is a slave", narrated by as-Sya'bi from syuraik, that means if someone volunteers to be someone slave then it is VALID. Is this true? Also i've heard that Umar R.A. even permitted someone who in debt to sell himself as slave and the price is given to the path of Allah? So if volunteered/selling one self into slavery is prohibited, can Islamweb provide explanation and prove from the Quran and Sunnah about this matter?
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
A free person can neither be sold nor bought and it is not permissible for a person to sell himself. These narrations which you mentioned in the question were reported by the scholars in their books, but they mentioned that the consensus among the scholars is that this matter is forbidden.
Ibn Hajar was among those who reported this consensus in his book entitled "Fat'h Al-Baari", and Ash-Shawkaani reported it in his book "Nayl Al-Awtaar" when commenting on the Hadeeth narrated by Abu Hurayrah that the Prophet said: "Allaah said: 'I will be the opponent of three persons on the Day of Judgment: a man (i.e. a person) who gave a pledge in My Name and then acted treacherously, a man who sold a free person (as a slave) and consumed his price and a man who hired a laborer and got the full work done by him and did not pay him his wages.’”
For more benefit, please refer to Fataawa 83906, 84431, 85061 and 86042.
Allaah Knows best.
You can search for fatwa through many choices