getInventoryProductLogs
The method allows to retrieve a list of events related to product change (or their variants) in the BaseLinker catalog.
Input parameters
| product_id | int | Product identifier. In case of retrieving logs for a variant, the variant identifier must be provided as the product identifier. |
| date_from | int | (optional) Date from which logs are to be retrieved. Unix time stamp format. |
| date_to | int | (optional) Date up to which logs are to be retrieved. Unix time stamp format. |
| log_type | int | (optional) List of event types you want to retrieve. Available values: 1 - Change in stock 2 - Price change 3 - Product creation 4 - Product deletion 5 - Text fields modifications 6 - Locations modifications 7 - Modifications of links 8 - Gallery modifications 9 - Variant modifications 10 - Modifications of bundle products |
| sort | varchar(4) | (optional) Type of log sorting. Possible "ASC" values (ascending from date), "DESC" (descending after the date). By default the sorting is done in ascending order. |
| page | int | (optional) Results paging (100 product editions per page). |
Output data
The method returns the data in JSON format.
| status | varchar(30) | SUCCESS - request executed correctly ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code |
| logs | array | An array of logs grouped by date and the profile executing the change. An array contains the fields listed below. |
| | - profile | varchar(100) | The name of the profile performing the change. |
| | - date | int | Event date |
| | - entries | array | An array of events performed by a given profile at a given time. An array contains the fields listed below. type (int) - Event type. Available values: 1 - Change in stock 2 - Price change 3 - Product creation 4 - Product deletion 5 - Text fields modifications 6 - Locations modifications 7 - Modifications of links 8 - Gallery modifications 9 - Variant modifications 10 - Modifications of bundle products from (mixed) - Previous value to be completed for some event types: Event type 1 - (int) Previous product stock. Event type 2 - (float) Previous product price to (mixed) - New value completed for some event types: Event type 1 - (int) New product stock. Event type 2 - (float) New product price info (mixed) - Additional information, completed for certain types of events: Event type 1 - (varchar) The identifier of the warehouse where the stock was changed. Event type 2 - (int) Identifier of the price group where the price has changed. Event type 3 - (varchar) Identifier of the text field where the value was changed. Event type 6 - (varchar) Identifier of the warehouse where the location has been changed |
Sample
Input data:Output data:
A sample request in PHP: