In recent years, the performance-based approach to contracting for medical services has been gaining popularity across different healthcare delivery systems, both in the United States (under the name of “pay for performance”) and abroad (“payment by results” in the United Kingdom). The goal of our research is to build a unified performance-based contracting (PBC) framework that incorporates patient access-to-care requirements and that explicitly accounts for the complex outpatient care dynamics facilitated by the use of an online appointment scheduling system. We address the optimal contracting problem in a principal–agent framework where a service purchaser (the principal) minimizes her cost of purchasing the services and achieves the performance target (a waiting-time target) while taking into account the response of the provider (the agent) to the contract terms. Given the incentives offered by the contract, the provider maximizes his payoff by allocating his outpatient service capacity among three patient groups: urgent patients, dedicated advance patients, and flexible advance patients. We model the appointment dynamics as that of an M/D/1 queue and analyze several contracting approaches under adverse selection (asymmetric information) and moral hazard (private actions) settings. Our results show that simple and popular schemes used in practice cannot implement the first-best solution and that the linear performance-based contract cannot implement the second-best solution. To overcome these limitations, we propose a threshold-penalty PBC approach and show that it coordinates the system for an arbitrary patient mix and that it achieves the second-best performance for the setting where all advance patients are dedicated.