Can you clarify where your code is running, on clover device, on your server, somewhere else?
@Jacob Abrams it's running on Android emulator Clover Mini Gen 2 and SDK level 25.
Thanks @Jeffrey Blattman for your reply. What's the definition of on-device orders and what is the difference/intersection set between on-device orders and on-line at any given time? Is the API end-point behavior similar?
This is all subject to change.
In general, there should be a summary for each order on the device. A device should have the last ~100 days worth of orders on it, though it may take some time to sync all of the orders from the server, as orders older than 7 days sync at a slower rate and only during off-peak hours. This typically is only an issue for a day or a few days after a new device is setup/factory reset/db is dropped due to corruption.
When orders are older than 100 days, the local order is deleted, but the summary stays in the database.
When an order is searched for in the Orders app, it summary is added to the summaries table.
High order volume merchants may have hundreds of thousands of orders in their orders db, so some care is necessary with selections if you are searching on fields.
I am not familiar with the exact behavior of the REST api orders endpoint.
We may eventually release some improvements to provide a more well defined summary table that has ~100 days worth of summaries + indexes to support fastering searches + server queried orders + a mechanism to query our server + an indicator if it is done syncing older orders, but that is not actively being developed.
Thanks @Dan for your reply. It's not clear though how "it may take some time to sync all of the orders from the server" in case of new device setup. Are there are any data/orders that are shared between devices?
4 People are following this question.