Fact: It is legal to purchase a firearm online. However that is where it ends. By federal law, the online dealer cannot ship the purchase to the buyer.
Federal law mandates that the firearm be shipped to a Federally Licensed (FFL) dealer in the state where the buyer resides. The FFL conducts Federal and State background checks and performs any waiting period requirements.
Contrary to what many want you to believe there is no Online loophole to bypass the legal requirements for purchasing a firearm.