Pull syncing

Here’s all you need to know about pull syncing with Stock2Shop.

In the below documentation we will be covering:

What is pull data syncing?

A pull sync refers to the fetching of updates from a data source at predetermined intervals. Periodically, Stock2Shop will scan your data for any changes that might have occurred since the previous sync. These changes are then pulled from your database and synced to the Stock2Shop console.

If your source of data (usually an ERP / accounting system) is installed on a server that is situated at your office (or in the cloud), this would constitute an on-premise integration. Pull syncs are more likely to be used for SaaS data sources that are internet-based.

How does it work?

A pull sync is scheduled to run every hour to look for (audit) products that have changed (been updated) since the last sync from your ERP / accounting system. Any changes that are picked up are then “fetched” onto Stock2Shop, and distributed to your linked sales channel(s).

There are two ways in which data from pull syncs are handled, and this depends on the source and the limitations of the API.

There is no need for Stock2Shop to sync all products and do an internal audit when the third party application’s API has the ability for us to:

  • Sort results by a token (often a modified date) in ascending order.
  • Allow us to page through the results.
  • Filter the results by the token (modified date).

The audit in the example above can be handled by the source’s API.

To illustrate this, see below.

A pull sync with no audit required

  • (1) The Stock2Shop worker asks the API for 1,000 products.
  • (2) The API returns sorted and filtered results.
  • (3) These get synced to your Stock2Shop console.

If the source’s API is not able to sort, page and filter results (i.e not possible to audit), Stock2Shop needs to sync all products from the source on the first iteration to a audit table. Thereafter every hour, products are synced to the audit table and checked for changes. Any product changes are then synced to your Stock2Shop console.

Below is an illustration of this process.

Pull sync with audit required

  • (1) The Stock2Shop worker asks the API for all products.
  • (2) The API returns all products.
  • (3) The Stock2Shop worker inserts all products into an audit table.
  • (4) The Stock2Shop worker asks for all changes.
  • (5) These changes get synced to your Stock2Shop console.

How long does it take to sync data

Stock2Shop checks for changes once an hour, and can sync up to 1,000 changes at a time.