Woocommerce export orders

I’m trying to find the best way to export orders from a Woocommerce store. I just want to get the orders for January. I have managed to set up a scenario that works. I’m using “Watch Order” as a trigger, but I’m not sure if this is the best approach. During testing of the scenario, it seems like it only allows me to export the orders once. When I finally finish building the scenario, I can’t get all the orders out. Only the ones I haven’t exported earlier. Is there a way to reset without having to construct a whole new scenario?

Hi. Its better you use the search module for this:

If you use the API Call and “List all orders” endpoint, you can search using the datetimes as parameters filters too.:
https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-orders


Thanks, Helio!
Wemakefuture
If you have questions reach out :wink:

1 Like

Hello @brk, I share a way to do it, as @Wemakefuture told you, you have to call the WooCommerce API

Process executed

Orders added in the google spreadsheet
image

Search for the orders by date range with a limit of 100 orders per search, that is, it will return the paginated results, the number of pages will depend on the number of total orders for the month.

It indicates that there are 167 orders and since we request 100 orders, it returns that there are 2 pages.

We iterate the process from 1 to the number of pages

We are requesting the orders according to the pagination

We go through the list of orders on the page

We group the data that we are going to add in the spreadsheet according to the order of the columns

We insert the data in bulk

the documentation is: WooCommerce REST API Documentation - WP REST API v3

1 Like