Hedonic pricing with quasi-linear preferences is shown to be equivalent to stable matching with transferable utilities and a participation constraint, and to an optimal transportation (Monge–Kantorovich) linear programming problem. Optimal assignments in the latter correspond to stable matchings, and to hedonic equilibria. These assignments are shown to exist in great generality; their marginal indirect payoffs with respect to agent type are shown to be unique whenever direct payoffs vary smoothly with type. Under a generalized Spence-Mirrlees condition (also known as a twist condition) the assignments are shown to be unique and to be pure, meaning the matching is one-to-one outside a negligible set. For smooth problems set on compact, connected type spaces such as the circle, there is a topological obstruction to purity, but we give a weaker condition still guaranteeing uniqueness of the stable match.