How To Pull COGS, Fees, And Fulfilment Costs From Shopify For The Calculator

A step-by-step walkthrough of the three Shopify exports (and Woo/Magento equivalents) that feed a gross margin calculator with real unit cost, payment fees, and fulfilment cost — not guesses.
Quick answer
Three exports cover it. (1) Products → Export → CSV gives you the per-variant Cost per item field for COGS. (2) Finances → Payouts → Export gives you Shopify Payments fees, refunds, and chargebacks per transaction. (3) Your 3PL (ShipStation, ShipBob) exports per-order fulfilment cost — Shopify itself doesn't store it. Join all three on order ID or SKU before feeding the margin calculator.
Pulling Shopify COGS, fees, and fulfilment costs into a margin calculator
The operational process of exporting unit cost, payment fees, and 3PL fulfilment cost from Shopify (and joined systems) so a gross margin calculation reflects real per-order economics.
Shopify stores each cost input in a different place, and none of them roll up into a single margin report by default. Unit cost lives on the product variant. Payment processing fees live in the Payouts ledger. Fulfilment cost usually lives entirely outside Shopify, in your 3PL or shipping app. To feed a gross margin calculator with numbers you actually trust, you export each source separately, normalise to order or SKU level, and join them. The alternative — assuming a flat 30% COGS and 2.9% fee — is what makes calculators lie to you by 4-8 percentage points of margin.
This page assumes you're feeding a gross margin calculator that expects three numeric inputs per order: unit cost, payment fee, and fulfilment cost. If your calculator only accepts a blended COGS %, you're leaving margin visibility on the table — swap it before continuing.
The workflow below is for a Shopify store on Shopify Payments with a third-party 3PL. If you self-fulfil or use Shop Pay Installments, two of the steps change; those variants are called out inline.
Step 1 — Pull unit cost (COGS) from the product export
In Shopify admin go to Products → All products → Export → Current page or All products, format CSV for Excel. The resulting file has one row per variant and includes the column Variant Cost — that's the value entered in the Cost per item field on each variant.
If Variant Cost is empty for most SKUs, you have the same problem 70% of Shopify stores have: the field was never filled after import. Bulk-populate it via the Inventory CSV route or Matrixify before you trust any margin report. The mechanics of that fix are covered in the companion page on where unit cost lives in Shopify.
Cost per item ≠ landed cost
Shopify's Cost per item field holds one number. It doesn't decompose supplier price, inbound freight, duties, and handling. If you sell apparel imported from Portugal or beauty SKUs from Korea, your true landed cost is typically 15-35% higher than the invoiced unit price. Add duties and freight to the field before export, or maintain a separate landed-cost sheet and join on SKU.
Step 2 — Pull Shopify Payments fees from the payout export
Go to Finances → Payouts → Transactions → Export. Choose a date range and select "Transactions" (not "Payouts") — that gives you one row per charge, refund, adjustment, and chargeback, with the Fee column filled in.
The export includes Order ID, which is your join key back to the order and back to the product export via line items. Sum Fee grouped by Order ID to get the total processing cost per order — a €78 order might carry a €2.15 fee, not the flat 2.9% you'd guess.
If you accept PayPal, Klarna, or Shop Pay Installments alongside Shopify Payments, those fees are NOT in this export. Pull them from each processor separately and union on Order ID. Missing this step is the second-biggest source of margin overstatement after empty Cost per item fields.
Step 3 — Benchmark your pulled numbers before trusting them
Typical per-order cost ranges for European Shopify stores (AOV €40-€120)
| Vertical | COGS as % of revenue | Payment fee % | 3PL fulfilment / order |
|---|---|---|---|
| Apparel & accessories | 28-38% | 1.9-2.4% | €3.50-€6.80 |
| Beauty & personal care | 18-28% | 1.9-2.4% | €3.20-€5.90 |
| Home & lifestyle | 35-48% | 1.9-2.4% | €4.50-€9.20 |
| Consumer electronics | 55-72% | 1.9-2.4% | €5.80-€11.00 |
| Food & supplements | 22-35% | 1.9-2.4% | €4.00-€7.50 |
If your pulled fulfilment cost lands outside these ranges by more than 30%, check whether returns, packaging surcharges, or dimensional weight uplifts are missing from the 3PL export. Beauty SKUs shipping in oversized branded boxes often carry a 40% dim-weight surcharge that doesn't show up on the base rate card.
Step 4 — Pull per-order fulfilment cost from your 3PL
Shopify does not store what your 3PL charges you. In ShipStation, use Reports → Shipping Cost by Order — that CSV has Order Number and Total Charges. In ShipBob, use the Billing → Order Storage & Fulfillment Cost export, which breaks out pick, pack, and postage separately.
Join the 3PL export to the Shopify Payments export on Order ID (ShipStation's Order Number maps to Shopify's Name field, usually formatted #1234). At this point you have one row per order with revenue, unit cost via SKU lookup, payment fee, and fulfilment cost — the four numbers your gross margin calculator needs.
WooCommerce and Magento equivalents
WooCommerce has no native cost field. You either install the Cost of Goods plugin (adds _wc_cog_cost postmeta) or maintain unit cost in a separate SKU sheet. Payment fees are in the Stripe or PayPal dashboard, not Woo — the Woo order only stores the gross. The full WooCommerce workflow is walked through in its own page.
Adobe Commerce (Magento 2) does have a native Cost field on the product, accessible via Catalog → Products → Advanced Pricing. Order-level fees require the payment method's transaction report and Magento's Sales → Orders export joined on Increment ID. Details in the Magento equivalent walkthrough.
Edge cases: refunds, bundles, and partial fulfilment
Refunds don't return the Shopify Payments fee (Shopify keeps the processing fee on refunded orders as of 2024). A €78 refunded order still cost you €2.15 in fees plus the fulfilment cost of the outbound shipment. Reconciling this against original order margin is covered in its own operational page.
Bundles are the other trap: Shopify sees one line item, but the component COGS live on 3-8 different variants. Roll them up via the bundle app's manifest or a maintained SKU-to-components mapping before feeding the calculator, otherwise bundle margin looks 40-60% better than it really is.
Frequently asked questions
On each product variant page, under Pricing, below the Compare-at price. It's also editable in bulk via Products → Export → CSV (Variant Cost column) or via the Inventory bulk editor. If you don't see the field, you're on a variant that inherits from a template — edit the parent variant.
Only on the Shopify plan and above, and only if Cost per item is populated for every variant sold in the period. The Gross Profit report in Analytics uses that field directly and does NOT include payment fees or fulfilment cost — it's cost-of-goods margin only, so it overstates true contribution margin by 4-8 points.
Export Finances → Payouts → Transactions (not Payouts) and select a date range. The Transactions export has one row per charge with Order ID and Fee columns. Sum Fee grouped by Order ID for per-order processing cost. Payout-level exports aggregate too coarsely for margin work.
They're not in the Shopify Payments export. Pull PayPal fees from the PayPal Activity Download (Balance Affecting Only), Klarna from the Klarna Merchant Portal settlement report, and Shop Pay Installments fees appear in the standard Shopify Payments export because Shopify processes the merchant side. Union all sources on Order ID.
Shopify only stores what the customer paid for shipping, not what you paid the 3PL to fulfil the order. Those are two different numbers — customers might pay €4.90 flat rate while the 3PL charges you €6.20 for pick, pack, and postage on the same order. Always pull fulfilment cost from the 3PL directly.
The join key is the Shopify order name (e.g. #1234), which ShipStation exposes as Order Number and ShipBob as Reference ID. If your 3PL uses its own internal order ID, request the field mapping or pull it from the fulfilment webhook data — Shopify's Order ID is a numeric internal ID, not the customer-visible #1234.
Yes, if you want true landed cost margin. The Cost per item field holds one number, so you either bake landed cost into it (invoiced price + inbound freight + duties + handling, divided by units) or maintain a separate landed-cost sheet joined on SKU. Invoiced-price-only understates COGS by 15-35% for imported goods.
A refund reverses the revenue and returns the merchandise (usually), but Shopify Payments keeps the original processing fee, and the outbound fulfilment cost is already spent. Full-refunded orders should show negative margin in your calculator equal to fee plus fulfilment. Partial refunds need pro-rata handling — see the refund reconciliation page.
Yes — Shopify's Admin API exposes variant cost, order line items, and transaction fees; ShipStation and ShipBob both have order-level cost APIs. A margin platform (including Metricuno's Shopify integration) can ingest all three continuously and expose per-order contribution margin without the CSV dance. CSV export is the manual audit path.
In order: (1) Cost per item coverage — every SKU sold in the period must have a non-zero value. (2) Payment fee total — divide by revenue, it should land between 1.9% and 2.4% for a European Shopify Payments store. (3) Fulfilment cost per order — compare against the benchmark table above by vertical. Anomalies in these three catch 90% of data-pull errors.
Start tracking the metric that matters
Free for 30 days. No credit card. Connect your site in 4 minutes and see the one metric driving revenue.