addInventoryCategory
The method allows you to add a category to the BaseLinker catalog. Adding a category with the same identifier again, updates the previously saved category
Input parameters
Output data:
A sample request in PHP:
inventory_id | int | Catalog ID. The list of identifiers can be retrieved by the getInventories method (inventory_id field). To add a category available for all catalogs created in BaseLinker, this field should be omitted. |
category_id | int | The category identifier to be provided for updates. Should be left blank when creating a new category. |
name | varchar(200) | Category name |
parent_id | int | The parent category identifier obtained previously at the output of the addCategory method. Categories should be added starting from the hierarchy root so that the child is always added after the parent (you need to know the parent ID to add the child). For the top level category, 0 should be given as parent_id. |
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 |
category_id | int | Number of a category added or updated in BaseLinker storage. In an external application you should create a link between the internal number and the number received here. It will later be used to update the added category. This number is also used in addProducts and deleteCategory methods. |
Sample
Input data:Output data:
A sample request in PHP: