This paper addresses the challenge of determining the optimal duration for an online retail platform to hold orders from individual customers before dispatching them to third-party logistics companies. Specifically, we propose an end-to-end data-driven approach that directly learns personalized order-holding policies from available data, as opposed to employing the predict-then-optimize framework outlined in Chen et al. (2023). The data-driven approach is subsequently reformulated as a mixed-integer linear programming (MILP) problem aimed at minimizing in-sample holding times while achieving the desired consolidation rate. Leveraging real data provided by the 2020 MSOM data-driven challenge, we conduct numerical experiments to illustrate that our proposed end-to-end data-driven method can substantially reduce holding times compared to the predict-then-optimize framework proposed by Chen et al. (2023). Furthermore, we identify a critical moderating parameter that influences the comparative performance of the two methods, aiding in the selection process between them.