All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
First of all, there is no harm if you agree with that client to take money in exchange for the advice you provide to him. In order to be on the safe side, it is better to make a Ji’aalah contract with him.
The way this contract is conducted is to agree with the client that if he does save on his taxes, then he gives you a sum of money; there is nothing wrong provided that the amount you will get is a fixed amount and known.
Making the fees in the form of a percentage from the amount that he will save, then if the amount that he will save is known, then it is acceptable to assign your share in the Ji’aalah as a percentage from that amount.
However, if the amount that he will save is unknown, then the scholars differed in opinion about the validity of the Ji’aalah if the compensation is an unknown amount at the time of the contract, provided that this lack of knowledge will not prevent the delivery (of the fees or the compensation).
Ibn Qudaamah said in Al-Mughni:
"The compensation must be known, and the Ji’aalah could be permissible if the compensation is unknown, provided that this lack of knowledge would not prevent the delivery (of the compensation), such as a person saying: 'Whoever finds my lost item, he will get one third of it.'" [End of quote]
Nonetheless, there is no doubt that it is safer to avoid an unknown percentage.
As regards taking some money as nonrefundable deposit, then we did not understand what you exactly meant by this.
For more benefit on Ji'aalah, please refer to Fataawa 91093, 287518, 119330, and 90987.
Allah knows best.