Ammunition is a term given to three different consumable items: Round Shot, Flintlock Ammunition, and Bolts.
Round Shot is the ammunition used in all types of cannons, and can be either crafted (5 round shot for 5 iron) or bought the Loyalty Merchant or General Merchant NPCs. The Loyalty Merchant offers 20 round shot for 1 loyalty token, and the general merchant offers 20 round shot for 1,000 doubloons.
Flintlock Ammunition is only obtainable via trade with other players or crafting, being crafted with 8 iron and 3 gunpowder for 10 rounds. It is used in the Musket, Long Musket, Flintlock Pistol, and Officer's Pistol.