DEV Community

ammara aamer
ammara aamer

Posted on

How I Export Orders from WooCommerce Every Month Without Losing a Refund

Every month, someone asks for the same thing: export the orders, add the refunds, and make sure the total matches the bank. When you need to export orders from WooCommerce for the first time, that request looks like a five-minute job. It rarely stays five minutes.

Here is the routine I would use today, step by step. It starts with the built-in export, moves into line items and refunds, and ends with a spreadsheet you can check. Along the way I point out the settings that change your numbers without warning. If the routine starts to feel fragile, automating order fulfillment in Business Central is where a different approach may serve you better.

The first steps cover the built-in tools, which are enough for many stores. If you find yourself handling ecommerce automation for WooCommerce tasks by hand every week, that is a signal worth paying attention to. Multi-store setups and repeated corrections are the other warning signs, and I cover both near the end, along with a link to a closer look at when a WooCommerce store needs an ERP.

Start With the Question the Export Must Answer

Before you touch any settings, write down what the file is for. An accountant closing the books needs totals by period. A fulfillment lead needs a list of products to pack. A store owner comparing months needs consistent summaries. Each of these calls for a different export, and mixing them is the root of most messy month-ends.

I keep a short note at the top of each file with three things: the purpose, the date range, and the date basis. It takes a minute to write and saves an hour of detective work later. If someone opens the file six weeks from now, the note tells them exactly what they are looking at.

Step 1: Decide Which Date Basis to Use

Analytics needs to know which date to use when placing an order in a period. The setting is called Date Type, and the default is Date Paid. That default suits some stores, but not every accounting method.

Here is the trap. An order placed on the last day of the month and paid the following morning will appear in the next month under the paid date setting. If your accountant recognizes revenue on the order date, your two reports will disagree, and the gap will look like a missing sale. The sale is not missing. It just belongs to a different month under the rule you chose.

Agree the basis with your accountant before you export, and set it in Analytics. The Taxes report follows the same setting, so if tax totals and order totals drift apart, check whether they share a basis for the same period.

Step 2: Check Which Statuses Count

Statuses are the second place where a report drifts without warning. Analytics excludes pending payment, cancelled, and failed orders by default, and includes processing, on hold, and completed orders. That is a sensible starting point, but it may not match your business.

Custom statuses are included by default unless you exclude them. A status like awaiting wholesale approval or pending a backorder can inflate totals with orders that are not yet real sales. The refunded status cannot be excluded at all, so plan for refunds to appear in every report.

I suggest a checklist line that reads “statuses reviewed on [date].” Any change to the excluded statuses should go into the same note, because a quarter where the setting changed halfway through is very hard to explain later.

Step 3: Run the Analytics Export

Go to WooCommerce, open Analytics, and choose Orders. Select your date range, apply filters, and use the Download link at the top right of the table. The CSV download in WooCommerce Analytics explains how the table, date picker, and downloads work, and it is worth reading once before your first monthly run.

Plan for size. If the report spans more than one page of the table, WooCommerce runs the export in the background and emails a link to the WordPress account that requested it. That link lasts one week and can be reused in that time. Schedule the export early in the month-end process, not at the last minute.

If your store still shows the older Reports screens, the legacy WooCommerce Reports export follows a similar logic, but it has limits. WooCommerce deprecated these with version 4.0 in March 2020, and the Customer List and stock reports cannot be exported. Use the legacy screens for reference while you move your routine to Analytics.

Step 4: Add Line Items Only When Someone Needs Them

The Analytics summary tells you what sold. It does not tell you which products were inside each order or which variations shipped. Your fulfillment team may need that detail, and some accountants want it for cost of goods sold.

The reliable source is the orders endpoint in the WooCommerce REST API. It lives under /wp-json/wc/v3/, and each order includes its line items. You create API keys in WooCommerce settings and use them to authenticate. You can filter by date and status. A developer can script the pull, or a plugin can write the same data to CSV with one row per line item.

My advice is to pull line items only when a named person needs them, and to keep that file separate from the order summary. Put both into one sheet and summing the total column will double count revenue. If you need both, keep the order number on every row so you can join the files later.

Step 5: Keep Refunds in Their Own File

Refunds follow different timing rules, so I handle them separately. In Analytics, a refund appears as a negative number on the date the return happened, not on the date the original order was placed. Coupon discounts are included in refunds, and refunded shipping and tax appear in their own columns.

Here is a concrete case. A return processed in April for a March sale reduces April’s refunds, and March’s revenue stays where it was. For most accounting methods, that is right. It just looks odd if you expect the refund to sit next to its sale. Document the approach at the top of the file, then export refunds for the same period as sales.

Once both files exist, reconcile them. Gross sales minus returns, coupons, and other adjustments should produce the net figure you expect. If it doesn’t, you have found the problem before your accountant did.

Step 6: Check Everything in Google Sheets

