The availability of increasingly large data sets in the context of supply chain and logistics creates opportunities to streamline operations leveraging machine learning methods. In this study, we apply such methods to a well-studied problem in transportation and logistics: routing optimization. Route planning technologies that build on routing optimization methods are widely used in industry. However, deviations from planned routes are common to observe in logistics practice, mainly caused by data unavailability on endogenous and exogenous customer constraints. The purpose of this study is to derive a machine-learning based approach to infer customer constraints from transactional data. We propose a probabilistic directed graphical model, using a Metropolis-Hastingswithin-Gibbs sampling algorithm for inference. Using a stylized problem inspired in a real-world dataset of delivery transactions, preliminary results suggests that our proposed method outperforms approaches based on simple counting of occurrences. Based on our results, we propose promising avenues of future research combining machine learning and routing problems.