Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API to include 'modified_before' and 'modified_after' parameter support #29461

Closed
databuzz opened this issue Mar 23, 2021 · 10 comments · Fixed by #30585
Closed

REST API to include 'modified_before' and 'modified_after' parameter support #29461

databuzz opened this issue Mar 23, 2021 · 10 comments · Fixed by #30585
Assignees
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: enhancement The issue is a request for an enhancement.

Comments

@databuzz
Copy link

Is your feature request related to a problem? Please describe.
I need to query the WooCommerce REST API for any Products which have been modified since a specified timestamp, and pull those down and update our internal inventory systems. The current list of parameters for listing all products includes after and before but these reference the date created. We need the equivalent of these for the date modified.

Describe the solution you'd like
Add 2 additional parameters to the Products endpoint: modified_before and modified_after which query the date modified field

Describe alternatives you've considered
I haven't been able to find a workaround for this so far.

Additional context
This has been asked about a number of times on Stackoverflow and the WordPress forums here.

@tammullen
Copy link
Contributor

Hi @databuzz

Thank you for taking the time to share this idea, we really appreciate your help.

This idea had been discussed previously in the now deprecated REST API repository
woocommerce/woocommerce-rest-api#37

Adding the needs developer feedback label so the core development team can provide a update.

@tammullen tammullen added the needs: developer feedback Issues that need feedback from one of the WooCommerce Core developers. label Mar 26, 2021
@ObliviousHarmony
Copy link
Contributor

While this is clearly a great improvement/idea we won’t be able to tackle it in the upcoming weeks. We’re going to add it to our backlog where it will be considered for future releases.

Stay tuned for updates.

@ObliviousHarmony ObliviousHarmony added type: enhancement The issue is a request for an enhancement. needs: votes Feature request awaiting community feedback. [auto] and removed needs: developer feedback Issues that need feedback from one of the WooCommerce Core developers. labels Apr 6, 2021
@woocommercebot
Copy link
Collaborator

Thanks for the suggestion @databuzz.

We'll keep an eye on the popularity of this request :)

@nvsoares
Copy link

In our integration project we need to be able to get the changed orders since a certain point (date/time). The 'after' and 'before' parameters don't allow us to do that because they only focus on the 'date_created'. Without this functionality we are forced to overload both systems: the wc api and ours, with multiple extra requests that are mostly wasted.
So I am reinforcing this request, even more so when the number of integrations between systems is an increasing need.

@edvinassss98
Copy link

edvinassss98 commented Apr 26, 2021

I am like everyone trying to create integration with erp system or some other system and i need to get orders by modified date, but sadly this future has been requested bunch of times in the last 3 - 4 years and still hasn't been implemented. So like everyone i would request implementation of this feature.
Also majority of users want to filter orders by modified date at least from the comments, in my case i need to insert all orders to my erp system the ones who have been modified after certain date and has status "Completed"

@grantgrindstonetech
Copy link

Hoping this can be prioritized. It looks like this has been a feature that has been requested by dozens of developers since 2017. I imagine a large percentage of API consumers need this. Filtering by modified date should be an option for orders, products, etc. It's essential for any consumer that is looking to keep a rolling copy of WooCommerce orders in their own repository for analytics, accounting, etc.

There have been comments and suggestions to add a Wordpress filter to allow for the date_modified field to be exposed via an API call. (add_filter('woocommerce_rest_orders_prepare_object_query',........) This works for people who have easy control of the wordpress/woocommerce site, but for cases like mine where I have numerous woocommerce clients I do API calls for and do not have access to their wordpress/woocommerce websites, I cannot realistically ask each of them and any future clients to manually add that wordpress code on my behalf.

Right now I have to call the API every hour for each client and search ~14 days back based on the created date for orders. This is unreasonable and unnecessarily loads servers.

Please prioritize this if possible.

@jonathansadowski jonathansadowski added priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. and removed needs: votes Feature request awaiting community feedback. [auto] labels Jun 17, 2021
@jonathansadowski
Copy link
Contributor

Thanks for all the votes. I'm going to reopen this issue and give it a high priority. It might still be a while until we're able to tackle this, but we'll consider the higher priority as we plan our future work.

@flexjoly
Copy link

Very good to see that this is getting priority.
For multiple clients we need to synchronize products. Now we have cron-jobs which check all (thousands) products every day.... 😭

Will this be applied to \wc\v3 ?

Thanks in advance

@vedanshujain
Copy link
Contributor

Note that to support this, we would need to:

  • Update updated_at column when any of native post meta attribute is updated.
  • Allow for filtering via this column in API.

@weaselmetal
Copy link

Considering all reactions and comments on the issue in the old repo, I think it's obvious how important this feature is, and how long people have been asking for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.