In the answer to question no. 169750 we explained that it is not permissible to sell that which you do not have in your possession and that you are not able to guarantee delivery thereof to the customer, unless you buy it, take possession of it, move it to your place and then sell it, because of the hadeeth of Hakeem ibn Hizaam (may Allah be pleased with him) who said: I went to the Messenger of Allah (blessings and peace of Allah be upon him) and said: A man may come to me asking me to sell him something that I do not have. Should I buy it for him from the marketplace then sell it to him? He said: Do not sell that which you do not possess.
Narrated by at-Tirmidhi, 1232; an-Nasaa'i, 4613; Abu Dawood, 3503; Ibn Maajah, 2187; Ahmad, 14887. Classed as saheeh by al-Albaani in Irwa' al-Ghaleel, 1292.
Based on that, the way in which you are doing this transaction is not permissible.
The solution is to do it in one of the following ways:
Agreeing on the required parts in terms of their description, quality, number and price in such a way as to dispel ambiguity. Then make an agreement to carry out the transaction when you take possession of the parts, without any party being obliged to buy or sell. If you do not have the parts in your shop, then you can make an agreement between you and the purchaser to buy them, meaning that the purchaser will come and see the parts, and if he finds that they are what he is looking for and agrees to that before handing over the money and taking possession of them, then the transaction will be valid.
The purchaser can appoint you to act on his behalf in buying the required parts, after describing them to you and telling you the description and quality required, and so on, in return for a payment that you both agree to, as a fee for acting on his behalf. Then when the purchase is completed and the parts have been delivered, you can take the payment that has been agreed upon. Or you could do this for him for free, without any payment, for that particular part, if you wish.
You could buy the parts that he wants and that are available in your neighbour's shop from your neighbour, then bring them to your shop, then sell them to the purchaser in a valid transaction. This may be done very quickly. Instead of selling them to the purchaser first, then buying them from your neighbour, you can buy them from your neighbour first, and then sell them to the purchaser.
For more information please see the answer to question 160559
And Allah knows best.
Reproduced from Islam QA