Praise be to Allah.
Firstly:
It is permissible to market and promote products on the Amazon website in return for commission and a percentage of the price of the product, so long as the product is permissible, and so long as the marketer does not pay anything in order to be allowed to market it.
It is not permissible to promote haraam items, such as haraam movies, and it is not permissible to receive commission for that, because Allah, may He be exalted, says (interpretation of the meaning):
“And cooperate in righteousness and piety, but do not cooperate in sin and aggression. And fear Allah; indeed, Allah is severe in penalty”
[al-Maa’idah 5:2].
Secondly:
What you have mentioned about cookies, and that if anyone enters the website through your link and buys something on the same day, you will have a percentage of what he bought, comes under the heading of promoting the website in general, not promoting a particular product.
There is nothing wrong with promoting the website in return for commission, if most of its products are permissible.
What appears to be the case is that it is permissible to promote the Amazon website in general, in return for commission that you receive if someone who came to the website through your link buys something on the same day.
If it becomes clear to you that someone who came through your link bought something haraam, there is no blame on you; rather the sin is on the purchaser, and the commission is permissible for you, because it was in return for promoting the website, not promoting the haraam product. But if you get rid of that commission in that case, then it is better.
And Allah knows best.
Comment