Получение и управление списками категорий и свойств (размеры и серии)
- Back API Introdution
- GET list groups
- ADD groups заполнение веток (при обязательном параметре level_id)
- UPDATE groups
- ADD NEW Categoty
- ADD NEW Property
- 🆕 DELETE group
https://storencash.com/api/v1_groups.json
- Response formats
JSON
- Requires authentication?
Yes
none
GET /api/v1_groups.json HTTP/1.1
Host: storencash.com
token: 15da7169ee5272b97692ff680cab97f5
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
{
"status": "success",
"data": {
"collection": [
{
"id": 1,
"name": "Первая категория",
"level_id": 4,
"offerId": 0
},
{
"id": 927,
"name": "Размеры",
"level_id": 2,
"offerId": 0
},
{
"id": 928,
"name": "31",
"level_id": 2,
"offerId": 0
},
],
"handbooks": {
"levels": [
{
"id": 2,
"name": "размеры",
"group_id": 927,
"zu": 1
},
{
"id": 4,
"name": "Первая категория",
"group_id": 1,
"zu": 0
}
],
"linked_groups": [
{
"id": 10,
"groups_parent_id": 1,
"groups_id": 1,
"ves": 10
},
{
"id": 1210,
"groups_parent_id": 927,
"groups_id": 928,
"ves": 1210
},
{
"id": 1211,
"groups_parent_id": 927,
"groups_id": 929,
"ves": 1211
},
{
"id": 1212,
"groups_parent_id": 927,
"groups_id": 930,
"ves": 1212
},
{
"id": 1213,
"groups_parent_id": 927,
"groups_id": 931,
"ves": 1213
},
{
"id": 1214,
"groups_parent_id": 927,
"groups_id": 932,
"ves": 1214
},
{
"id": 1215,
"groups_parent_id": 927,
"groups_id": 927,
"ves": 9999
},
]
}
}
}
https://storencash.com/api/v1_groups.json
- Response formats
JSON
- Requires authentication?
Yes
Name | Require | Type | Description |
---|---|---|---|
level_id | yes | bigint(10) | default = null. Level ID. |
groups_parent_id | no | bigint(10) | default = null. Parent group ID. |
name | no | varchar(80) | default = null. Name group or value. |
POST /api/v1_groups.json HTTP/1.1
Host: storencash.com
token: 15da7169ee5272b97692ff680cab97f5
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
level_id=2&groups_parent_id=927&name=45
{
"status": "success",
"data": {
"id": 814
}
}
https://storencash.com/api/v1_groups.json
- Response formats
JSON
- Requires authentication?
Yes
Name | Require | Type | Description |
---|---|---|---|
id | no | bigint(10) | default = null. Level ID. |
level_id | no | bigint(10) | default = null. Parent group ID. |
name | no | varchar(80) | default = null. Name group or value. |
external_id | no | varchar(100) | default = null. External group ID. |
PUT /api/v1_groups.json/918 HTTP/1.1
Host: storencash.com
token: 15da7169ee5272b97692ff680cab97f5
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
name=%D1%81%D1%82%D0%B0%D1%80%D1%8B%D0%B52&offerId=10303-1
{
"status": "success",
"data": {
"id": 918
}
}
Тот же метод что и ADD groups за исключением обязательного параметра level_id если его не задать, создается новое дерево категорий
https://storencash.com/api/v1_category.json
- Response formats
JSON
- Requires authentication?
Yes
Name | Require | Type | Description |
---|---|---|---|
level_id | no | bigint(10) | default = null. Level ID. |
groups_parent_id | no | bigint(10) | default = null. Parent group ID. |
name | no | varchar(80) | default = 'empty'. Name group or value. |
POST /api/v1_category.json HTTP/1.1
Host: storencash.com
token: 15da7169ee5272b97692ff680cab97f5
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
name=new category
{
"status": "success",
"data": {
"id": 814
}
}
Тот же метод что и ADD groups за исключением обязательного параметра level_id если его не задать, создается новое дерево свойств
https://storencash.com/api/v1_property.json
- Response formats
JSON
- Requires authentication?
Yes
Name | Require | Type | Description |
---|---|---|---|
level_id | no | bigint(10) | default = null. Level ID. |
groups_parent_id | no | bigint(10) | default = null. Parent group ID. |
name | no | varchar(80) | default = 'empty'. Name group or value. |
POST /api/v1_property.json HTTP/1.1
Host: storencash.com
token: 15da7169ee5272b97692ff680cab97f5
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
name=new property
{
"status": "success",
"data": {
"id": 815
}
}
Уделение группы(категории или свойства). Проверяется наличие пруппы в остатках и номенклатуре, если все условия выполнены - группа удаляется, если нет - выдается соответсвующее сообщение. Если группа содержит деревья - проверяются все ноды перед удалением.
https://storencash.com/api/v1_groups.json
- Response formats
JSON
- Requires authentication?
Yes
Name | Require | Type | Description |
---|---|---|---|
id | yes | bigint(10) | default = null. Идентификатор удаляемой группы. |
DELETE /api/v1_groups.json/1 HTTP/1.1
Host: storencash.com
token: e1ec049b388fbc7f2f9dca44dcbfde06
Cache-Control: no-cache
{
"status": "success",
"data": {
"message": "ID:1 deleted"
}
}
Code | Description |
---|---|
'04001' | Данное свойство уже используется, удалять нельзя |
'04002' | Данной группы не найдено в справочнике |