amar avatar image
amar asked Dan commented

regarding order details in clover system

@Jeffrey Blattma
I have a query regarding order details that how lang data exists on clover system(DB)?
After syncing to clover server all order details exists in clover db or removed after some time?
Actually I have to show order info and I am using content provider, I was wondering if data will be deleted after some time like in months...
Clover MiniClover StationClover Mobile
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeffrey Blattman avatar image
Jeffrey Blattman answered Dan edited
While you can't make any assumption about the locally stored data on the device, order data persists indefinitely on Clover servers. Devices can be reset or replaced at any time so historical data may be reset. Newly reset devices will sync up to the last 90 days of historical data only.

Please note that making queries against our servers for historical order data spanning large time windows will not be allowed. If you want to speak more about what specifically you are trying to accomplish we can perhaps provide better guidance.

EDIT: Updating to answer comment questions:

Our server endpoints around orders are rather sensitive considering the size and mission critical nature of the database. General rules are that you should not query >2 months in the past and should expand on demand (e.g., when a user drills into the order). Also consider general API usage guidelines here:

It would not hurt to email when you have a concrete plan and run it by them. If you need to query older data, or more data, you'll need to use export APIs:

W/ regard to the local on-device database, yes you can generally assume there will be at least 90 days of data but that's not guaranteed (e.g., prior to the device having a chance to download that data). Also, we are currently rolling out the change to auto-sync 90 days so you may not see that in your development environment.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

See updated answer.

1 Like 1 · was recently added, providing guidelines fetching recent and older order information.
1) this would require using the export api
2) 1000 response hard limit on the /v3/merchants/{mId}/orders endpoint, export api is different
1 Like 1 ·

Thanks Dan,

1) Can you confirm on max past date for export API?

i.e if we want data for Jan 2010, so is it possible?

2) For how long (time) data details (i.e order,payment) are available on clover device locally? please share exact span of time.

0 Likes 0 ·

1) All i know about the export API is what is in the link I posted. Clover did not exist in Jan 2010, but I would guess that you can use the API to get all of the orders for a given merchant (assuming you follow the export API documentation). should have more information.

2) Today, order data on device is not guaranteed for any specific time range. In the nearish future, after the device finishes syncing (which takes an indefinite period of time for new devices depending on order volume) order data will be guaranteed for the past 100 days, plus any order that has been loaded on the device in the past week (this is subject to change). Very large merchants may not have the full 100 days of data. More information and clover-android-sdk updates should be forthcoming. All that said, you may run into performance problems generating reports on the device, depending on the number of orders per day for a merchant, and the number of days in the report.

0 Likes 0 ·

@Jeffrey Blattman

Thanks for reply.

We are working on a Order reporting app and trying to provide option of selecting date range to user. So would like to know the max past time limit which we can allow here?

We are using Local DB to access Order data as of now and as per your response it seems that Local DB will atleast have Past 90 days data in any case.

1. So should we allow user to view data for Past 90 days Max?

2. Also using Local DB is recommended in this case or we should go for APIs to get data?

3. Please also let us know how much time span is allowed through API?

0 Likes 0 ·


I want add something in query for getting data from server..

As You said 'General rules are that you should not query >2 months in the past and should expand on demand (e.g., when a user drills into the order).'

1) Our App requirement is to get 90 days order data and max past date Jan 2010, so is there any issue with server? i.e max past date time span Jan 2010 to March(End) 2010.

2)Is there any chunking(limit on response), or Single request can fetch all data for 90 days?

0 Likes 0 ·
Jeffrey Blattman avatar image
Jeffrey Blattman answered
@Amar please email We're getting into design issues that are too complex to discuss in an answer thread.
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

upopovic avatar image
upopovic answered Dan commented
@Jeffrey Blattman
We are experiencing similar problem, device was long enough online, more then a day, to sync. But it does not syncing, and we can not query local database for orders. Only way for order to show up in our query is to go to Orders app -> Order detail, and then only that one starts to showing up in our query. Is this something that we can relay on to be fixed in next two months, or we need to write workaround and query backend API?
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Please provide the code you are using to query the local database, and a brief explanation of what you are trying to accomplish. Are you getting any results from your local db queries?

If the device has been factory reset and the order was last modified more than a week ago, it will not appear in queries to the OrdersContract.Summaries uri. If you know the order uuid and it is not being returned from your query, you can load the order through OrderConnector#getOrder, that will result in it appearing in queries to said uri.

The OrdersContract.Summaries table isn't synced in the same manner as other data. Whenever an order is touched on the device, the summary is updated. If the device has not touched the order, it won't appear in the table. Devices sync 7 days worth of orders, so those will always appear in the table. Code was added to store 100 days with of orders, but summaries arent stored in that uri.

0 Likes 0 ·

There is another summary table that guarantees 100 days worth of order data after the device has finished syncing, but it is currently being tested/proven. I'll look into having it added as a beta api (with the reservation that anything can change at any time for now).

0 Likes 0 ·

Welcome to the
Clover Developer Community