Richard Ebeling has a post showing how medieval towns were not bastions of free trade and markets. In fact they were the opposite and the various restrictions eventually paved way for a more freer system:
While the manors, to a great extent, survived through a rather comprehensive system of self-sufficiency, the towns and those who resided in them acquired many of the things they needed through trade. Theirs was, therefore, an exchange and money economy. But commerce, trade, and money exchange implies a system of property rights that permits ownership by individuals, and rules and laws of contract among the agents.
It was in the towns of the Middle Ages that there began to emerge the economic, legal, and social prerequisites of the market economy.It is in the urban areas of Medieval Europe that we see the foundations for the modern age of capitalism, with its traditions and legal protections for individual rights, private property, and the emergence of an economic order in which each participant fulfills his own wants by serving others through production and trade – and an interdependency that naturally follows with an exchange-based system of division of labor.
While the institutions of property and contract slowly emerged during this period, it would be a great error to interpret this to mean that Medieval town life in any way reflected a free market setting. If anything, it was the opposite. Competition as we know it today did not exist, and would have been considered dangerous and an undesirable way of doing business. Prices and wages were all controlled on the basis of conceptions of “fairness” and “justice,” as conceived at the time.
Communal ownership and management of property in the towns was a common practice in a number of areas. For example, there was a common pasture on which the townspeople grazed their livestock; town control of the grain mill, with all those living in the town having to use the municipal facilities; often even bakeries, ovens and market places would be communally owned and managed in a similar manner.
He discusses the role of guilds which ensured only those who belonged in the grid could engage in that economic activity:
The real institutional mechanism for economic regulation in the Medieval towns was the “guilds.” The “guilds” were occupational associations that determined who was permitted to trade in the town, and under what terms and how the product or service was to be produced and offered on the market.
The guilds served as a legalized avenue for the monopolization of trade with crafts and professions.Foreign merchants were permitted to trade in a town only under special permit. Their movements were watched, they were not allowed to “under sell” the town’s merchants, and could only offer products of specified qualities and types.
Among the townspeople themselves, the “guilds” set lots of things: the rules for apprenticeships – who and how many people might enter a profession or occupation each year under a “master” who was a member of a guild; the methods and materials that might be used in producing goods; the hours when businesses might be open for trade; that goods could not be withdrawn from the shelves until a certain time of the day, and only sold on the guild-controlled markets; and all prices for both products and resources, fixed within maximums and minimums above and below which were violations of the guild codes and subject to criminal prosecution.
Some may say not much has changed since then. Guilds have been replaced with oligopoly cartels in most industries who thwart competition and innovation. Just that names have changed.
Whatever it may be, all this bit is really interesting.
In India too we have plenty of stories which tell you about trade etc being part of ancient and medieval times. The evolution of Indian bazaar over the years is so much to do with economics and society. But they are hardly taught or discussed in economics curriculum.