Once the CSVs are clean, Google Sheets is a quick place to review them. Google’s Sheets import help describes the process: open a spreadsheet, choose File, then Import, and select the file. You can create a new spreadsheet, insert new sheets, replace the current sheet, append rows, or replace data at a selected cell.

For a monthly log, I usually append rows, because earlier months remain intact. The danger is overlap. If you export the same range twice and append both, every order in that range doubles, and nothing will warn you. Before appending, compare the first and last order dates in the new file with what the sheet already holds.

I keep one tab per month and a summary tab that references them. That layout makes overlap visible at a glance. Also remember that the sheet is a copy. Changes made in WooCommerce after the import will not appear until you import again, so label each tab with the export time.

When the Routine Should Become a Connector

A monthly routine works until it doesn’t. The warning signs I look for are month-end taking more than a day, the same orders needing correction every cycle, and a growing number of stores feeding one accounting system. When two or three of those appear together, the export routine has become a cost center.

Business Central exposes sales orders through an API described in the Business Central salesOrder API. The resource includes the order number, external document number, dates, customer details, currency, and a status of Draft, In Review, or Open. It also provides a shipAndInvoice bound action for shipping and invoicing the corresponding sales order. A connector maps WooCommerce orders into those records, so the copy-and-check cycle goes away.

Pricing depends on the number of stores, order volume, and customization needs, so compare Business Central WooCommerce connector pricing with the hours your team currently spends exporting, correcting, and reconciling. Count those hours honestly, because they are usually the largest cost in the manual process.

Before you commit to any connector, test it against your real workflow. Ask how it handles status changes after the first sync, what happens when a sync fails, how it treats refunds and partial shipments, and how it maps tax and shipping. Ask about support after go-live as well. A tool that installs easily but is hard to fix will cost you more than it saves.

Traps I See Most Often

Even careful teams fall into the same traps. The first is mixing date bases across storefront, payment provider, and accountant reports. Pick one basis per report and say so on the file.

The second is changing excluded statuses mid-period, which moves totals for reasons unrelated to sales. Log every change with a date.

The third is trusting the default view. For full history, use the historical import option with the full range. An export that begins a month late looks convincing, which makes it risky.

The fourth is treating a CSV as live data. Stamp every file with its creation time, and refresh before you act on it.

The fifth is ignoring failed imports. Each missing order is a sale your books don’t reflect. Read the log, fix the cause, retry, and confirm the count before you close the period.

Key Takeaways

  • Write the purpose, date range, and date basis at the top of every export so the file explains itself later.
  • Check Date Type and excluded statuses before each run, because both change totals without warning.
  • Use the Analytics summary for period totals, and pull line items only when a named person needs them.
  • Keep refunds in their own file and reconcile them against sales every month.
  • Review exports in Google Sheets, but avoid overlapping appends, which double every order in the overlap.
  • When the monthly routine needs constant fixing, a connector to your ERP is the sensible next step.

Frequently Asked Questions

What is the quickest way to export orders from WooCommerce?
Go to Analytics, choose Orders, set your date range, and download the CSV. Large reports arrive by email as a link that stays valid for one week.

Why do my WooCommerce export totals differ from my accountant’s?
The most common reason is a different date basis. WooCommerce Analytics uses the paid date by default, while many accounting methods use the order date. Agree on one basis, set it in Analytics, and compare reports only when they match.

Does the export include product line items?
The Analytics summary does not list the products inside each order. For line items, use the WooCommerce REST API orders endpoint or a plugin that exports one row per line item, and keep that file separate from the summary.

How should refunds appear in an export?
Analytics records refunds on the date of the return, not the original order date. Refunded shipping and tax appear in their own columns. Export refunds for the same period as sales and reconcile the two files.

Why did I get an email with a download link?
When a report spans more than one page of the table, WooCommerce runs the export in the background and emails a link. The email goes to the account that requested the export.

How long does the download link last?
The emailed link remains available for one week and can be used more than once during that time. If it expires, go back to the report and request a new download.

Can I open a WooCommerce CSV in Excel?
Yes. Open the file directly in Excel, then check dates and currency columns, since regional settings can change how they display.

Should I keep appending exports to one Google Sheet?
You can, but check for overlapping date ranges before every append. Overlap doubles the affected orders, and the sheet will not warn you.

Are the old WooCommerce Reports still a valid option?
WooCommerce deprecated them with version 4.0 in March 2020, and they no longer receive updates. Most still export CSV, but the Customer List and stock reports cannot be exported. Use Analytics for new work.

When should I move from manual exports to a connector?
Consider a connector when month-end regularly takes more than a day, when the same orders need repeated correction, or when several stores feed one accounting system. Compare connectors on status handling, sync failure alerts, refunds, and support after go-live.

Conclusion

A reliable WooCommerce export comes from a repeatable routine: settle the date basis, check the statuses, export the summary, pull line items only when needed, keep refunds separate, and review everything before it leaves your hands. When that routine starts to feel fragile, automation is the logical next step. If you want to see how a connector would fit your store, you can book a Business Central WooCommerce demo and test it against your own workflow.

Top comments (0)