Online customers expect to wait, sometimes for a delay of many days. At the fulfillment center, there might be an opportunity to fill customer orders earlier than the due date through a cross-docking transaction: rather than picking the item from inventory, the item moves directly from the receiving to the shipping dock, saving shelving and picking transactions. While cross docking reduces shelving and picking costs, it risks changing customer expectations for how soon a product will be delivered. Given customer order arrivals random in quantity and due dates, random replenishment arrivals, and costs (or benefits) for shipping a product early, we characterize the optimal decision as to whether to cross dock a replenishment item to fulfill demand that is not immediately due or to wait to (hopefully) cross dock in later periods. With multiple demands and due dates, the cross-docking decision depends on the number of unfulfilled demands in each period across the horizon, the number of units that have just arrived (available for cross docking), picking and shelving costs, and the delay cost (or benefit). We formulate the problem as a Markov decision process, determine the structure of the optimal policy, and propose a well-performing heuristic.