PurposeSupply chains (SCs) have been growingly virtualized in response to the market challenges and opportunities that are presented by new and cost-effective internet-based technologies today. This paper designed a virtual closed-loop supply chain (VCLSC) network based on multiperiod, multiproduct and by using the Internet of Things (IoT). The purpose of the paper is the optimization of the VCLSC network.Design/methodology/approachThe proposed model considers the maximization of profit. For this purpose, costs related to virtualization such as security, energy consumption, recall and IoT facilities along with the usual costs of the SC are considered in the model. Due to real-world demand fluctuations, in this model, demand is considered fuzzy. Finally, the problem is solved using the Grey Wolf algorithm and Firefly algorithm. A numerical example and sensitivity analysis on the main parameters of the model are used to describe the importance and applicability of the developed model.FindingsThe findings showed that the Firefly algorithm performed better and identified more profit for the SC in each period. Also, the results of the sensitivity analysis using the IoT in a VCLSC showed that the profit of the virtual supply chain (VSC) is higher compared to not using IoT due to tracking defective parts and identifying reversible products. In proposed model, chain members can help improve chain operations by tracking raw materials and products, delivering products faster and with higher quality to customers, bringing a new level of SC efficiency to industries. As a result, VSCs can be controlled, programmed and optimized remotely over the Internet based on virtual objects rather than direct observation.Originality/valueThere are limited researches on designing and optimizing the VCLSC network. This study is one of the first studies that optimize the VSC networks considering minimization of virtual costs and maximization of profits. In most researches, the theory of VSC and its advantages have been described, while in this research, mathematical optimization and modeling of the VSC have been done, and it has been tried to apply SC virtualization using the IoT. Considering virtual costs in VSC optimization is another originality of this research. Also, considering the uncertainty in the SC brings the issue closer to the real world. In this study, virtualization costs including security, recall and energy consumption in SC optimization are considered.HighlightsInvestigates the role of IoT for virtual supply chain profit optimization and mathematical optimization of virtual closed-loop supply chain (VCLSC) based on multiperiod, multiproduct with emphasis on using the IoT under uncertainty.Considering the most important costs of virtualization of supply chain include: cost of IoT information security, cost of IoT energy consumption, cost of recall the production department, cost of IoT facilities.Selection of the optimal suppliers in each period and determination of the price of each returned product in virtual supply chain.Solving and validating the proposed model with two meta-heuristic algorithms (the Grey Wolf algorithm and Firefly algorithm).