Note that there is no direct Airasia flight from PEK to MEL, but there is a connecting one via KUL. Not that it makes a difference.
You might run into major problems if your flight to PEK is delayed, as in that case you would miss your connecting flight and therefore your qualification for visa-free transit.
Another issue is to convince the gate agent in Toronto to let you check-in/board. Have details (ideally boarding pass already) of your AirAsia flight ready and printed out to show and guide them to the relevant Timatic pages if in doubt. I wrote about this issue here and here, read that. In summary, it is fine, but have the evidence with you.
Otherwise you should be fine as stated in the answer by @AliAwan you qualify for 24h visa-free transit, and beyond that you also qualify for the 72h visa-free transit – however in your case that does not make much of a difference, with this little time at hand I would not leave the airport, and I’d only go through immigration if I were to meet someone landside.
Will I need a visa or can I use the visa free transit?
Yes as an US citizen, you are entitled for a free transit in China
for up to 24 hours since you have a confirmed onward ticket to
Melbourne (Australia) and without entering the country (i.e. clearing
immigration).
According to Visa And Passport
National USA (US) /Embarkation Canada (CA) Transit China
(People’s Rep.) (CN) Destination Australia (AU) ALSO CHECK
DESTINATION INFORMATION BELOWChina (People’s Rep.) (CN)
TWOV (Transit Without Visa): Visa required, except for Holders of
confirmed onward air, cruise or train tickets for a max. transit For
details, click here time of 24 hours. Transit incl. multiple stops
within China(People’s Rep.), with a total transit time of max. 24 hours,is
permitted. They must travel to a third country.
Also if you wish to go outside airport for sightseeing, you may apply for a temporary stay permit upon arrival
Source: 24 hour Direct Transit china
Under the 24-hour visa-free transit rule, no visa is required for
international flight, ship, or train passengers who transit directly
through mainland China and will stay for less than 24 hours. This
policy is applicable to almost all nationalities. Passengers should
hold tickets to a third country or region and have a confirmed seat.In case that they want to leave the port for city sightseeing or transfer to another port during the 24 hours, they can apply for a
Temporary Stay Permit upon arrival. Those who transfer in more than
one city of China within 24 hours can also enjoy this policy. For
instance, if one’s trip is Los Angeles – Beijing – Shanghai – Bangkok
and the total time in China is less than 24 hours, the passenger can
still enjoy the 24-hour direct transit.
Also wikipedia confirms the same that you can get 24 Hour transit visa at Beijing airport:
The 24-hour transit rule allows multiple stops within Mainland China,
as long as the traveler has a flight segment leaving Mainland China in
24 hours, so it’s possible to enter through a port of entry in China,
take multiple segments of domestic flights within China, and depart
from a different port of entry in under 24 hours. Contrary to the
transit rules of other countries, all travelers in transit are
required to go through immigration and customs even if they do not
intend to leave the airport, except for passengers arriving and
departing from Beijing Capital International Airport where they can
proceed directly to the sterile transit area without immigration
checks.Leaving the transit area is allowed even for passengers who only have
one transit point within Mainland China, however they must also depart
China within 24 hours.
Credit:stackoverflow.com‘
4 Mar, 2024
4 Mar, 2024
5 Mar, 2024