Tipping is an instrumental aspect of multi-phase contact situations that arise during common tasks such as the locomotion of legged systems. Despite its importance in balance recovery, tipping is often ignored in trajectory optimization due to the lack of existing methods that are able to actively plan and optimize for unspecified contacts. Trajectory Optimization based on nonlinear programming requires a priori knowledge about anticipated contact changes, such as their order and timing, in order to generate physically feasible motions. In this paper, an optimization framework with conditional constraints is established for direct collocation in trajectory optimization for legged balancing with foot tipping allowance. The proposed approach can evaluate the timing of contact phases without preplanned contact forces or sequences of events, which is not possible with conventional methods. This optimization framework is demonstrated by computing the balanced regions of two reduced-order models of a legged system, namely, inverted-pendulum-based models without and with a flywheel, and is verified with control simulations. The contribution of tipping to balance stability is quantified and compared to prior results obtained without tipping allowance. The framework presented can also be generalized to other multi-phase contact scenarios, such as rolling and sliding, where unspecified discontinuous changes in contact occur with important consequences in the performance of legged systems.