Api Operation Logic in Data Extraction Mode (Output)

Generate from scratch and synchronize: Using a given moment in time as an ally in data extraction.

The Sales Layer API web service is designed so that you can configure different models of the information contained in your catalog with the Sales Layer PIM. Thanks to the export connectors, you can create different data models in your catalog with an intuitive UI for different uses, such as the data repository of a catalog website, an online store, a printed catalog generation service, or any own or third party software which needs your data. You only need to share the information that each software needs. What’s more, you can manipulate the output data to your liking thanks to the power and versatility of our connectors, while still maintaining your own catalog business logic.

However, most business catalogs are usually vast, both in the number of references, as well as in the volume of attributes. If we add to this the possibility of processing images or documents, then obtaining and synchronizing the updated data from the catalog through an API can take a significant amount of time and consume a fair amount of bandwidth.

For this reason, the Sales Layer API incorporates two parameters in the data extraction requests, which we have already referred to as time and last_update, which accept values in UNIX TIMESTAMP date format.

The combination of values ​​of these two parameters will indicate to the API a temporary starting point for extracting the data which has undergone some modification since the indicated dates.

In most applications these two parameters can contain the same time value which will refer to the moment from which to look for changed items across the different tables, in order to obtain the changes through the Sales Layer API.

Imagine a catalog with 100,000 references. You use the API to create an initial synchronization of your online store. This operation has a cost in terms of processing time and bandwidth. If you change the description or price of just ten of those references, it seems illogical to have to obtain the data of all 100,000 references again in order to re-synchronize your web catalog, unless of course this is something you expressly desire.

To avoid this situation, it is possible to indicate in the request a last_update value that indicates when you last synchronized your web catalog via an API request, and a time value, prior to the modification of those ten references (possibly coinciding with the previous), to obtain a response of just what needs to be synchronized again, and which are the ten references in question.

The following graphic shows a simple example of the results of an API request based on the events that occurred in the client account:

Example of the results of an API request

The Sales Layer API maintains a data response logic based on the time parameters that are sent in the corresponding request. At any time it is possible to obtain the data of all the candidate items for export by configuring the connector: Categories, products, variants or tables of sales material, and  initializing the temporary parameters to a value of 0, or to a value which is prior to the first product import.

This mode of operation allows for consistent logic when it comes to performing data synchronization with external applications.

Any changes to the configuration or parameters of the export connector used will re-initialize the API timeline, the date on which said modification occurs. It will be necessary to ensure that previous updates include the new extraction configuration.

We’d recommend using the Sales Layer API as a synchronization service with a local repository. It is not recommended to use the Sales Layer API to process data queries of specific items in real time.

The Sales Layer public SDK, based on LAMP technology, allows local data repositories to be created through transparent requests to the Sales Layer API through the Updater SDK service. This will facilitate the synchronization of your PIM account data with local direct consultation services such as online stores, or web catalogs.

Download the (PHP Based) Sales Layer SDK here.

Sales Layer PIM has a connector for the creation of online microsites, which can facilitate the creation of an online catalog which is publicly accessible.