Integration files are placed on the store server and create a kind of external interface to the store. They contain a set of functions that download the necessary data to BaseLinker (e.g. categories, products, shipping methods) and sending updates to the store (e.g. orders). In this context, the term "file" actually means a script (usually written in PHP, although any language can be used) running under a public HTTP server.
The purpose of the integration is, of course, to load or save relevant records from the store's database. BaseLinker itself does not have access data to neither the server hosting the integration file nor to the database. This data is completed in the header file by the store owner or a person designated by him. Thus it was eliminated absolutely need to upload any passwords. BaseLinker only uses a randomly generated key communication, additionally protecting against unauthorized access to the file.
BaseLinker offers ready-made integration files for the most popular shopping platforms. However, this does not preclude integration with other platforms, in particular with those based on proprietary software. Such a file can be prepare on your own, based on the available examples and this documentation. Below you will find a list functions supported by the current API version.
Some functions, such as ProductsCategories, do not require any additional parameters, others, such as ProductsData, do. However, each request requires sending the bl_pass parameter containing the generated alphanumeric communication key machine by the BaseLinker panel when connecting the store.
All input data is sent via POST from the BaseLinker server to the address of the integration file. If any parameter has a more complex format, e.g. an association table, its content must be previously encoded in JSON format. Query results are always JSON encoded and text values expressed in UTF-8. We pass the name of the function as the action parameter.
Depending on the called function, the returned data may have a different structure, however, in the event of an error, file integrator should return the following fields:
- error
- - the TRUE value, for example: 1;
- error_code
- - Free error name
- error_text
- - Message
A special case is when you reference an integration file with the POST method, without any parameters. In such a situation, the integrator should return no_password error:
{"error":true,"error_code":"no_password","error_text":"Any content here "}
BaseLinker supports paging of results for functions that have the potential to return large amounts of data. It is a mechanism optional, currently implementable in the ProductsList, ProducstQuantity and ProductsPrices context. The idea of action is as follows:
If the result of the function contains an element with the ID `pages`, its value is to indicate the total number of pages. The number of records per page is irrelevant, it can even be different from page to page, it is only important that the `pages` element is consistently attached to each party. Knowing the number of pages, BaseLinker will re-query the given function with the parameter page = N, where N will be the resulting page number in the range 2 to `pages`. Page # 1 is always downloaded, whether or not the integration file supports paging or not.
SupportedMethods* | List of all functions supported by the integration file |
FileVersion* | Method returning the version of the integration file - necessary for the integration to work. |
ProductsCategories | The method allows you to download a list of store's magazine categories. |
ProductsList* | The method allows you to download basic product data from the store's warehouse, using optional selection and sorting criteria. The results of this function should return all matching products, excluding variants. |
ProductAdd | The method allows add a new product from BaseLinker to the store. |
CategoryAdd | The method allows add a new category from BaseLinker to the store. |
ProductsData | The method provides a detailed list of products from the store's warehouse. |
ProductsPrices | The method provides only the prices of the base products and their variants |
ProductsQuantity | The method provides only stock of base products and their variants |
ProductsQuantityUpdate | The method allows mass updating of product inventories (and their variants). Maximum 1000 products. |
ProductsPriceUpdate | The method allows mass edit the price |
OrdersGet | The method provides orders list from a specific date. Enter the date and / or order number from which the list of orders should begin (at least one of these two fields must be provided). Additionally, the list of returned orders may be limited only to paid orders, if the |
StatusesList | Method provides a list of possible order statuses supported by the store platform |
DeliveryMethodsList | Method provides a list of shipping methods supported by the store platform |
PaymentMethodsList | Method provides a list of payment methods supported by the store |
OrderAdd | The method allows add a new order from BaseLinker to the store. It provides delivery details, billing details and products of the order. |
OrderUpdate | The method updates orders already saved in the database. |