In order to be attractive in a very demanding market, hybrid electric buses and full electric buses need to improve the total cost of ownership compared to conventional buses. In this regard, the sizing of the onboard energy storage and the charging infrastructure becomes a key design stage. Sufficient onboard storage and charging facilities are necessary to offer an appropriate vehicle autonomy, but they involve high investment costs. Furthermore, the complex interrelations between these parameters make the best-performed system design a challenging process. To face this issue, the paper presents an optimization approach by means of the onboard storage capacity sizing, charging points rate and charging points location, aiming a total cost of ownership improvement for hybrid and full electric bus routes. A use case is selected and techno-economically evaluated regarding factors such as onboard storage cost, charging infrastructure cost, fuel cost, and electricity cost.