We are hoping to keep our app in sync with the merchants product catalog.
We'll use a webhook notify us when a product is deleted from the catalog, but also want an alternative process to reconcile products in the catalog if there should be a comm error or the webhook is missed.
Understand that when a merchant deletes a product it is hard deleted.
Can anyone recommend a bullet proof way to validate and reconcile the product catalog at any point in time?
Thanks in advance.
The only implementation that comes to mind for such a reconciliation would be to poll the products endpoint to retrieve all active ids. You can then compare that with what you have stored on your servers to determine which products have been deleted.
The easiest way to retrieve all products would be to use the `since_id` parameter for pagination. Your first call would be of the form:
You would then take the largest product id returned in that request and pass it in as the `since_id` parameter of the subsequent call until you have retrieved all products. Therefore, any products which you have stored locally which weren't returned during the API calls must be deleted.
As long as the API call is successful (ie: 200 is returned), then there should never be a case where an active product is not included in the list when you're using the `since_id` parameter.
There are instances when products could be skipped when `page` is used for pagination, but for that reason, among other performance issues, we don't recommend using it.