Ajax and Onana will appeal to the Court of Arbitration for Sport (CAS) to overturn the ban, imposed after an out-of-competition test in October 2020 found the substance Furosemide in the player's urine.
The club said the test result was due to Onana, 24, mistakenly taking Lasimac – a drug prescribed to his wife – when he felt unwell.
UEFA therefore accepted Onana "had no intention of cheating", an Ajax statement read.
It added: "However, UEFA believes, on the basis of the applicable anti-doping rules, that an athlete has a duty at all times to ensure that no banned substances enter the body."
The suspension is effective from Friday and applies to "all football activities, both national and international".
Ajax managing director Edwin van der Sar said: "We explicitly renounce performance-enhancing drugs, we obviously stand for a clean sport".