WooCommerce Order & Refund CSV Exports: Turning Messy Reports Into Something Readable
WooCommerce will happily export every order field it has. What it will not do is make that export readable. This is the cleanup and reconciliation workflow I run before sending numbers to anyone who signs off on money.

Virtual Assistant & Data Entry Specialist

The first time a client asked me to reconcile a month of WooCommerce orders against their bank deposits, I downloaded the order export, opened it, and closed it again. There were 47 columns. Two of them were named something about meta data.
The date format was 2026-03-14 09:22:41 in one column and a Unix timestamp in another.
The numbers were all there. They were just arranged in a way that made answering a simple question, "did we actually receive this money," take an entire afternoon.
This piece is about the reshaping work. Not the export itself, which WooCommerce does fine, but the cleanup that turns an export into a report.
I have done this for stores doing forty orders a month and stores doing nine thousand, and the plate of problems is remarkably similar.
What is actually wrong with a default export
WooCommerce exports are designed to be complete, not readable. That is a reasonable design decision and it means the raw file has everything the store knows about an order. It also means the file is hostile to anyone doing arithmetic in it.
One row per line item, not per order
This is the trap that catches everyone. If an order has three products, it becomes three rows. The order total appears on each of those rows, repeated. If you sum the total column you get triple the actual revenue.
I have watched someone send a client a revenue figure that was 40 percent too high because of exactly this. The spreadsheet looked right. The numbers added up. They just added up three times.
Refunds appear as separate negative rows
A refund is not a field on the original order. It is its own row with a negative total and often a parent order reference buried in a column near the right edge.
If you filter to "completed" orders and sum totals, you are counting revenue that was returned to the customer.
Getting this right requires joining the refund row back to its parent, which is the step most exports make unnecessarily hard.
Dates in three formats at once
Depending on which plugin produced the export, you may get a local timestamp, a GMT timestamp, and a MySQL date. Comparing two of them to find the orders that landed near midnight in a different timezone is its own small nightmare.
Pick one. I use the store's local time for anything a human reads and UTC for anything a system processes, and I never mix them in the same column.
Tax, shipping and coupons scattered across columns
Total tax is a column. Shipping is a column. Coupon discount is a column, but only the first coupon; a second stacked coupon may live in metadata.
When you subtract to find the actual product revenue, you need to know exactly which of those columns are already included in the total, and the export does not tell you.
Decide the shape of the report first
Before touching the export, decide what question the report needs to answer. Different questions need different shapes and mixing them is how you end up with a sheet nobody trusts.
| Question | Shape | Grain |
|---|---|---|
| How much did we sell? | One row per order | Order |
| Which products move? | One row per line item | Product × order |
| What do we owe in tax? | One row per order, with tax columns | Order |
| Did the money arrive? | One row per transaction | Payment |
The single most useful thing you can do is build the one-row-per-order version first and use it as the base for everything else. Line-item reports can then link back to it by order ID rather than recomputing totals independently.
When two reports disagree, the order-level one wins, and you know why.
Deduplicating order rows correctly
Since line items repeat the order, the fix is to keep only the distinct order IDs and take the order-level fields from the first occurrence. In a spreadsheet this is a pivot or a UNIQUE on the order ID.
In a script it is a group by.
import pandas as pd
orders = pd.read_csv('orders-export.csv')
# Order-level columns are identical across line items for the same order,
# so taking the first row per order preserves them without double counting.
order_level = (
orders.sort_values('order_id')
.drop_duplicates(subset='order_id', keep='first')
)
print(len(orders), 'rows ->', len(order_level), 'orders')
The count comparison at the end is not decoration. If you started with 412 rows and ended with 137 orders, that is consistent with three line items per order on average.
If you started with 412 rows and ended with 411 orders, something is wrong with your order ID column and you need to look before continuing.
The order ID trap
Order IDs are integers, and spreadsheets love to helpfully convert long numeric strings. If your store uses a plugin that prefixes order numbers, the column becomes text and 00123 sorts differently from 123.
Check the column type before you join anything to it, because a text-versus-number mismatch will produce silent join failures rather than an error.
Reconciling refunds
Refunds need two pieces of information that the export splits apart: the refund amount, and which order it belongs to. Once you have both, net revenue is straightforward.
# Refund rows carry a parent order reference.
refunds = orders[orders['type'] == 'shop_order_refund'].copy()
refunds['refund_amount'] = refunds['total'].astype(float).abs()
refund_totals = (
refunds.groupby('parent_id', as_index=False)['refund_amount']
.sum()
.rename(columns={'parent_id': 'order_id'})
)
reconciled = order_level.merge(refund_totals, on='order_id', how='left')
reconciled['refund_amount'] = reconciled['refund_amount'].fillna(0)
reconciled['net'] = reconciled['total'].astype(float) - reconciled['refund_amount']
Notice that refunds are grouped before merging. A single order can have two partial refunds issued weeks apart, and summing them first means the merge does not fan out into duplicate rows.
That fan-out is a quiet bug: the totals look plausible but the row count is higher than your order count, and any average you compute is now weighted wrong.
Partial refunds and restocking
A partial refund might be money only, or money plus a restocked item, and those two cases have different accounting consequences.
If your export includes a restock flag, capture it in its own column rather than folding it into the amount. Your accountant will ask.
Reconciling against actual money
Order totals are what the store thinks it sold. Payment records are what the processor actually moved. Those two numbers disagree more often than store owners expect, and the disagreements are almost always one of four things.
Processing fees deducted before deposit. Currency conversion spread on international orders. Pending orders that were never captured. Chargebacks that arrived weeks after the order closed.
Build a small table with three columns: order ID, order total, processor net. Anything where the difference is not zero and not explained by a known fee gets flagged for a human.
In a healthy store this list is short, and its length is a useful signal about whether your checkout has problems.
Making the report readable
A readable report has fewer columns than you think and the important ones are on the left. I aim for a maximum of nine visible columns in anything a non-technical person will open.
Column order that matches how people read
Put identity first, then dates, then money. Order ID, customer name, date placed, status, subtotal, tax, shipping, refunds, net. Everything else, the metadata and the notes and the payment gateway transaction reference, goes into a second tab or a hidden block on the right.
This is not aesthetic preference. When a column that matters is twelve columns in, people scroll past it and read the wrong number. I have seen an accountant total the wrong column for this reason.
Number formatting that survives a CSV round trip
Whatever formatting you apply in the spreadsheet dies the moment the file is saved as CSV and reopened.
Plan for the CSV being the source of truth: store amounts as plain numbers with two decimals and no currency symbols, and store currency as its own column if you sell in more than one.
Date columns should be ISO format, 2026-03-14, because that sorts correctly as text and is unambiguous regardless of regional settings. A file with 03/14/2026 in it will be imported as the wrong date by somebody.
Fix the status vocabulary
WooCommerce statuses include the wc- prefix in some exports and not others, and custom order status plugins add their own. Normalize to a small set before reporting: completed, processing, on-hold, cancelled, refunded, failed.
Anything else becomes "other" and gets reviewed, because an unexpected status in a financial report usually means a plugin is doing something nobody documented.
Automating the repeat
If this report happens monthly, build it once as a script and rerun it. The setup cost is roughly three hours and the monthly cost drops to fifteen minutes.
def build_monthly_report(export_path, out_path):
raw = pd.read_csv(export_path)
orders = dedupe_orders(raw)
refunds = summarise_refunds(raw)
report = orders.merge(refunds, on='order_id', how='left')
report = report[REPORT_COLUMNS].sort_values('date_placed')
report.to_csv(out_path, index=False, date_format='%Y-%m-%d')
print(f'{len(report)} orders -> {out_path}')
return report
Keep the function boring and keep the print statement. When the count is off by one month over month, that print is the first place you will look.
Three things I stopped doing
I stopped computing revenue from the line-item export. It is more granular and it invites double counting. Use it for product mix questions, never for totals.
I stopped trusting the dashboard number without a check. WooCommerce analytics is generally reliable but it caches, and a report generated at 09:00 on the first of the month may not include orders that came in overnight. Export fresh, then compare.
I stopped emailing CSV files. A CSV opened from an email attachment in Excel is a different file than the one you sent, because Excel will reinterpret leading zeros and long numbers on open.
Send a link to the file with a specific instruction to import rather than double-click, or send an XLSX with typed columns.
What good looks like
The end state is a file where someone can filter by month, see one row per order, and read the net figure without opening another tab.
It should be obvious where refunds were subtracted, and the order count in the header should match the row count in the body.
When you get there, the reconciliation conversation with an accountant takes about ten minutes instead of a full day of back-and-forth about which total is the real one. That is the actual return on this work.
Not the automation, the ending of a recurring argument about numbers.
Official docs and related reporting guides
Review the official WooCommerce Managing Orders guide alongside the pandas drop_duplicates reference before automating monthly close exports.
If you also clean raw product feeds or design monthly close workbooks, read our executive inventory KPI dashboard guide and reusable CSV templates.
Frequently Asked Questions
Common operational inquiries related to WooCommerce Order & Refund CSV Exports: Turning Messy Reports Into Something Readable
Need High-Volume WooCommerce or Shopify Catalog Migration?
Eliminate broken variation CSVs and mismatched attributes. Schedule a free 15-minute call to review SKU counts, taxonomy structure, and bulk import timelines.

Written by Wp Hossain (Mikail Hossain)
Senior Catalog & E-Commerce Specialist with 7+ years handling multi-thousand-SKU WooCommerce, Shopify, and supplier CSV migrations (4.9/5 across 82 Fiverr reviews).