How to calculate profit per product on Shopify
Calculate Shopify profit per product from units still sold, net sales, refunds, snapshotted cost, card fees, and shipping. A missing cost stays blank.
Revenue and the payout are not product profit
Shopify will tell you revenue, discounts, shipping charged, and a payout. None of those is the profit on one product. Revenue still includes orders you later refunded. A payout mixes every SKU with tax, the shipping the customer paid, and the fee that was already taken. Divide that payout by units and a cheap add-on can look as healthy as the item that paid for the label.
Profit per product starts from the line item. You count the units that stayed sold, keep the money those units brought in, and subtract only the costs that belong to them: the cost of the goods, the card fee, and the shipping you bought. Tax you collected and then remitted is not profit, and it is not a product cost either. Leave it out of both sides.
Do this in shop currency. A presentment amount, the currency the customer paid in, is not converted. Converting it would invent a profit you did not collect.
Count the units that stayed
Start with the quantity on the line. Subtract units removed by a refund or by an order edit. What remains is units sold. A voided or expired order never enters the count. An edit that removes a line is not a refund. Those units were not sold, so they should not sit in the sold column and they should not carry a refund amount.
This is the quantity you reorder against. A partial refund reduces the units and the refund column. It does not rewrite the original unit price.
Keep net sales and refunds apart
Net sales are the unit price times the units that stayed, minus discounts allocated to that line. Include discounts that were applied to the whole order and then shared onto the line. Do not fold refunds into this number. A refund is money you returned. It belongs in its own column so you can see whether the problem was the price or the return.
If you mash discounts and refunds into one net figure, a deliberate discount looks the same as a return. Those need different decisions. Separate columns keep the cause attached.
Use the cost from the day you sold it
Cost of goods is the unit cost on the inventory item when the order was imported, multiplied by units that did not come back into stock. If the customer returned the unit and you restocked it, that unit drops out of cost. You have the item again. If the refund was not restocked, the unit is gone and the cost stays. You paid for something you cannot sell.
A later supplier increase does not rewrite that snapshot. The earlier order keeps the earlier cost. The next order picks up the new one. Put freight and duty into the unit cost you store if you want them included. A report cannot invent a landed cost you never entered.
An explicit zero is a real cost, for a digital file or a sample you truly give away. A blank cost is not zero. If the inventory item had no cost, profit for that SKU stays blank. Treating the blank as zero makes an unknown product look like pure profit, which is how a sticker sheet gets reordered before anyone knows what it cost.
Give the card fee a home
The payment fee is usually a percent of what the order still collected, including tax and shipping, plus a fixed fee once on any order that collected money. An order that collected nothing does not get the fixed fee. The fee is an order cost. To see it per product, split it across the lines by the product revenue those lines kept after discounts and refunds.
A gift card is not a product row. Its share of the fee stays with the products on the same order. An order that sold only a gift card has a fee and nowhere to put it, so leave that fee unallocated instead of inventing a SKU. A fee per unit on a variant, or else on the product, replaces that line’s share of the shop rule.
Shipping cost is not shipping charged
Shipping charged to the customer is not the same number as the label you bought. One is money in. The other is a cost. A flat label cost belongs on orders that had something to ship, then splits across the shippable units. A digital line does not take a share of the label. A percent rule uses the shipping you still charged after shipping refunds.
If every shippable unit was refunded and you still use a flat shop rule, a label you already bought can remain. A per-unit shipping amount on a variant, or else on the product, replaces that line’s share instead of stacking on top of the shop rule.
Net profit, margin, and a worked example
Net profit is net sales, minus refunds, minus cost of goods, minus payment fees, minus shipping cost. Margin is that profit divided by net sales minus refunds. If nothing is left after refunds, margin is blank. If any cost is missing, profit and margin are blank. A total across the table should also stay blank when any visible SKU is missing a cost. Otherwise the total hides the hole by adding a number that was never known.
The sample report on this site runs that formula. The grey wool blanket shows $38.00 of net sales, $39.00 of cost, $1.40 of card fees, and $2.16 of shipping. Net profit is -$4.56. It sold, and it still lost money. The ceramic mug, with an older cost on one order and a higher cost on the next, shows $25.80 of profit without blending those costs into one average. The canvas tote kept 2 units sold, $22.00 refunded, and $15.00 of cost on the units that were not restocked, for $20.66 of profit. The sticker sheet has $32.00 of net sales and no unit cost, so its profit is blank.
A voided checkout is ignored. An order that was stored only in another currency is left out instead of converted. You can open the same rows on the sample report. The columns are units, net sales, refunds, cost, payment fees, shipping cost, net profit, and margin.
What to change once the number exists
A losing SKU is a price, discount, cost, or shipping problem, not a traffic problem. Raise the price, retire the automatic discount, or change the supplier before you buy more. A missing cost is a data problem. Fill it before you judge the product. Sort by profit, not by units. A best-seller list will not show the blanket.
Rebuilding the split in a spreadsheet is how the fee allocation drifts. MarginLine does it inside Shopify on the orders it imports: cost snapshotted on the line, fees and shipping allocated, refunds in their own column, and a flag when a SKU lost money or never had a cost. The sample report uses the same formula. It is not a full profit and loss.
Get MarginLine on the Shopify App Store