MerchantFlowMerchantFlow Docs
Profit & Loss

Importing COGS - CSV, BeProfit, and Store Cost Sync

Bulk import product costs into MerchantFlow with CSV files, BeProfit exports, Shopify or WooCommerce cost sync, and supplier invoice imports with landed cost calculation.

Importing COGS

COGS imports get product costs into MerchantFlow at scale instead of typing them one variant at a time. There are four import paths: a generic CSV, a BeProfit export for merchants migrating from that tool, a one-click cost sync from your connected Shopify or WooCommerce store, and a supplier invoice import that calculates landed costs from a PDF or photo. This guide covers exactly what each path accepts, how existing entries are protected, and which path to use when.

Quick router: store costs already maintained in Shopify or WooCommerce - use the store sync; a supplier price list in a spreadsheet - use CSV; migrating from BeProfit - use the BeProfit tab; a supplier invoice with freight and duty - use the invoice import.

How to Access

Navigate to Dashboard > P&L > COGS and click the "Import" button. The Bulk Import COGS modal opens with four tabs: CSV, BeProfit, Shopify, and WooCommerce. The platform tabs are only enabled when that platform is connected, and the modal opens on your connected platform's tab automatically.

CSV Import

Upload any CSV that contains a SKU column and a cost column. Header names are case-insensitive.

Supported Columns

FieldAccepted headersNotes
SKUskuRequired. No aliases - the header must be exactly sku
Unit costcost, cogs, unit_cost, cost_per_itemThe product cost per unit
Per-unit fulfillment ratefulfillment_cost, fulfilment_cost, fulfillment, fulfilmentOnly used with the Per product fulfillment method
Destination countrycountry_code, country, destination_country, ship_countryWrites a country fulfillment rate override
Quantity tier floormin_quantity, min_qty, quantity_tier, tier_qtyOptional, for country-rate quantity tiers

A file with sku, country_code, and fulfillment_cost but no cost column is valid - it imports country rates only. A single row can also update both COGS and a country rate at once.

Not supported in the CSV:

  • No handling cost column - handling can only be imported through the BeProfit tab (below)
  • No effective date column - imported entries always take effect today. To backdate or schedule costs, use the Bulk Update flow instead - see COGS Accuracy
  • No currency column - all values are read in your store currency
  • No variant column - rows match by SKU, so variants that share a SKU cannot receive different costs via CSV

Replace Existing COGS History

The CSV tab includes a "Replace existing COGS history" checkbox: it deletes all existing COGS entries before importing, for when you have updated every cost upstream and want a clean slate.

Note: Replacing history is destructive and cannot be undone. Historical P&L is recalculated against the new cost basis. MerchantFlow asks for a second confirmation - the button changes to "Confirm: delete {n} & import" - before anything is deleted. Leave the checkbox off for normal imports.

BeProfit Import

Migrating from BeProfit? Upload the CSV exported from BeProfit's Product Costs page on the BeProfit tab.

  • Products are matched by Shopify product ID first, falling back to SKU for rows without one - keep BeProfit's product_ID column in the export for the most reliable matching.
  • Columns are auto-detected, including cost aliases (cost, cost_per_item, cogs, unit_cost, cost_per_unit, product_cost) and handling cost aliases (handling_cost, handling, shipping_cost).
  • If no cost column is detected, you can point the importer at the right column manually.
  • Duplicate rows for the same product are collapsed (the first occurrence wins) and rows with a cost of 0 or less are excluded.
  • Imported entries are stored with the CSV source badge.
  • The tab has the same "Replace existing COGS history" checkbox and two-click confirmation as the CSV tab.

Note: The BeProfit import is currently the only way to load per-unit handling costs into MerchantFlow. Handling is folded into the COGS line of your P&L - see COGS Accuracy for the details and for a warning about manual edits resetting handling to zero.

Shopify and WooCommerce Cost Sync

The platform tabs pull costs straight from your store:

  • Shopify reads each variant's "Cost per item" field. Variants with a blank or zero cost are skipped - set those in Shopify first, or type them in on the COGS page.
  • WooCommerce reads each product's cost meta the same way.

Two modes:

  • "Fill in missing costs" (default) - only adds costs that are missing or already came from your store. It never overwrites costs you set manually in MerchantFlow.
  • "Replace all costs with my store values" - overwrites everything, including manual entries, with the store's current costs. This is the destructive option and requires the same two-click confirmation as the CSV replace.

Scope: by default only live products sync. Tick "Include drafts and archived" to also load costs for draft and archived products.

Automatic sync: besides the manual button, MerchantFlow re-syncs store costs after every product sync. The automatic sync always runs in fill-in mode, so your manual entries are never clobbered automatically - they are only replaced when you explicitly choose "Replace all costs with my store values".

Supplier Invoice Import

