question

ranza avatar image
ranza asked ranza commented

How often does clover sync it's inventory? And on what occasions? Can I force a sync?

I'm working on an app that changes item prices after opening new order with certain items and I'd like to make sure that the prices get updated before an employee adds another item to the order or following orders. How can I achieve that?
Thanks!
InventorySale
2 comments
10 |2000

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

Miguel avatar image Miguel commented ·

How are you updating the price, using the Android SDK or REST API?

0 Likes 0 ·
ranza avatar image ranza commented ·

@Miguel by REST API

0 Likes 0 ·
chanel avatar image
chanel Deactivated answered
Inventory syncs happen rather frequently (in my experience, every 5-10 seconds or so). However, if you change the price of an item that's already been added to an order, that item's price for that order will not change. However, the item is added again, the new item will be at the new price (so the order will have 2 of the same items at different prices). Going forward, the new price will be used.
10 |2000

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

Dan avatar image
Dan answered ranza commented
When you update the item via the REST api (or another device associated with the same merchant modifies an item), a push notification is sent to the device instructing it to sync its inventory. The device then syncs its inventory with the server. This process generally occurs within a handful of seconds, but it can take much longer if the client's connection quality is poor.

As Chanel noted, there is a period between when you make the REST api call and when the device syncs in which adding the item in question to an order will result in the item being added at the old price, rather than the new one.

If the required response time is on the order of seconds, this scheme may not be suitable.

Another option could be to have an android app use the android sdk InventoryConnector to make the change to the item on the device.
2 comments
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 ♦♦ commented ·

What @Dan said. Use InventoryConnector.

0 Likes 0 ·
ranza avatar image ranza Jeffrey Blattman ♦♦ commented ·

Thank you both for great answers! Ok, so assume I'll use the InventoryConnector - would it be possible for an app running on Android in the background to act on the InventoryConnector immediately upon receiving a message from a server? Would receiving messages from a server in the background indefinitely be even possible?

0 Likes 0 ·

Welcome to the
Clover Developer Community