Woocommerce V3 Api Remove Order Limitation of 10 - json

I am trying to import all the orders through the API (6,500 pieces), but I noticed that the API only makes 10 queries. By adjusting the link domain/wp-json/wc/v3/orders?per_page=100 I can query 100 orders, but I can't get it to query all orders with one call. Is this possible at all.

It is not possible to get all 6500 orders at once, and the API is limited at a maximum of 100 orders per call. The only way of solving this is by making a loop and do multiple calls. However there are 2 HTTP headers that might help you. X-WP-Total and X-WP-TotalPages.
Another solution would be to create your own Wordpress plugin, which adds a new endpoint, and that way you get all your orders

Related

is storing frequently used data in json in mysql worth it?

in vue.js app the main focus is working with prospects. prospects have many things like contacts, listings, and half a dozen other objects/tables.
they also have interactions, which could have 30 or more per prospect, while most things like emails or phones would have 1-3 results. I load 50 prospects at a time in to the front end
I'm trying to decide if loading it all into the front end to work 50 prospects at a time is a good idea, or if i should have a json column with interactions as part of the prospects table that i would update each time an interaction is saved, with minimal info like date, type, subject...
it seems like an extra step (and duplicate data, how important is that?) to update the json column with each interaction, but also seems like it would save looking up and loading data all the time
I'm not a programmer, but have been teaching myself how to do something i need done for my business with tutorials and youtube, any opinions from those who deal with this professionally would be appreciated
also, if anyone wants to tell me how to ask this question in a better formatted way, I'm open ears
thanks
Imagine if you have 1000 data, but you are sending only 50 of them, and your user do a filter by price. Will you display only the filtered data from 50 or 1000 of them?
That depends on whether you want to expose all 1000 data to the front end. It's a choice between that, and calling your server api everytime.
If you are calling the server, consider using a cache like Redis to store your results .
Pseudo code.
Request Received
Check Redis Cache - Redis.get('key')
If key exist - return cache.
Else -
check mysql for latest results.
Redis.set('key', latest results);
CreateRequest Received
- Write to mysql
- Redis.delete('key') // next request to view will create new cache with fresh data.
Your key can be anything like, e.g your url ('/my/url')
https://laravel.com/docs/8.x/redis

What is the perfect way to paginate realtime data with cursor based pagination?

I have a large set of realtime messages data which loads based on the order of its rating.
For the temporary solution, I am using is skip-n-limit method pagination.
I know I can handle this using the cursor-based pagination as FB or twitter API does. But my problem here is I am ordering messages based on the message rating.
Reference: in https://www.sitepoint.com/paginating-real-time-data-cursor-based-pagination/
If it was ordered-by-id I can check this with max_id & min_id
Any suggestion or ideas are welcome

Best way of reducing product count in e-commerce web app?

I am developing a e-commerce web app using Spring , Hibernate and MySql.
For ex : In this app at the time of placing order for products , I am going to update Product table record , means going to reduce product count from this table.
I am using mysql update query for that.
Its working fine . but if I send 100 of request at a time then that product count is not decreasing properly.
For that I got two answer
I used messaging queue(RabbitMQ) to queued all request and reduce the count one by one
I have to use hibernate lock
So I need to know other possible way to do that work and from above two way which one is good ?

Where does aggregated data fit in in a REST JSON API and a mobile client?

I have an iOS app talking with a REST JSON API. I have mapped the model resources 1-1 with the controllers/endpoints in the API. E.g. User (/users), Friendship (/friendships), Rating (/ratings), RatedObject (/rated_objects) etc. And on the device I'm using RestKit/CoreDate to store/sync all objects.
Now I start to get the need for different kind of aggregated data, e.g. different rating averages and rating counts on the RatedObject depending on the friendship type. I have solved it now by adding the data to the RatedObject type:
RatedObject
name
size
ratingAverageFromCloseFriends
ratingCountFromCloseFriends
ratingAverageFromFamily
ratingCountFromFamily
ratingAverageFromAllFriends
ratingCountFromAllFriends
But when it starts to get more kinds of aggregated data on different kind of objects, it is getting over hand. And I also sometimes need to get the average from only one specific friend, and that can't be added to the model.
I store all data locally on the iOS device, and the aggregated data should be easy to update from the server.
How should I solve this and make it easy and natural for both the client and the server?

How to restrict results by price in Google products search API

I've been looking over the web for a way to restrict price range on google search shop API but I wasn't able t find any answer. (Let's say I want products between 20 to 40 $)
In the official documentation, it seems to have ne reference to this functionnality (only rank by Price)
Neither Here nor Here
Also,
I've been looking at this post in stackO but the answer doesnt seem to bring a good solution to the question (he is just stating the technology to use). Is there a way to do so ?
Thank you
Add this to URL of your API call.
&restrictBy=price:[20,40]
It will return products with prices in between 20 and 40 both inclusive.
&restrictBy=price:(20,40]
And the above query will return products with prices above 20.
Refer
https://developers.google.com/shopping-search/v1/reference-request-parameters#restricting-products