Deploying small cells in cellular networks, as a technique for capacity and coverage enhancement, is an indispensable characteristic of future cellular networks. In this paper, a novel online decentralized algorithm for enabling energy trading in multi-tier cellular networks with selfish energy harvesting capable base stations (BSs) is proposed. A BS uses the non-renewable energy when it cannot harvest sufficient energy to serve its connected users. To minimize the non-renewable energy consumption, we establish a framework for trading energy such that BSs with energy deficit are stimulated to compensate their energy shortage with the extra harvested energy of other BSs. BSs with energy deficit are assigned to BSs with extra harvested energy by using matching theory. The extra harvested energy is distributed by the smart grid. Along with energy trades, BSs gain more profit and their utility functions enhance. Simulation results show that the waste of energy due to limited batteries and the non-renewable energy consumption decreases considerably when the proposed algorithm is applied.