Deuteronomy 20:11

11 If they accept and open their gates, all the people in it shall be subject to forced labor and shall work for you.

Read Deuteronomy 20:11 Using Other Translations

And it shall be, if it make thee answer of peace, and open unto thee, then it shall be, that all the people that is found therein shall be tributaries unto thee, and they shall serve thee.
And if it responds to you peaceably and it opens to you, then all the people who are found in it shall do forced labor for you and shall serve you.
If they accept your terms and open the gates to you, then all the people inside will serve you in forced labor.