We solve a delivery problem arising in e-commerce logistics. We consider a retailer with an online store and a network of stores operating in an omni-channel strategy. The fulfillment decision for an online order, which contains a number of items, involves the allocation of these items to the stores where they are available and the selection of one store for consolidation of the items into the final package to be dispatched to the customer. The transportation between the stores and the customer is handled by a third-party logistic provider which uses a concave pricing policy based on the distance between the origin and the destination, as well as on the weight of the items. We present an online problem which is defined for a set of orders placed over time, and a mixed integer programming formulation defined for each order. The main characteristics of this problem are that the solution of the formulation for each order impacts those of the subsequent orders, and the problem must be solved in real time. For the solution of the formulation, we propose an iterative matheuristic based on the solution of the set covering model and local search. Computational results on randomly generated instances are provided, which demonstrate that our algorithm is capable of producing high-quality results.