This research explores the legal protection of consumers in electronic transactions in the digital era with a focus on the balance between consumer rights and obligations and the role of artificial intelligence (AI) technology. The main issue discussed is the legal protection of consumers in electronic transactions in the digital era. The research uses a qualitative approach with literature studies from relevant sources such as books, journals, and legal documents. The research found that AI can enhance consumer protection through applications such as chatbots and smart logistics, although there are challenges related to privacy and transparency. The implications of these findings suggest the need for proper regulation in the application of AI to protect consumers.