Chest shops are one of the most commonly used ways of buying and selling items, a chest shop can be created by placing a sign on a chest or double chest and the following format must be used on the sign.
The [Price] following B is the price at which the customer will buy the items. The [Price] following the S is the price at which the customer will sell items from their inventory. Using "B [Price]: S [Price]" allows for buying and selling items from the same chest for different prices. If you do not know an item's ID, you can put a ? instead. When you place the item you are selling or buying into the chest and click the sign, the ? should update to match the ID of the item inside.