Genesis 37:27-28
37:27 Come, let’s sell him to the Ishmaelites, but let’s not lay a hand on him, for after all, he is our brother, our own flesh.” His brothers agreed.
37:28 So when the Midianite merchants passed by, Joseph’s brothers pulled him out of the cistern and sold him to the Ishmaelites for twenty pieces of silver. The Ishmaelites then took Joseph to Egypt.
Genesis 37:36
37:36 Now in Egypt the Midianites sold Joseph to Potiphar, one of Pharaoh’s officials, the captain of the guard.