Lev 25:47-49

47If resident aliens among you prosper, and if any of your kin fall into difficulty with one of them and sell themselves to an alien, or to a branch of the alien's family,48after they have sold themselves they shall have the right of redemption; one of their brothers may redeem them,49or their uncle or their uncle's son may redeem them, or anyone of their family who is of their own flesh may redeem them; or if they prosper they may redeem themselves.