Pitaya (Selenicereus undatus L.), an important tropical plant belonging to the Cactaceae family, is rich in antioxidants, dietary fibers and low in calories. Pitaya shows higher tolerance against abiotic stresses; however, various environmental factors lead to excessive production of reactive oxygen species (ROS) persistently that cause injury to the cells. Under vanadium, drought, and heat conditions, plant cells regulate the expression of ascorbate peroxidase (APX, a vital antioxidant enzyme) genes, which play a significant role in detoxifying ROS by catalyzing hydrogen peroxide. In this study, we have identified 65 APX genes (HuAPX) in the pitaya genome and clustered them into 13 subfamilies. Gene structure and motif analysis revealed that HuAPX genes contained well-preserved intron-exon structure and their motif domains also shared the same order within one cluster. Phytohormones-related cis-acting elements including abscisic acid, gibberellin, jasmonic acid, salicylic acid, and auxin were found in abundance in the promoter regions of the HuAPX genes. RNA-seq-based expression analysis of the HuAPX genes unveiled that few genes showed significantly higher expression under single and multifactorial stress combinations of drought, heat, and vanadium. Exogenous applications of melatonin attenuate the vanadium, heat, and drought effects, thus enhancing the growth and development of the pitaya plant, by inducing the HuAPX gene expression efficiently. Moreover, the expression pattern of HuAPX genes were validated through qRT-PCR analysis. Our findings suggest that three candidate genes (HuAPX1/3/6) may play a key role against abiotic stresses by encoding key enzymes related to glutathione metabolism and phenylpropanoid biosynthesis. These results provide valuable information for organizing a new strategy to design the climate-smart pitaya genotypes through conventional and modern biotechnological tools.