This study describes the development of an electroanalytical methodology using square-wave voltammetry (SWV) to quantify benzoylecgonine (BE) in synthetic urine samples using a boron-doped diamond electrode. Due to the oxidation of the tertiary amine present in the tropane group, it was possible to observe an irreversible oxidation process, with a maximum oxidation peak around + 2.10 V, in an acidic medium. Initially, the design of experiments (DoE) was applied to optimize the SWV parameters using a central composite design. All DoE analyses occur in a solution of H2SO4 0.5 mol L-1 as a supporting electrolyte and a fixed concentration of 0.20 mmol L-1 of BE; the optimal parameters found were 6.023 mV for step potential, 87.045 mV for modulation amplitude, and 30.795 Hz for frequency. Performance characteristics were obtained after constructing the analytical curve, including a limit of detection of 1.20 mu mol L-1, and a limit of quantification of 4.0 mu mol L-1 within a linear working range from 4.93 to 154.20 mu mol L-1, and a R2 of 99.76%. BE analysis was performed on a solution containing different proportions of synthetic urine and H2SO4, specifically 9:1, 6:4, and 3:7 (v/v) of acid and synthetic urine, respectively. Nevertheless, it was not possible to conduct a standard recovery test in ratios higher than 9:1 (v/v) of urine to acid due to a lack of response. In conclusion, this methodology offers a reliable approach for determining BE, an important analyte in forensic chemistry, and the DoE allows a comprehensive analysis of the performance parameters of the technique used.