COGS, or cost of goods sold, is what the products you sold actually cost you. For an ecommerce store that is not the price on the supplier invoice: it is the landed cost, meaning the supplier price plus freight, duties, customs fees and the packaging you need before a unit can leave your warehouse. If you use the invoice price alone, every margin you calculate is too high.
Getting COGS right matters because it feeds everything else: gross margin, break-even ROAS, profit per order and the decision of which products to push with ads. An error of one or two per unit looks small until you multiply it by every order you ship.
What goes into COGS and what does not
Accounting rules differ by country and your accountant has the final word on your statutory books. For managing a store day to day, a practical split looks like this.
Include in COGS (landed cost)
- Supplier price of the goods, in your currency at the rate you actually paid.
- Inbound freight from the supplier to your warehouse or 3PL, plus freight insurance.
- Customs duties and tariffs.
- Customs broker or clearance fees, and fixed import charges.
- Inbound handling: unloading and receiving at the warehouse.
- Packaging that is part of the product: box, label, insert, protective sleeve.
Keep out of COGS (track separately)
- Import VAT or GST, if you can reclaim it (more on this below).
- Shipping to the customer and outbound packaging such as mailer boxes, if you prefer to track them per order.
- Payment processing fees, ad spend, apps and salaries.
Shipping to the customer and payment fees are still real, variable costs. Keeping them as separate lines, instead of hiding them inside COGS, lets you see which one is moving when margin drops. Together they take you from gross margin to contribution margin.
The landed cost formula
landed cost of a batch = goods + freight + insurance + duties + broker fees + inbound handling + packaging landed cost per unit = landed cost of the batch / units received COGS for a period = units sold x landed cost per unit
Costs that are paid once per shipment, such as freight or the broker fee, have to be spread over the units in that shipment. The simplest method is to divide by units. If one shipment mixes heavy and light products, allocate freight by weight or volume instead, so the bulky item carries its fair share.
Worked example: one import batch
A hypothetical store imports 500 units of one product at 6.00 each. The duty rate and VAT rate below are illustrative only; look up the real rate for your product's tariff code and your country.
| Cost line | Calculation | Amount |
|---|---|---|
| Goods | 500 x 6.00 | 3,000.00 |
| Inbound freight and insurance | invoice | 450.00 |
| Customs duty (4% illustrative) | (3,000 + 450) x 4% | 138.00 |
| Customs broker fee | invoice | 75.00 |
| Inbound handling at warehouse | invoice | 60.00 |
| Product packaging | 500 x 0.40 | 200.00 |
| Landed cost of the batch | sum | 3,923.00 |
| Landed cost per unit | 3,923 / 500 | 7.85 |
Line by line: 3,000 + 450 + 138 + 75 + 60 + 200 = 3,923, and 3,923 / 500 = 7.846, which rounds to 7.85. The supplier price was 6.00, so the real cost per unit is about 31% higher than the invoice suggests (1.85 / 6.00 = 0.308).
What that does to the margin
Say the product sells for 29.00 including 21% VAT. The net price you keep is 29.00 / 1.21 = 23.97.
with the supplier price: 23.97 - 6.00 = 17.97 gross profit -> 17.97 / 23.97 = 75.0% margin with the landed cost: 23.97 - 7.85 = 16.12 gross profit -> 16.12 / 23.97 = 67.3% margin difference over the batch: 3,923 - 3,000 = 923
Almost eight points of margin disappear once the real costs are in. That gap flows straight into your break-even ROAS: the lower your margin, the higher the ROAS you need before ads stop losing money.
Import VAT: cash flow, not COGS
When goods enter a country with VAT or GST, such as the EU or the UK, you usually pay import VAT at the border. In the example, at an illustrative 21% charged on goods, freight and duty, that would be (3,450 + 138) x 21% = 753.48. The exact taxable base depends on local rules.
For a business registered for VAT, import VAT is normally reclaimable: you deduct it in your VAT return, so it comes back to you. That is why it should not be added to COGS. It does, however, leave your bank account weeks before you recover it, so plan for it as working capital. If you are not VAT-registered, or you cannot recover it for some reason, then it is a real cost and does belong in landed cost. Customs duties are different: they are not reclaimed, so they always count.
Loading COGS into Shopify
Shopify lets you store a Cost per item on each product variant, in the pricing section of the product editor. Shopify uses that figure in its profit reports and margin calculations. Three practical rules:
- Enter the landed cost per unit, not the supplier price. In the example that means 7.85, not 6.00.
- Set it per variant. Sizes or colours that ship in different boxes or pay different duties can have different costs.
- Keep a record of when costs change. Shopify keeps one current value per variant, so changing it does not rewrite the cost of past orders the way you might expect in every report.
When a new batch costs more
Freight rates and exchange rates move, so the next batch rarely costs the same. A common approach is the weighted average. Suppose 200 units of the first batch remain at 7.85 and a new batch of 300 units lands at 8.40 per unit:
weighted average = (200 x 7.85 + 300 x 8.40) / (200 + 300) = (1,570 + 2,520) / 500 = 4,090 / 500 = 8.18 per unit
Update the Cost per item to 8.18 when the new stock arrives. The alternative, FIFO, uses 7.85 until the old units run out and then switches to 8.40. Either is fine for management purposes if you apply it consistently; ask your accountant which one your statutory books use.
COGS for dropshipping and print on demand
Without your own stock the calculation is simpler but easy to understate. Your COGS per order is what the supplier charges you for that order: product price, the supplier's shipping to the customer, and any per-order fees for packing, branding inserts or currency conversion. Because the supplier ships directly, you can treat their shipping charge as part of the product cost or as a separate shipping line. Pick one and stay consistent.
If your supplier invoices in another currency, use the amount that actually left your account, including the conversion margin your bank or card charged, not the headline price in the supplier's catalogue.
Common COGS mistakes
- Using the first quote from the supplier and never updating it after freight, duty or the exchange rate changed.
- Forgetting samples, defective units and stock you had to write off. If 10 out of 500 units are unsellable, the other 490 carry their cost.
- Adding recoverable import VAT to COGS and then wondering why margins look worse than the bank account.
- Leaving the Cost per item field empty for some variants, which makes those products look like pure profit in any report.
Once landed cost is correct per variant, the rest of the profit picture gets much easier. ProfitFly reads your Shopify costs, lets you override them per country where shipping or duties differ, and applies them to every order so margin and POAS come out of real numbers.
Frequently asked questions
Is shipping part of COGS?
Inbound freight to your warehouse is part of landed cost and belongs in COGS. Shipping to the customer is usually tracked as a separate variable cost per order, though some stores include it. What matters is applying one rule consistently.
Should I include import VAT in COGS?
Usually not, if your business is VAT-registered and can reclaim it, because you get it back. If you cannot recover it, it is a real cost and belongs in landed cost. Confirm with your accountant.
Where do I enter COGS in Shopify?
In each product variant, in the Cost per item field under pricing. Enter the landed cost per unit, not just the supplier price.
How often should I update product costs?
Whenever a new batch arrives at a different cost, or when freight, duties or the exchange rate change enough to move your margin. For most stores that means checking with every purchase order.