question

nofir avatar image
nofir asked gemmalyly answered

Inventory Sync

Hi,


Looking at your documentation, we are trying to understand what are the best practices for syncing data into our database. In order to avoid a full scan (and api rate limits) of the inventory items we were thinking to utilize (as per your recommendation):

1. Webhooks

2. modifiedTime

However, the problems we see are the following:

1. Webhooks are only for inventory items and not for modifier groups / modifiers. Which means that relying on webhooks will not be sufficient to make sure our database is up to date.

2. Similarly, calling the inventory items api with modifiedTime as the filter will give us items that were updated but possibly items that have not be modified have modifier groups / modifiers that have been updated.

3. Deleted objects are not returned in the apis.


For #1, I do think it makes sense not to rely on it completely but have the benefit of "real time" updates to our database.

For #2, It seems like we need to make separate "modified only" calls: one for inventory items, one for modifiers groups and one for modifiers This is the only way to make sure we know which objects have been modified since our last sync.

For #3, It seems like we need to get all objects by ids and ones that are not returned, deduct they are deleted. Similar to #2, it seems like we need to make separate "modified only" calls: one for inventory items, one for modifiers groups and one for modifiers.


Please let me know if you have any suggestions or best practices we can follow.


Thank you, Ofir


REST 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.

David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented

Due to your other question (https://community.clover.com/questions/24405/creating-orders.html) I think you need to contact appmarketbusiness@clover.com to discuss your application with our team before proceeding with the technical details.

4 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.

nofir avatar image nofir commented ·

I saw your response to the order question. If the scenario in the other question is not possible we might choose to do a "catalog only" integration in order to import the catalog into our database which makes my question still relevant. But I do understand if its better to wait before proceeding with a technical discussion.



0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ nofir commented ·

I am hesitant to recommend to anyone to do something like this. Some merchants have a LOT of inventory and you are going to be making a LOT of queries, but overall your plan of attack seems reasonable.

For 2 and 3 you may be able to accomplish what you need with just the inventory endpoint as it has an expansion on modifierGroups. Of course, that assumes that when a group is modified it's inventory items modified time is updated and I am not certain that is the case. Just a few links - https://docs.clover.com/docs/expanding-fields and https://docs.clover.com/docs/paginating-elements.

0 Likes 0 ·
nofir avatar image nofir David Marginian ♦♦ commented ·

Just to confirm, "I am hesitant to recommend to anyone to do something like this" - import merchants entire catalog into our database? :-)

In our use case, we work with restaurants which from our experience do not have a very big inventory but I do understand your concern.

From the checks we made so far, it seems like updating a group property like the name (or one of the modifier) would not update the inventory item.

Thank you.


0 Likes 0 ·
Show more comments
gemmalyly avatar image
gemmalyly answered

The principal is the initial amount borrowed or the outstanding balance of the debt. Repayments typically include a portion of the principal, which reduces the overall amount owed.

connections

10 |2000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

Welcome to the
Clover Developer Community