Considering that, in reality, passengers usually hold preferred time windows when waiting for a bus at a station, this study develops a mixed integer programming model for the customized bus routing problem (CBRP) with full spatial–temporal constraints based on one of our previous studies. Specifically, bus routing and passenger assignment are simultaneously optimized with better vehicle capacity utilization and more realistic considerations of partial service, characteristics of customized bus service, and a range of operational constraints. To solve the formulated model, an exact algorithm (i.e. the branch-and-cut algorithm) and two heuristics (i.e. the genetic and tabu search algorithms) are numerically compared through an illustrative example, and subsequently, a case study in Beijing is conducted to assess the proposed approach. A comparison with the practical customized bus system shows that the proposed approach realizes effective vehicle usage on several routes.