You should apply for an AVE at least 2 days before arriving in Canada, in case the authorities decide to carry out in-depth checks on your file. Ideally, we advise our travellers to wait for their AVE before confirming their flight booking.. In the meantime, there's nothing to stop them putting in an option on how to get to Canada. Don't be impatient: while most applications are accepted in a matter of minutes, others can take several days to be processed at random.
In the event of refusal (very few applications are concerned), you would then have to apply for a traditional visa in your passport, and submit your application to the embassy.