Cost of goods sold (COGS) is the direct cost attributable to the products sold in a period — typically the purchase or production cost of that stock. Revenue minus COGS gives gross profit, the clearest measure of trading margin.
Accurate COGS depends on a sound stock valuation method such as FIFO or weighted average; without it, reported margins are only estimates.