COGS = Beginning Inventory + Purchases − Ending Inventory
Cost of goods sold (COGS) is the direct cost of the products you sold during a period: what you paid to make or buy them and get them to your warehouse, ready to sell. It excludes the indirect costs of running your business, like marketing and rent.
On paper, the cost of goods sold formula is simple. It takes just one line.
For a growing DTC brand, the hard part is the inputs: landed costs that change with every shipment, stock spread across 3PLs and stores, and returns that need to flow back into your books.
This guide covers how to calculate COGS, what to include, and how to keep the number accurate across Shopify and QuickBooks.
**What you'll learn: **
-
What’s included in COGS for DTC brands
-
Periodic vs. perpetual inventory: how each changes your COGS calculation
-
Why COGS drifts between Shopify and QuickBooks
-
How to optimize COGS
-
COGS FAQs
What’s Included in COGS for DTC Brands
COGS includes costs to make or buy a product and get it ready to sell. It does not include the indirect costs of running your business or actually selling the product once it’s ready to go.
If you’re wondering about a certain cost, follow this rule of thumb: If the cost brings the product to its sellable condition and location, it’s COGS. If it happens to sell or deliver the product after that point, it isn’t.
[TABLE IMAGE]
There are a few gray areas that don’t fall neatly into either column:
-
3PL pick-and-pack fees: These are fulfillment costs that happen after the product is ready to sell. Inbound receiving fees at the 3PL are different. They can count as landed costs.
-
Outbound shipping and mailers: These costs are part of delivery to the customer. Often, DTC brands designate these as “cost of sales” to see true per-order margin.
-
Payment processing fees: Usually a selling expense, but some brands roll them into a fully loaded margin.
-
Returns processing: Labor and shipping on returns are operating costs. A restocked item’s COGS is reversed back into inventory. Damaged items get written off.
Gray-area costs are why many DTC brands track two numbers instead of one — COGS for the official number on the books, and COGS plus fulfillment, shipping, and payment fees to price, run promos, and judge channel profitability.
Neither number is wrong. But when a cost lands in one bucket one month and the other the next, things get messy fast.
Decide where each gray-area cost belongs, confirm that policy with your accountant, and apply it the same way every period.
Periodic vs. Perpetual Inventory: How Each Changes Your COGS Calculation
In a periodic inventory system, you only update your COGS calculation at specific intervals. Periodic can work for very small brands with simple stock.
Perpetual inventory updates COGS in real time after each sale. It becomes the standard once inventory moves across channels, 3PLs, or stores.
Both systems give the same total over time. The difference is when you know your COGS and how much detail you get.
Here’s what one month of a DTC jewelry brand’s bestselling necklace might look like, using FIFO costing. (First-In, First-Out costing assumes the oldest inventory items are sold first, assigning older costs to COGS. This is different from weighted average, which combines all available inventory costs into one rate.)
-
Beginning inventory: 1,000 units x $20 = $20,000
-
Purchases: 1,500 units x $22 landed cost = $33,000
-
Units sold: 1,600
-
End-of-month count: 880 units (20 lost or damaged)
Periodic Inventory System Example
COGS is calculated just once, after a physical count at the end of the period.
-
Ending inventory: 880 x $22: $19,360
-
COGS = $20,000 + $33,000 - $19,360 = $33,640
Because the oldest units sell first, the 880 left on the shelf are all $22 stock.
The 20 missing units are folded into COGS with no record. You don’t know your margin until the end of the month.
Perpetual Inventory System Example
COGS is recorded with each sale. The first 1,000 units sold come from the $20 stock. The next 600 come from the $22 stock.
-
1,000 x $20 + 600 x $22 = $33,200
-
The system expects 900 units ($19,800) but the count finds 880, so a $440 shrinkage adjustment is recorded separately
The total is the same ($33,640), but you see margin as sales happen, and the $440 shows up as its own line. You can investigate that amount (a 3PL miscount, damaged returns, theft) instead of having it hide inside COGS.
Under weighted average, each unit costs $53,000 ÷ 2,500 = $21.20, so the 1,600 units sold cost $33,920, compared to $33,200 under FIFO. When costs rise, FIFO shows lower COGS and higher profit because older, cheaper units are expensed first.
Many Shopify brands track units perpetually, but correct COGS periodically in QuickBooks. That gap is where drift begins.
Why COGS Drifts Between Shopify and QuickBooks
Drift rarely comes from using the wrong formula. It comes from two systems working with different cost data.
You’ll typically see one of the following five causes:
-
Shopify’s cost per item doesn’t update when landed costs change. Shopify stores one cost per variant. That cost only changes when somebody edits it. So if the necklace’s latest batch landed at $22, but the field still says $20, every sale is under-costed by $2. Fixing the field later isn’t going to correct past orders.
-
Shopify and QuickBooks calculate cost differently. QuickBooks uses FIFO by default and builds cost from your purchase history. Shopify, on the other hand, multiplies the number in its cost field by the units sold. Even if you’re carefully maintaining both systems, their totals are going to separate over time.
-
Connectors post summarized journal entries. Many Shopify-QuickBooks connectors post an entry per day or per payout instead of per order. Your books are clean, but when COGS gets off, there’s no order-level paper trail to follow back to the source.
-
Returns, bundles, and personalization need data flowing both ways. A restocked return goes back into Shopify inventory, but its COGS might not reverse in QuickBooks. Bundles sell as one SKU while the books need to draw down each component. Personalization options can multiply SKUs that each need their own cost. Most connector setups only move data one direction.
-
Inventory moves between warehouses, 3PLs, and stores. Each transfer is a chance for one system to record the move before the other, or not at all. Every location you add means adding more omnichannel orders and counts to keep aligned.
None of this means QuickBooks is broken. QuickBooks is a strong accounting software, but it wasn’t designed to be the operational source of truth for inventory and costs. That’s usually the point when brands start outgrowing QuickBooks. At that stage, another connector won’t help.
You need a single source of truth that sits upstream of both systems.
Tailor’s inventory management system tracks stock in real time across warehouses, 3PLs, and stores. Its cost accounting module allocates landed costs with custom rules, and syncs financial data to QuickBooks. As a headless ERP, Tailor sits underneath the tools you already use. Shopify keeps selling, QuickBooks keeps the books, and both work from the same cost data.
See how Tailor’s cost accounting module keeps COGS accurate from purchase order to QuickBooks.
How to Optimize COGS
You can only optimize COGS you can trust. That’s why accuracy comes first — then margin. These five habits make your COGS number reliable and then show you where to bring it down.
-
Track landed cost on every purchase order. Since freight, duties, and tariffs change with each shipment, a single average cost hides which suppliers, routes, or order sizes are cut into margin. Tailor allocates landed costs with custom rules so every unit carries true cost into supplier negotiations and freight planning.
-
Move to perpetual tracking with regular cycle counts. Counting a rotating set of SKUs each week catches shrinkage while it’s still small and fixable. It also keeps gaps visible (like the necklace’s $440) inside of staying hidden inside COGS.
-
Use bills of materials for personalized and bundled products. A bill of materials lists the components and labor that go into a finished product. Costing a personalized necklace from its chain, pendant, and engraving time means you don’t need a separate SKU for every option. Tailor’s BOM-aware inventory handles multi-level components and personalization without SKU bloat.
-
Review margin by SKU and channel. A product can be profitable on your website, yet lose money in wholesale or in-store once fulfillment is factored in. Use your fully loaded margin and ERP reporting to decide what to reprice, promote, or retire.
-
Reconcile continuously, not just at month-end. Matching Shopify, your 3PL, and QuickBooks as transactions happen means small discrepancies get fixed before they escalate. Continuous reconciliation turns month-end into a confirmation instead of an investigation.
Making Sense of COGS in Your Retail Business: Frequently Asked Questions
Is COGS an Expense?
Yes. It appears on the income statement as an expense, but above gross profit and separate from operating expenses.
Is COGS a Debit or Credit?
COGS is a debit. When you make a sale, that sale debits COGS and credits inventory.
What’s the Difference Between COGS and Operating Expenses?
COGS covers only direct product costs (such as materials and assembly labor). Operating expenses are the costs of running a business.
How Do You Calculate COGS in Shopify?
Shopify calculates COGS by multiplying each variant’s cost per item by the number of units sold. To use it, enter a cost per item for every product variant. Shopify then records that cost at the time of each sale and shows the results in its profit reports. It won’t reflect landed cost changes unless someone updates it.
From Formula to Source of Truth
Whether it’s a $2 gap in a necklace’s cost or $440 in missing units, small input errors are what make COGS drift. The formula itself never changes.
When cost and inventory data live in one shared source of truth, your COGS calculation stays reliable and your margins become something you can act on instead of something you double-check.
See how the Tailor platform brings it all together, or book a demo to try it with your own data.