Praise be to Allah.
There is nothing wrong with working for a seller or a buyer; there is nothing wrong with stipulating a condition in that case. End quote.
Majmoo’ Fataawa Ibn Baaz (19/31).
See also the answer to question no. 45726, in which we explained that it is permissible to accept payment for brokerage, so long as the broker is trustworthy and honest.
And Allaah knows best.