BigCommerce margin and product performance explorer
Pick a date range and see units sold, revenue, cost and gross margin for every SKU, with a category rollup and one click export to a spreadsheet.
Build me a BigCommerce margin and product performance explorer: an app I open whenever I need a number my store admin refuses to give me. The centrepiece is a report builder where I choose a date range and a grouping, apply several filters at once, and get a table of units sold, revenue, cost of goods and gross margin for every SKU.
Across the top, show a store wide summary tile row for the current filter set: total units sold, total revenue, total cost of goods, total gross margin, and margin percentage. Underneath that, the report builder controls: a date range picker, a grouping selector with day, week, month and quarter options, and filters for SKU, product name, category and order status. All filters must apply at the same time, since filtering by SKU and time period together, or by order status and product keyword together, is exactly what the native reporting cannot do.
The main table is one row per SKU per grouping bucket, with columns for period, SKU, product name, category, units sold, revenue, cost of goods and gross margin, plus margin percentage. Give me a second view that rolls the same numbers up by category so I can see gross profit by product line. Let me toggle between units and revenue as the primary sort, and default to units, because I usually care about units for fulfilment and stock planning rather than income.
For the data: handlers should read order history with BigCommerce Get All Orders, scoped by the selected date range and order status, then call List Order Products for each order to get line level SKU, quantity and sale price. Join that against Get All Products to pick up cost_price and product name, and Get All Categories to resolve the category rollup. Use Get All Order Statuses to populate the status filter from the store's real statuses rather than a hardcoded list, and Get a Catalog Summary if you want a cheap catalog wide count for context, such as how many catalogue SKUs actually sold in the period.
Compute margin at the line level as (sale price minus cost price) times quantity, then aggregate up into the SKU row, the period bucket, the category rollup and the summary tiles. Exclude refunded and cancelled orders by default, but keep order status as a filter I can change. Any SKU with no cost price set must be clearly flagged in the table, ideally with a warning icon and a count in the summary row, because a missing cost price silently breaks the margin math and makes profit look better than it is. Do not treat a missing cost as zero cost in the totals: keep those SKUs visible with units and revenue intact, and make clear their margin is unknown.
Add an Export button that pushes whatever view I am currently looking at, meaning the current filters, grouping and sort, into Google Sheets. Use Create Spreadsheet to make a new sheet named for the report and date range, then Append Values to write a header row and the data rows. Show me the resulting spreadsheet link when it finishes so I can hand it to my accountant.
Some API details worth baking in. BigCommerce V2 order endpoints return bare arrays with no pagination envelope, and return 204 No Content when there are no results, so page until an empty response rather than reading a total. V3 catalog endpoints wrap results in a data and meta envelope with meta.pagination, so page using meta.pagination.total_pages. Maximum page limit is 250 on both, so use that to keep the number of round trips down. Money values come back as decimal strings such as "12.50" rather than integer cents, so parse them before doing any arithmetic. Fetching line items per order can mean a lot of calls on a wide date range, so batch and cache the product and category lookups rather than refetching them per order, and show a loading state that makes progress visible on longer ranges.
What does this prompt do?
- Builds the product report your store admin will not give you: units sold, revenue, cost of goods and gross margin for every SKU, over any date range you choose
- Groups results by day, week, month or quarter, and lets you filter by SKU, product name, category and order status all at the same time
- Rolls the same numbers up by category and shows a store wide summary across the top, so you can see profit by product line without touching a spreadsheet formula
- Flags any SKU that has no cost price saved, because those quietly drag your margin numbers off without any warning
- Exports whatever view you are looking at into a new Google Sheet, ready to hand to your accountant
What do I need to use this?
- A BigCommerce store login, with permission to read orders and products
- Cost prices filled in on your products in BigCommerce, since that is what the margin math is based on
- A Google account, if you want the export to spreadsheet button
How can I customize it?
- Change which order statuses are left out by default, if you count refunded or cancelled orders differently
- Switch the default sort between units sold and revenue, depending on whether you are planning stock or reviewing income
- Adjust the default date range and grouping the report opens on, so your most common question is one click away
FAQs
Do I need cost prices set up in BigCommerce for this to work?
Can I filter by product and date range at the same time?
Are refunded and cancelled orders included in the numbers?
Can I see units sold instead of revenue?
How do I get the numbers to my accountant?
How far back can I run a report?
Related templates
Stop buying stale lists. Reps run a saved search, work the results like an inbox, and only the accounts they approve ever reach your CRM.
Drag creators through Sourced to Wrapped on a board grouped by campaign, with audience stats on every card and a one-click brief for each creator.
Pick a repricing rule, send an assistant out to check competitor pages, then approve the new prices that clear your margin floor.
See the projected bounce rate for any outbound send before it goes out, and keep the launch button locked until the list is clean enough to be safe.
Pick any date range and see what each device in your home actually cost to run, not just how many kilowatt-hours it used.
Search three months of global coverage on your topic, rank the outlets actually writing about it, and draft a tailored pitch for each one.
Stop exporting CSVs just to find one number.
Build the margin and units report your BigCommerce dashboard refuses to give you, and send it straight to a spreadsheet when someone asks for it.