We establish the existence of Walrasian equilibrium for economies with many discrete goods and possibly one divisible good. Our goal is not only to study Walrasian equilibria in new settings but also to facilitate the use of market mechanisms in resource allocation problems such as school choice or course selection. We consider all economies with quasilinear gross substitutes preferences. We allow agents to have limited quantities of the divisible good (limited transfers economies). We also consider economies without a divisible good (nontransferable utility economies). We show the existence and efficiency of Walrasian equilibrium in limited transfers economies and the existence and efficiency of strong (Walrasian) equilibrium in nontransferable utility economies. Finally; we show that various constraints on minimum and maximum levels of consumption and aggregate constraints of the kind that are relevant for school choice/course selection problems can be accommodated by either incorporating these constraints into individual preferences or by incorporating a suitable production technology into nontransferable utility economies.