You have to be 21 to buy ammunition for a handgun. Do you not have a carbine capable of shooting the same round? My local gun store knows that the common pistol rounds are also common carbine rounds.
It is not illegal to buy ammo for your carbine and then use it in your pistol.
It is stupid, but it is the law.