Section 1: Definition of Salam Sale, Its Ruling, and Its Purpose:

Firstly: Definition of Salam Sale Linguistically and Technically
Linguistically, "Salam" is derived from the root "S-L-M," which has the meanings of peace and safety. It is said, "Sallam" and "Aslam," all with the same meaning. However, "Sallam" can also refer to a loan, and it is said to be the language of the people of Iraq, while "Salaf" is the language of the people of the Hijaz. [2741] Refer to: ((Tahdhib al-Lughah)) by al-Azhari (310/12), ((Al-Sahah Taj al-Lughah)) by al-Jawhari (1950/5), ((Subul al-Salam)) by al-San'ani (68/2).
Technically, Salam sale is a sale of a specified commodity to be delivered in the future in exchange for a price paid immediately. [2742] Refer to: ((Sharh al-Nawawi 'ala Muslim)) (41/11), ((Subul al-Salam)) by al-San'ani (68/2). Scenario: The Salam contract can be defined as the buyer paying the price upfront with a deferred delivery of the sold item. For example, the buyer may say, "I have paid to you ten thousand riyals for you to give me one hundred kilograms of sweet dates, to be delivered on the first day of the upcoming Ramadan". The buyer in this case is called the "Muslim" or "Rab al-Salam," and the seller is called the "Muslim Ilayh." The price is the capital of the Salam, and the deferred sale item.
Some also say it is a contract where the specified commodity is deferred, with a price that is agreed upon and paid during the contract session. [2743] Refer to: ((Al-Matla' 'ala Alfadh al-Muqni)) (p. 293).

Secondly: Ruling on Salam Sale
Salam sale is permissible. [2744] In contemporary terms, Salam financing involves various agricultural and industrial operations, where the produce or production is delivered to the financier at a specified date, whether it is produced by the producers themselves or purchased from others. The decision of the Fiqh Assembly No. 85 (9/2) concerning Salam and its contemporary applications, in the ninth conference session in Abu Dhabi, UAE, from 1/6 Dhul Q’idah 1415 AH, coinciding with 1/4/1995, m: "The Salam contract is suitable for financing various agricultural operations, where the Islamic bank deals with farmers who are expected to have the commodity in the season of their crops or other crops that can be purchased and delivered if they fail to deliver from their own crops, providing them with significant benefits and relieving them from financial difficulties in achieving their production. b - The Salam contract can be applied in financing agricultural and industrial small producers, especially financing the previous stages of producing and exporting popular goods, by purchasing them in Salam and marketing them at favorable prices. c - The Salam contract can be applied in financing craftsmen and small agricultural and industrial producers, by supplying them with production supplies in the form of equipment, machines, or raw materials, as Salam capital, in exchange for some of their products to be marketed)." ((Majallah Majma' al-Fiqh)) (492/9, 493).
The evidence:
(1) The Qur’an
The Almighty says "O you who have believed, when you contract a debt for a specified term, write it down." (al-Baqara:282)
Point of Extrapolation: [2745] Reported by ibn `Abbas may Allah be pleased with them both: I bear witness that advance payment is guaranteed to a specified term, Allah the Almighty has decreed it in His book, permitted it, and mentioned the verse." Recorded by Al-Hakim (3130) and Al-Bayhaqi (11409). Al-Hakim authenticated it based on the conditions of the two Sheikhs (referring to Al-Bukhari and Muslim), and Ibn al-Mulqin authenticated its chain of transmission in 'Al-Badr Al-Muneer' (6/616). Additionally, the hadith was authenticated by Al-Albani in 'Irwa' al-Ghalil' (1369).
This is general for buying in advance and other than it. [2746] See ‘Sharh Mukhtasar al-Tahawi’ by Al-Jassas (3/134). The ayah is the basis for matters pertaining to transactions, and many subsidiary matters. The term ‘dayn’ refers to any transaction in which one of the counterparts involves upfront payment and the other includes a delay in payment. [2747] See: ((Ahkaam al-Quran)) by ibn al-Arabi (1/327).
(2) From the Sunnah
(A) It was reported by Ibn `Abbas (may Allah be pleased with them both) that the Prophet (peace be upon him) came to Medina and found the people paying in advance for fruits which were to be given after one, two, or even three years after. He then said, "Whoever pays in advance should pay for a specified measurement and a specified weight for a specific period.” [2748] Reported by Al-Bukhari (2240) with his wording, and by Muslim (1604) 

Point of Extrapolation: ‘Al-salaf’ and ‘as-salam’ are the same in form and meaning [2749] See 'Subul al-Salam' by Al-San'ani (2/68).
(B) Muhammad ibn Abi al-Mijalid reported, "Abdullah ibn Shaddad and Abu Burdah sent me to Abdullah ibn Abi Awfa (may Allah be pleased with them both) and they said, 'Ask him, 'Did the companions of the Prophet (peace be upon him) used to do advance payment of wheat at his time?' Abdullah replied, 'We used to pay the Nabit of ahl-ul-Sham [2750] Nabateans of the people of Greater Syria, i.e., the agricultural people of Greater Syria. Some say: Nabateans of the people of Greater Syria; they are a people from the Arabs who assimilated with non-Arabs and Romans, their lineages mixed, and their languages were corrupted. Some say: Nabateans of Greater Syria are the Christians who inhabited it. Refer to: 'Umdat al-Qari' by Al-Ayni (12/66). in advance for wheat, barley, and oil for a specified measurement and a known period.' I then asked him, 'From whom did their capital come?' He replied, 'We would not ask them about that.' They then sent me to Abdur-Rahman ibn Abza, so I asked him the same, to which he replied, 'The companions of the Prophet (peace be upon him) used to deal with advance payments at his time and we would not ask them whether they had a tilth or not.'" [2751] Narrated by Al-Bukhari (2254, 2255)
(3) Consensus
The following reported a consensus on this: Al-Shafi`i, [2752] Al-Shafi'i said: "The Salaf (predecessors) considered Salam permissible in the Sunnah of the Messenger of Allah (peace be upon him) and in the narrations. It is not disputed amongst the people of knowledge from whom I know." ((Al-Umm)) (3/94). ibn al-Mundhir, [2753] Ibn al-Mundhir said: "All those from whom we have knowledge among the people of knowledge unanimously agree that Salam is permissible. A man may sell to his companion a known and specified amount of food, such as food from common land, not subject to error in quality, with a known weight or measure, for a specified period, with a known amount of money, paying the price for what has been sold before parting from the place where they conducted the transaction. They should name the place where the food will be delivered. If they do all of this and both parties agree, the Salam is valid. I do not know of anyone from the people of knowledge who invalidates it." ((Al-Ishr?f 'al? Madh?hib al-'Ulam?')) (6/101). ibn al-`Arabi, [2754] Ibn al-Arabi said: "The Ummah unanimously agreed on the permissibility of both Salam and Qard (advance payment)." ((Al-Qabas f? Shar? Muwa??a' M?lik ibn Anas)) (p. 832). al-Qurtubi, [2755] . Al-Qurtubi said: "Salam is a valid transaction by consensus." ((Tafsir al-Qurtubi)) (3/379). al-Nawawi, [2756]  Al-Nawawi said: "The Muslims unanimously agree on the permissibility of Salam." ((Sharh al-Nawawi 'ala Muslim)) (11/41) al-Qarrafi, [2757] Al-Qarafi said: "It is permitted in Salam, and the Ummah has agreed on its permissibility." ((Al-Dhakhira)) (5/224). ibn Taymiyyah, [2758]  Ibn Taymiyyah said: "As for the Salaf, they unanimously agreed on its permissibility." ((Majmu' al-Fatawa)) (29/495). al-Zaili`i, [2759] Al-Zailai said: "It is narrated that the Prophet (peace be upon him) forbade selling what one does not possess, but he permitted Salam. It is legislated in the Book, the Sunnah, and the consensus of the Ummah." ((Tabyin al-Haqa'iq)) (4/110). ibn al-Qayyim, [2760] Ibn al-Qayyim said: "The one missing three things is of three types: missing and specified in a covenant. This is permissible to sell, by agreement. Abu Hanifa, however, stipulated in this type that the time of the contract must be present in terms of the total, and this is Salam." ((Zad al-Ma'ad)) (5/717). ibn Hajar, [2761]  Ibn Hajar said: "Salam is legally valid: a sale specified in a covenant. Scholars have unanimously agreed on its legality, except for what has been reported from Ibn al-Musayyib." ((Fath al-Bari)) (4/428). and al-`Ayni. [2762]  Al-Ayni said: "Salam in Shariah is a sale among permissible sales by mutual agreement, and the scholars unanimously agreed on its legality." ((Umdat al-Qari)) (12/61). However, there is reported disagreement on this from Ibn al-Musayyib and that it is disliked according to Abdullah ibn Mas'ud. Refer to ((Fath al-Bari)) by Ibn Hajar (4/428), ((Umdat al-Qari)) by Al-Ayni (12/61).

Thirdly: The wisdom behind the legislation of advanced payment
From the wisdom of advanced payment being legislated is that the people are in need of it. In particular, the owners of crops, fruits and businesses require expenditure, and they may face financial difficulties. For this reason, they are permitted to benefit from advanced payment, and the believer takes advantage of concessions. [2763] Refer to ((Al-Mughni)) by Ibn Qudamah (4/207).