Add Category, method: /api/category/add/
Example:
№ | Field | Type | Description | Required or not | Comment |
1 | login | string | Login in BOX system | Required field. | |
2 | password | string | Password in md5 format | Required field. | Contact tech support and we will give you a hash for the API |
3 | name | string | Category name | Required field. | |
4 | code | string | id categories from your system | Optional field. | This is a unique category identifier from your system (from your store). If a category with this id exists, the API will throw an error |
5 | description | string | Category description | Optional field. | |
6 | parentid | integer | id parent category from our system | Optional field. | In this field you can enter the parent category code from our system. If there is no category with this code, the field will be empty. |
7 | image | array | Array of category images | Optional field. | Images should be sent as an array with the full path to them. The system works with the following image formats: jpg, png |
8 | hidden | boolean | hidden category | Optional field. | By default, the category is not hidden (hidden = 0) |
9 | parentcode | string | code1c categories (category id from your system) | Optional field. | In this field you can enter the parent category code from your system. If there is no category with this code, the field will be empty. |
Delete category, method: /api/category/delete/
Example:
№ | Field | Type | Description | Required or not | Comment |
1 | login | string | Login in BOX system | Required field. | |
2 | password | string | Password in md5 format | Required field. | Contact tech support and we will give you a hash for the API |
3 | id | integer | Category ID | Either category id or code is required | Category code in the BOX system |
4 | code | string | Category ID | Category ID from your system (from your store) |
Editing Category, method: /api/category/update/
Example:
№ | Field | Type | Description | Required or not | Comment |
1 | login | string | Login in BOX system | Required field. | |
2 | password | string | Password in md5 format | Required field. | Contact tech support and we will give you a hash for the API |
3 | id | integer | Category ID | Either category id or code is required | Category code in the BOX system |
4 | code | string | Category ID | Category ID from your system (from your store) | |
5 | name | string | Category name | Optional field. | |
6 | description | string | Category description | Optional field. | |
7 | parentid | string | id parent category from your system | Optional field. | In this field you can enter the parent category code from your system. If there is no category with this code, the field will be empty. |
8 | image | array | Array of category images | Optional field. | Images should be sent as an array with the full path to them. The system works with the following image formats: jpg, png |
9 | hidden | boolean | hidden category | Optional field. | By default, the category is not hidden (hidden = 0) |
10 | parentcode | string | code1c categories (category id from your system) | Optional field. | In this field you can enter the parent category code from your system. If there is no category with this code, the field will be empty. |
Get one category and get all categories method: /api/category/get/
Example:
№ | Field | Type | Description | Required or not | Comment |
1 | login | string | Login in BOX system | Required field. | |
2 | password | string | Password in md5 format | Required field. | Contact tech support and we will give you a hash for the API |
3 | id | integer | Category ID | Either category id or code is required | If you need a specific category, then you pass in this field either the category id that our API returned to you when it was created. Or specify the external category identifier (field code when creating a category) The engine will find this one by itself. Return field values id - id Categories, name - category name, code - external category id, image - Array of category images, description - Category description, parentid - id parent category, hidden - hidden category |
4 | code | string | Category ID |
Example:
№ | Field | Type | Description | Required or not | Comment |
1 | login | string | Login in BOX system | Required field. | |
2 | password | string | Password in md5 format | Required field. | Contact tech support and we will give you a hash for the API |
Return field values id - id Categories, name - category name, code - external category id, image - Array of category images, description - Category description, parentid - id parent category, hidden - hidden category |
Possible responses to the request
№ | Status | Message | Message Description |
1 | ok | categoryid | Returns the added category id |
2 | fail | Login is empty! | Login missing |
3 | fail | Password is empty! | Missing password |
4 | fail | Category name is empty! | Missing category name |
5 | fail | Bad user level! | Low user level to perform this action (requires level 2 or higher) |
6 | fail | Login or password not correct! | Login or password entered incorrectly |
7 | fail | Category with this ID already exists! | A category with this id already exists |
8 | fail | Incorrect picture! | Invalid image format |
9 | fail | You don't available category for delete! | You have not selected a category to delete |
10 | fail | Category with this ID does not exists! | There is no category with this ID |
11 | fail | Category with this Code does not exists! | There is no category with this code |
12 | fail | You don't available category for update! | You have not selected a category to update |
13 | fail | parentid = categoryid | id the parent category is equal to the id of the category itself or the id of the parent of the parent category is equal to the id of the added category (loop) |
14 | fail | Parentid is not corectly! | id parent category is invalid |