Genesis 37:12-36 NIV
Now his brothers had gone to graze their father’s flocks near Shechem, and Israel said to Joseph, “As you know, your brothers are grazing the flocks near Shechem. Come, I am going to send you to them.”
“Very well,” he replied.
So he said to him, “Go and see if all is well with your brothers and with the flocks, and bring word back to me.” Then he sent him off from the Valley of Hebron.
When Joseph arrived at Shechem, a man found him wandering around in the fields and asked him, “What are you looking for?”
He replied, “I’m looking for my brothers. Can you tell me where they are grazing their flocks?”
“They have moved on from here,” the man answered. “I heard them say, ‘Let’s go to Dothan.’ ”
So Joseph went after his brothers and found them near Dothan. But they saw him in the distance, and before he reached them, they plotted to kill him.
“Here comes that dreamer!” they said to each other. “Come now, let’s kill him and throw him into one of these cisterns and say that a ferocious animal devoured him. Then we’ll see what comes of his dreams.”
When Reuben heard this, he tried to rescue him from their hands. “Let’s not take his life,” he said. “Don’t shed any blood. Throw him into this cistern here in the wilderness, but don’t lay a hand on him.” Reuben said this to rescue him from them and take him back to his father.
So when Joseph came to his brothers, they stripped him of his robe—the ornate robe he was wearing— and they took him and threw him into the cistern. The cistern was empty; there was no water in it.
As they sat down to eat their meal, they looked up and saw a caravan of Ishmaelites coming from Gilead. Their camels were loaded with spices, balm and myrrh, and they were on their way to take them down to Egypt.
Judah said to his brothers, “What will we gain if we kill our brother and cover up his blood? Come, let’s sell him to the Ishmaelites and not lay our hands on him; after all, he is our brother, our own flesh and blood.” His brothers agreed.
So when the Midianite merchants came by, his brothers pulled Joseph up out of the cistern and sold him for twenty shekels of silver to the Ishmaelites, who took him to Egypt.
When Reuben returned to the cistern and saw that Joseph was not there, he tore his clothes. He went back to his brothers and said, “The boy isn’t there! Where can I turn now?”
Then they got Joseph’s robe, slaughtered a goat and dipped the robe in the blood. They took the ornate robe back to their father and said, “We found this. Examine it to see whether it is your son’s robe.”
He recognized it and said, “It is my son’s robe! Some ferocious animal has devoured him. Joseph has surely been torn to pieces.”
Then Jacob tore his clothes, put on sackcloth and mourned for his son many days. All his sons and daughters came to comfort him, but he refused to be comforted. “No,” he said, “I will continue to mourn until I join my son in the grave.” So his father wept for him.
Meanwhile, the Midianites sold Joseph in Egypt to Potiphar, one of Pharaoh’s officials, the captain of the guard.
NIV: New International Version