Praise be to Allaah.
If a person delegates someone else to sell or buy a product, the agent does not have the right to make a profit on it, because he has been entrusted with a task. Rather any profits, losses or gifts are for the owner of the wealth.
If the owner of the wealth says: Sell the product for such and such an amount, and he specifies the price, then the agent sells it for more, the additional amount belongs to the owner of the wealth, unless he gives the agent permission, such as saying: Sell it for such and such a price, and anything more than that is yours.
The scholars of the Standing Committee for Issuing Fatwas were asked: There is a man who sells another man’s product for him, i.e., he gives him his product to sell it for him with his knowledge. This man increases the price and keeps the extra amount. Is this regarded as riba, and what is the ruling on the one who does that?
The one who sells the product is regarded as an agent of the owner of the product, who has been entrusted with it and its price. If he takes anything of the price without the owner of the product knowing, then he is betraying the trust and whatever he takes is haraam for him. End quote. Fataawa al-Lajnah al-Daa’imah (14/274).
It also says in Fataawa al-Lajnah al-Daa’imah (14/273):
The one who delegated you to sell the product for him and set the price for which it was to be sold, but you sold it for a higher price than that which had been set for you, is more entitled to the extra money, unless he agrees to that and allows you to take it. If he gives permission to you to keep this money, then it is halaal for you. End quote.
Based on that, if you sold the product for more than your boss told you to, then the extra amount belongs to him, unless he gives you permission to keep it.
It is permissible for you to make an agreement with him that you will sell it in this manner, and that you will keep the extra amount. But taking it without his knowledge and permission comes under the heading of consuming people’s wealth unlawfully.
And Allaah knows best.