OBJECTIVE To provide reference for the closed-loop management of externally purchased medications for inpatients in medical institutions in Shenzhen, thus improve the overall level of pharmaceutical affairs management in medical institutions in Shenzhen. METHODS The relevant guidelines, expert consensus, thematic reviews and policy documents were conducted using keywords such as “ externally purchased drugs”“externally distributed drugs”“externally purchased prescriptions” “externally distributed prescriptions”“closed-loop management” and their corresponding English terms. The initial draft of the Consensus on Closed-loop Management of Externally Purchased Medications for Inpatients in Shenzhen Medical Institutions (shortened for Consensus) was drafted based on the practical experience of the management of externally purchased drugs in medical institutions in Shenzhen. After two questionnaire surveys and four expert symposiums, the Consensus recommendation opinions were formed. RESULTS & CONCLUSION The Consensus covers 10 aspects, including the definition and usage conditions of externally purchased drugs, management organization and informatization construction, principles for catalogue adjustment, catalogue formulation process, prescription issuance and dispensing, return-to-hospital acceptance process, hospital use process and safety management, home pharmaceutical services, supervision and management, as well as principles for prescription dispensing in retail pharmacies and selection of retail pharmacies. It contributes to the improvement of the management of externally purchased medications in medical institution in Shenzhen.