How do I record buying inventory and turning it into cost of goods sold when it sells?
Applies to: United States · Updated 2026-10-03
Post goods bought for resale, including inbound freight, to an inventory asset account, not an expense. Cost moves to cost of goods sold only when the goods sell. A perpetual system posts a second entry at each sale, debiting cost of goods sold and crediting inventory. A periodic system posts one period-end adjustment based on opening inventory, purchases and closing inventory. Then check that the change in inventory equals purchases minus cost of goods sold.
Why does a purchase of stock go to an asset instead of an expense?
Inventory means goods waiting to be sold to customers. It is recorded and reported on the balance sheet at cost. When an item sells, its cost comes out of inventory and is reported on the income statement as cost of goods sold. Cost of goods sold is an expense caused by the sale. Under the accrual basis, matching an expense to revenue does not depend on the date you pay.
So one purchase produces two events at two different times:
- When you buy, you exchange cash, or a promise to pay, for an asset.
- When you sell, you record the revenue, and the cost of the goods sold becomes an expense in that same period.
Paying the supplier has no effect on cost of goods sold.
This flow covers only goods you hold for resale. Supplies you use up in running the business, such as office packing tape or cleaning products, never enter inventory, even when they appear on the same supplier invoice as stock. Split that invoice when you enter it. Whether your business has to track inventory at all is a separate question, linked under Related questions.
What belongs in the cost of the goods?
Cost includes every cost needed to get the goods in place and ready for sale. In practice:
- Include the supplier's price for the goods, plus inbound shipping that you pay, transit insurance on the shipment, and any taxes or duties on the purchase that you are responsible for.
Apply the same treatment to every purchase. If inbound freight goes to inventory on one bill and to a general shipping expense on the next, you can't compare your inventory balance or gross margin from one period to the next. Which costing convention sets unit cost when prices change is a separate question.
Which of the two methods do your books use to move cost into cost of goods sold?
Your inventory system decides what you post and when.
| Perpetual (cost moved at each sale) | Periodic (cost worked out at period end) | |
|---|---|---|
| Purchase is debited to | Inventory | Purchases |
| At each sale | Two entries: revenue, then cost | Revenue entry only |
| Cost of goods sold | A ledger account debited at each sale | Calculated and posted at period end |
| What you need | A unit cost for every item sold | Opening inventory, purchases, closing inventory |
In a perpetual system, the inventory account goes up with each purchase and down with each sale, so its balance should equal the cost of the goods on hand. In a periodic system, you close the Purchases accounts at period end and adjust the inventory account to the cost of the goods actually on hand. Cost of goods sold is then worked out as opening inventory, plus purchases net of returns and allowances, plus freight-in, minus closing inventory.
What are the entries for one lot, from purchase to sale?
Here is one lot, traced with made-up numbers. The inventory account opens the month at 300.00 from earlier stock. A shop buys 100 mugs at 6.00 each on credit and pays a carrier 40.00 in cash for inbound freight. The landed cost is 640.00, or 6.40 per mug. Later it sells 30 mugs for cash at 15.00 each and pays 8.00 to ship them to the customer.
1. Receive the goods and the freight bill
| Account | Debit | Credit |
|---|---|---|
| Inventory | 640.00 | |
| Accounts Payable | 600.00 | |
| Cash | 40.00 |
When you pay the supplier later, the payment doesn't touch inventory or cost of goods sold.
2. Pay the supplier
| Account | Debit | Credit |
|---|---|---|
| Accounts Payable | 600.00 | |
| Cash | 600.00 |
In a perpetual system, a sale takes two entries. The first debits Cash or Accounts Receivable and credits Sales for the selling price. The second debits Cost of Goods Sold and credits Inventory for the cost. Keep the two separate: revenue is recorded at the selling price, and the cost entry uses what the goods cost you.
3. Sell 30 mugs: revenue side, at the selling price
| Account | Debit | Credit |
|---|---|---|
| Cash | 450.00 | |
| Sales | 450.00 |
4. Sell 30 mugs: cost side, 30 × 6.40
| Account | Debit | Credit |
|---|---|---|
| Cost of Goods Sold | 192.00 | |
| Inventory | 192.00 |
5. Ship to the customer
The cost definition above covers getting goods in place and ready for sale and says nothing about shipping them to a customer; this example records that shipping as a delivery expense, so confirm the treatment with your accountant.
| Account | Debit | Credit |
|---|---|---|
| Delivery Expense | 8.00 | |
| Cash | 8.00 |
After these entries the inventory account stands at 748.00: the 300.00 it opened with, plus 448.00 for the 70 mugs left from this lot at 6.40 each. Cost of goods sold is 192.00 and gross profit on the sale is 258.00.
The same month under a periodic system. The purchase goes to Purchases instead: 600.00, with the 40.00 of freight in Freight-in. Step 4 doesn't happen at the time of sale. Inventory opened the month at 300.00, as above, and the goods on hand at month end are valued at 748.00. Cost of goods sold is 300.00 + 640.00 − 748.00 = 192.00, and the period-end entry is:
| Account | Debit | Credit |
|---|---|---|
| Cost of Goods Sold | 192.00 | |
| Inventory (748.00 − 300.00) | 448.00 | |
| Purchases | 600.00 | |
| Freight-in | 40.00 |
The closing value comes from counting what's on hand and pricing it under your costing convention. How to run and document that count is a separate question.
What does the software post for you, and what do you enter yourself?
QuickBooks Online is one example. Inventory tracking there requires the Plus or Advanced plan, and you must turn on inventory tracking before you add inventory products. Each inventory product record holds an inventory asset account, an income account, an expense account (Cost of Goods Sold), a purchase cost, and a starting quantity with an as-of date. The Inventory Asset account tracks the value of the inventory you own.
Once that's set up, a purchase of a tracked item debits the Inventory Asset account and credits your bank, credit card or Accounts Payable account. Cost of goods sold is debited only when you sell inventory items on invoices or sales receipts, and the Inventory Asset account is credited at the same time. The amount moved is the items sold at the item's average cost, which that platform computes as the total cost of the items in inventory divided by the total number of items; that is the convention it applies, and choosing a convention is a separate question.
You still enter these yourself:
- Purchases and freight bills, with each amount split correctly between stock and supplies.
- Freight that belongs in unit cost, entered against the item records. Item-level relief moves only what sits in each item's cost, so a carrier bill posted straight to the inventory asset account raises that balance without ever reaching cost of goods sold; either add it to the items' cost or relieve it yourself.
- Any cost the software can't see. For goods you track without inventory items, record each purchase to an inventory asset account. Then post a journal entry that debits cost of goods sold and credits the inventory asset for the original cost of what you sold, never the selling price.
- The periodic adjusting entry shown above, if your books don't move cost at each sale. It's a manual journal entry dated at period end.
When sales arrive as daily or payout totals. A deposit that records only a sales channel's summarized total carries no item detail. QuickBooks Online moves cost only when you sell inventory items on invoices or sales receipts, so it posts no cost of goods sold for those sales. You can either record the sales with their items, so cost moves automatically, or post the cost-side journal entry yourself from the channel's item sales report for the same period. Pick one method for each period, never both.
Don't mix the two methods. If you expense purchases straight to cost of goods sold and also post a period-end inventory adjustment, the same cost is counted twice. The reverse mistake is recording sales with no cost entry. The books still balance, but inventory stays inflated and margin looks too high.
Cash-basis reporting. The cost still moves to cost of goods sold when the goods sell; the sale is what triggers it. Under the accrual basis, matching that cost to the revenue does not depend on the date you pay the supplier, so step 2 never touches cost of goods sold. In QuickBooks Online, if goods are received now and paid for later, cash-basis reports may show wrong quantity on hand, cost of goods sold and inventory asset values, depending on the report dates. To see the correct gross profit on the Profit and Loss report, you have to change its accounting method to accrual.
How do you prove at month end that inventory and cost of goods sold tie out?
Cost of goods sold plus closing inventory should equal the cost of goods available for sale. Goods available means opening inventory plus the net cost of purchases, including freight-in. Here is that check for a perpetual ledger, using the example figures:
| Line | Amount | Where to get it |
|---|---|---|
| Opening inventory | 300.00 | Inventory account balance at the start of the period |
| Plus goods bought for resale, with freight-in, less discounts and returns | 640.00 | Supplier bills for stock, checked against the debits to inventory |
| Less cost of goods sold | 192.00 | Cost of goods sold account for the period |
| Expected closing inventory | 748.00 | Calculated |
| Inventory account balance at period end | 748.00 | General ledger |
| Difference | 0.00 | Should be zero |
A difference of zero does not prove that each sale relieved cost exactly once. A sale recorded with no cost entry leaves out both the cost of goods sold debit and the inventory credit, and a cost relieved twice puts both in twice, so either way the table still nets to zero. Three further checks cover that gap:
- Missing cost entries. Compare the period's cost of goods sold with units sold times unit cost, taken from your sales report or the sales channel's item report. Sales that reach the books as summarized payouts, with no item detail, are one way this happens.
- Doubled cost entries. Compare the inventory account balance with a count or valuation of what is actually on hand. If the software relieved cost and a manual journal entry relieved it again, the ledger reads lower than the goods on the shelf.
- The ledger ties and a count disagrees. Rule out a posting gap first, by confirming that every sale of stock carried one cost entry and that none carried two. Only what is left after that is physical, and shrinkage, damage and count differences are separate questions.
In a periodic system, the same table checks the period-end entry. The credits to Purchases and Freight-in should equal the period's bills for stock. The debit to cost of goods sold should equal opening inventory plus purchases minus the counted closing value.
Sources
- AccountingCoach, LLC — Inventory and Cost of Goods Sold: In-Depth Explanation with Examples, Copyright 2026
- Intuit QuickBooks — Inventory assets and Cost of Goods Sold tracking, updated 8/5/2026
- Intuit QuickBooks — Add inventory products in QuickBooks Online, undated
- Intuit QuickBooks — Track inventory manually, updated 8/4/2026
- Intuit QuickBooks — Impacts of inventory tracking on the Balance Sheet and Profit & Loss reports in QuickBooks Online, updated 8/5/2026