Can I Just Download New Orders from WooCommerce
When downloading Orders from WooCommerce in the fmEcommerce Link file you can specify a date range to download orders between these 2 dates. We check when downloading if there is already an existing Order with the same WooCommerce Order ID and skip that so only Orders that do not already exist in the fmEcommerce Link file are downloaded:
The WooCommerce REST API doesn't have the option to just download orders since a specific Order ID. You can use the available query parameters to search for orders since a particular timestamp or by status if all your new orders have a specific status (e.g. processing).
To just search for orders since specified date and time you can just use the
after parameter with a particular timestamp, e.g. changing the $url parameter from this:
WooCommerce_BaseURL ( $fmWooCommerceWebsite ) & "/orders?after=" & FMDateToWooCommerce ( Interface::OrdersDateFrom ) & "T00:00:00Z&before=" & FMDateToWooCommerce ( Interface::OrdersDateTo ) & "T23:59:59Z&page=" & $page & "&orderby=id&order=asc"
to just this:
WooCommerce_BaseURL ( $fmWooCommerceWebsite ) & "/orders?after=" & FMDateToWooCommerce ( Interface::OrdersDateFrom ) & "T00:00:00Z&page=" & $page & "&orderby=id&order=asc"
and substituting out your date/time or timestamp here.
To search for orders with a particular status you can use the
status parameter. For example to get all orders with a Status of Processing you would include this: