We present a generalized market architecture that provides support for a variety of types of transactions, from simple buying and selling of goods and services to complex multi-agent contract negotiations. This architecture is organized around three basic components: the exchange, the market, and the session. We also present a negotiation protocol for planning by contracting that takes advantage of the services of the market. We show how the existence of an appropriate market infrastructure can add value to a multi-agent contracting protocol by controlling fraud and discouraging counterspeculation.