There are variations depending on the rendition of the story.
A poor shoemaker and his wife need money to pay the rent. He gives away the last pair of shoes he has to a needy lady. He has leather to make one more pair of shoes. He cuts out the pieces of leather, before going to bed, so that he can sew them into a pair of shoes on the morrow. Elves come in the night and make the pair of shoes which he sells for more than his asking price the next day. He uses that money to pay the rent, buy food and more shoe leather. He feeds a poor traveler…….
He has just enough money to buy enough leather for two pairs of shoes. He cuts the pieces of leather for two pairs, and retires for the night. The elves come, again, that night and make two pairs of shoes with the additional leather. He gives away one pair to a needy person and sells the other pair to a referral from the first customer who is immensely satisfied……
He buys leather for three and stays up to find the elves making the shoes. The shoemaker and wife make clothes for the elves the next day, but the elves are freed when given clothes, so they leave, and the shoemaker and his wife never see them again.