Online pharmacies are an important part of the modern healthcare system. They interact with customers through well-designed web interfaces to deliver the healthcare customers need. In addition to well-designed web interfaces, online pharmacies rely on an effective supply chain system to provide medical supplies and services, and especially effective inventory management for supply systems. As green supply chain management (GSCM) becomes increasingly considered by countries, how to develop a sustainable inventory model that takes into account the revenue growth of an online pharmacy while preventing waste and reducing energy costs has become very important. In line with this trend, the study develops a sustainable inventory model that focuses on both economic aspect (profit) and environmental aspect (losses from excessive inventory) within a framework of a single period multi-product inventory model. Specifically, the sustainable inventory model applies the visual-attention-dependent demand (VADD) rate to characterize customer demand in an online trading environment, thereby seeking a profitable marketing strategy and reducing losses due to excessive inventory. Since the complexity of model optimization will drastically increase due to the inclusion of many products in the problem, a Genetic Algorithm (GA) based solution procedure is proposed to increase the feasibility of the proposed model in solving real problems. The sustainable inventory model and the solution procedure are illustrated, compared, and discussed with an online pharmacy example. Additionally, a sensitivity analysis is formulated to study the influence of model parameters on the model solution, the loss of unsold inventory that results in a waste of resources and energy, and the profit of online pharmacies.