On plans that include it, MerchantFlow can read a supplier invoice and turn it into per-unit landed costs. Open the "Import from a supplier invoice" card at the top of the import modal.

The wizard has four steps:

  1. Upload - PDF, PNG, JPG, or WEBP up to 8 MB; several invoices at once is fine. Files are read once and deleted straight away - they are never stored or used for training.
  2. Review - check the extracted supplier, invoice number, date, currency, and line items. Mark each line as "Product cost", "Spread across products", or "Not a product cost", and review invoice-level charges such as freight, duty, tax, inspection, or brokerage.
  3. Match - confirm which product each line belongs to, choose how freight and duty are shared out (by line value, units, or weight), and set the exchange rate if the invoice is not in your store currency.
  4. Confirm - see current cost vs new landed cost per product, pick the "Costs apply from" date, and choose a write mode:
    • "From this date onwards" - past profit figures untouched (the right choice in almost every case)
    • "Replace all cost history" - applies the cost to every order, past and present
    • "Blend with stock on hand" - averages the new cost with your existing stock, weighted by the units you still hold

Every import is listed on the Invoice imports history page, where you can continue a draft, view what was written, or Undo an applied import - undoing restores the previous costs and recalculates profit. Entries written this way carry an invoice-import source badge on the COGS page. Invoice imports have a monthly cap by plan; entering costs by hand stays unlimited.

Understanding Import Results

After an import or sync, MerchantFlow reports exactly what happened, for example:

  • "Imported {n} costs." - new entries written
  • "{n} costs were kept as your manual entries - choose "Replace all costs" to overwrite them." - those SKUs have manual entries, which always take precedence over imported ones
  • "{n} variants were skipped - no cost set in your store yet." - fix the costs in Shopify or WooCommerce, or set them on the COGS page

The "kept as your manual entries" rule is part of MerchantFlow's source precedence: a manual entry always beats an auto-synced one, even a newer one. See COGS Accuracy for the full precedence model.

Best Practices

1. Store Sync for the Baseline, CSV for Supplier Price Lists

Keep costs in your store platform where possible and let the automatic sync maintain them. Use CSV when your source of truth is a supplier spreadsheet.

2. Treat "Replace" Options as Migration-Only

Both replace modes delete or overwrite history. Use them when starting fresh or migrating tools - never for routine updates.

3. Run the BeProfit Import Once, at Migration

Bring costs and handling over in one pass, then maintain them in MerchantFlow. Re-running it later can overwrite refinements you made since.

4. Fix Duplicate SKUs Before Importing

CSV rows match by SKU. If several variants share one SKU, they will all receive the same cost - give variants unique SKUs first for per-variant accuracy. See COGS Accuracy.

Troubleshooting

Rows were skipped during CSV import

Cause: Missing or blank sku values, a missing required column, or invalid country/quantity values on country-rate rows. Solution: Check the error message for the failing row numbers, fix the file, and re-upload. The header must include sku plus either a cost column or the country_code and fulfillment_cost pair.

The import finished but some products did not change

Cause: Those SKUs have manual entries, which imports never overwrite in fill-in mode. Solution: This is by design. If you genuinely want store values to win, choose "Replace all costs with my store values" - understanding that it overwrites your manual work.

Shopify sync imported 0 costs

Cause: No variants have "Cost per item" filled in Shopify. Solution: In Shopify admin, open each product's variants and enter the cost, then sync again - or set costs directly on the COGS page.

Handling costs disappeared after editing a product's cost

Cause: Manual cost edits write a fresh entry with handling reset to zero. Solution: Re-import handling via the BeProfit tab after bulk edits, or account for handling inside the unit cost instead. See COGS Accuracy.

Frequently Asked Questions

Can I set an effective date in the CSV?

No. CSV imports always take effect today. To backdate a change or schedule a future one, use the Bulk Update or Schedule Price Change flows on the COGS page - see COGS Accuracy.

Can I import costs in a different currency?

No. All imported values are read in your store currency. Convert supplier pricing before importing - the only exception is the invoice import, which asks for an exchange rate when the invoice currency differs.

Will the automatic store sync overwrite my manual costs?

Never. The automatic sync runs in fill-in mode only. Manual entries are only replaced when you explicitly choose "Replace all costs with my store values" in the import modal.

Is my uploaded invoice stored anywhere?

No. Invoice files are read once to extract the line items and deleted straight away - they are not stored, logged, or used for training.

How many invoice imports do I get?

Invoice imports are capped per month depending on your plan; the wizard shows your usage. Manual cost entry is always unlimited.

Can one CSV contain only country fulfillment rates?

Yes. A file with sku, country_code, and fulfillment_cost columns (optionally min_quantity) imports country rates without touching COGS. See Country Fulfillment Rates.

Related Guides


Last updated: July 31, 2026