Most store owners know their revenue to the dollar and their profit only roughly. The admin dashboard shows sales by day, the accounting software shows profit weeks after the month closes and in between the picture is guesswork. Yet decisions are made daily: whether to run a discount, how much to spend on ads, which products to push, which to drop. Without an honest view of margin, those decisions drift, and stores can grow steadily while quietly losing money on the very orders they are proudest of.
This guide explains how to calculate the true margin of an order, a product and a channel. It lists every cost that belongs in the calculation, shows a worked example, explains where the data hides, and describes how to automate a daily profit view with a margin floor. It builds on the bookkeeping structure in Shopify QuickBooks integration options, because clean books and clean margins depend on the same discipline, and on the refund handling in refund rules to automate. It is general information, not accounting advice.
Revenue, gross profit, contribution margin and net profit
| Measure | What it includes | Use it for |
|---|---|---|
| Revenue | What customers paid, before anything is deducted | Growth tracking only |
| Gross profit | Revenue minus the cost of goods sold | A first look at product margin |
| Contribution margin | Revenue minus all variable costs of the order: goods, shipping, fees, packaging, returns, discounts and acquisition | Daily decisions on products, ads, discounts and channels |
| Operating profit | Contribution margin minus fixed overheads such as salaries, software and rent | Whether the business is sustainable |
| Net profit | Operating profit after tax and interest | What the owner keeps |
Contribution margin is the most useful number for day-to-day work because it is the part of each sale that is left to pay for fixed costs and to make a profit. A product with a positive gross margin and a negative contribution margin loses money every time it sells; ordinary reports often miss this.
Every cost that belongs in the order
| Cost | Where it hides | How to capture it |
|---|---|---|
| Product cost (COGS) | Supplier invoices, landed cost including freight and duty | A cost field per product or variant, kept up to date |
| Shipping you pay | Carrier invoices, labels, a shipping tool | Cost per shipment matched to the order |
| Shipping the customer pays | Order total | Counted as revenue, not an offset to cost |
| Payment processing | Processor reports and payouts | Fee per order from payout data |
| Packaging and handling | Warehouse or your own time | A per-order estimate by size or weight |
| Discounts and promotions | Order discount fields | Already reduce revenue; track the code and campaign |
| Returns and refunds | Refund records, return shipping, write-offs | Allocate to the original order and product |
| Advertising | Ad platforms | Spend by channel, matched to orders by campaign or modelled |
| Marketplace and platform fees | Settlement reports | Per order or per payout |
A worked example, order by order
Take an order for a candle set sold through your store for sixty-four dollars including a four-dollar shipping charge, with a ten percent discount code applied to the goods. Here is the calculation, with illustrative costs.
| Line | Amount | Note |
|---|---|---|
| Goods at list price | $60.00 | Before discount |
| Discount code (10 percent of goods) | -$6.00 | A cost of marketing |
| Shipping charged | +$4.00 | Revenue |
| Order revenue | $58.00 | What the customer paid |
| Product cost (landed) | -$21.00 | From supplier invoice and freight |
| Shipping paid to the carrier | -$7.50 | Label cost |
| Payment fees | -$2.05 | A typical card fee structure |
| Packaging | -$1.20 | Box, filler and label |
| Allowance for returns (average) | -$2.40 | Expected refunds and returns across all orders |
| Advertising to earn the order | -$14.00 | Customer acquisition cost for this channel |
| Contribution margin | $9.85 | About 17 percent of revenue |
Illustrative figures. The point is the shape: revenue of $58 turns into under $10 of contribution after variable costs.
Notice how the story changes with each line. The gross margin on goods looks healthy: sixty dollars of goods at a twenty-one dollar cost. By the time shipping, fees, returns and advertising are counted, less than a fifth of revenue remains. A second order from the same customer, with no advertising cost, might earn $23 of contribution. This is why repeat purchase and retention often matter more than the headline conversion rate.
Measure at three levels
| Level | Question it answers | Typical finding |
|---|---|---|
| Order | Which individual orders lose money? | Heavily discounted orders, orders with expensive shipping, first orders with high ad cost |
| Product | Which products earn their space? | A best seller with thin margin; a slow product that earns a lot |
| Channel | Where does profit actually come from? | A marketplace with high fees; paid social with weak returns |
| Customer cohort | Do customers pay back their acquisition cost? | Cohorts from one campaign repay slowly, others quickly |
Averages are dangerous. A store can have a healthy average margin while a third of its products lose money, subsidised by a few that earn a lot. Only a breakdown reveals the cross-subsidy, and the decision it suggests, such as raising prices, dropping or bundling the losers, is often the cheapest profit improvement available.
Where the data hides, and how to find it
- Cost prices. The most important and most often missing field. If a product has no cost, every profit report involving it is wrong. Fill costs for every variant, and update them when suppliers change.
- Shipping costs. Carrier invoices arrive in bulk and are rarely matched to orders. A shipping tool can record the label cost per order; otherwise estimate by weight and zone.
- Payment fees. Processors report fees by payout and by transaction. Match them to orders.
- Refunds and returns. Allocate each to the original order or product, including the cost of return shipping and write-offs.
- Advertising. Platforms report spend and attributed sales that overlap; use blended measures such as total ad spend against total new-customer revenue as a check.
- Marketplace fees. Settlement reports list fees by order or by period; map them.
Automate a daily profit view
A report built once by hand is stale next week. The robust approach is a small automation that collects orders, costs, fees and spend each day, calculates contribution margin per order, product and channel, and delivers a short summary with exceptions. It should highlight products below a margin floor and orders that lost money, with the reasons.
| Component | What it does | Notes |
|---|---|---|
| Order feed | Pulls paid orders with items, discounts and shipping charged | From the store, by webhook plus a catch-up |
| Cost table | Holds product cost, packaging and handling assumptions | Reviewed monthly; changes dated |
| Fee matching | Attaches processor and marketplace fees to orders | From payout and settlement data |
| Shipping costs | Attaches label costs | From the shipping tool or carrier data |
| Ad spend | Adds spend by channel and campaign | Allocated to orders by a stated rule |
| Margin engine | Calculates contribution margin and flags exceptions | With a margin floor per product group |
| Digest | Sends a daily or weekly summary | Top and bottom products, losing orders, trend |
Our AI sales reporting and finance, risk and reporting automation services build this view from your own data, and payout reconciliation and bookkeeping supplies the fee and refund detail that makes it accurate. If you sell on marketplaces, the Amazon-focused AI for Amazon sales and eBay-focused AI for eBay sales services start from a profit view.
Margin floors and what to do when a product falls below them
A margin floor is the lowest contribution margin you will accept for a product or order. It turns the report into a decision rule. Below the floor, the options are few: raise the price, cut the cost, change the shipping offer, reduce discounts, stop advertising it or drop it. Decide the response in advance, so that a report leads to action rather than to a worried look.
- Set floors by group, not one for everything; a premium line can carry a higher floor than a loss leader.
- Treat deliberate loss leaders as marketing, with a budget and a measured effect on repeat purchase.
- Review discount policy. Stackable codes and free shipping thresholds often cause the worst orders.
- Check price changes by margin, not only by conversion. A price rise that costs a few orders may raise profit.
- Look at bundles. Pairing a thin-margin item with a high-margin one can lift the order’s contribution.
A short checklist to start this week
- Export products and fill in missing cost prices; start with the top fifty sellers.
- Download a month of orders, payouts and shipping costs.
- Calculate contribution margin for each order using the table above.
- Rank products by total contribution, not by revenue.
- List the ten products or channels with the lowest margins and decide an action for each.
- Write down the margin floors and review them monthly.
- When the manual process proves its value, automate it.
Sources and further reading
Figures and rules in this guide come from the primary pages below. Platform limits and prices change, so open the page before you build on a number.
- Shopify Help Center: reports, sales and profit-related reports in Shopify
- Stripe documentation: payouts and fees, how fees appear in payouts
- IRS: small business and self-employed tax center, general US guidance on business income and costs