When you build a market you can click on it with a tool to open the purchase menu, or you can click on it with an item and you will throw that item at the market and it will give you coins.