If the case is as you have mentioned in the question, this transaction is not permissible because it involves giving a loan that generates a profit,
and every loan that generates a profit is Riba (usury). May Allah protect us from this! May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.