Base URL
https://{tenant}.logzi.com/api/product_param_schema/
Every request returns a JSON response. On success result.code == 1, on error result.code == 0. The schema defines which custom parameters (e.g. technical attributes, dimensions) can belong to products: name, type, unit, order and category assignment. The actual values of the parameters are managed by the Product parameter API.
Schema fields
| Field | Type | Description |
|---|---|---|
id | int | Unique identifier of the schema |
param_name | string | Name of the parameter (up to 150 characters) |
param_type_id | int | Type of the parameter value (see below) |
param_schema_type_id | int | Scope of the schema (see below) |
param_schema_code | string | Unique schema code (up to 50 characters), optional |
param_unit_id | int | Identifier of the unit, null if there is no unit |
param_order | int | Display order |
param_schema_round_decimal | int | Number of decimal places for a number type parameter (0-5) |
param_enum | string | JSON array of the selectable values as text (up to 1000 characters), filled only when param_type_id = 5, otherwise null |
param_type_usable | int | Type-based usability flag (0 = no, 1 = yes) |
param_fusion | int | Merge flag (0 = no, 1 = yes): product groups can be merged based on the identical value of such schemas (e.g. during webshop synchronization) |
param_schema_cash_register_show | int | Whether it is displayed in the cash register (0 = no, 1 = yes) |
param_schema_column_id | int | Identifier of the product data column the parameter value is linked to (automatic filling, import). null if not specified. |
category_id | int | Legacy field, not filled for newer schemas. The category assignment is handled by the category_ids field. |
remove | int | Deletion flag (0 = active, 1 = deleted) |
Possible values of param_type_id
| Value | Name | Description |
|---|---|---|
1 | Number | Numeric value, optionally with a unit (param_unit_id) and a number of decimal places (param_schema_round_decimal) |
2 | Text | Free text value |
3 | Boolean | Yes / no value |
4 | Text link | Text value treated as a link |
5 | Value set | Multiple values can be selected from a predefined set of possible values (param_enum) |
Possible values of param_schema_type_id
| Value | Name | Description |
|---|---|---|
1 | By category | The category of the product (and its parent categories) determines whether the parameter is displayed (default) |
2 | Direct | Not bound to a category, it must be explicitly added to the given product / product group |
3 | Global | Automatically displayed on the data sheet of every product, regardless of category |
/api/product_param_schema/get
Retrieve a single product parameter schema by identifier. A deleted (remove = 1) schema is also returned, its state is indicated by the remove field. If the schema does not exist, the response is result.code == 0 with a Not found message.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | int | Unique identifier of the parameter schema |
Example request
GET /api/product_param_schema/get?id=7
X-API-KEY: {your_api_key}
Example response
{
"result": { "code": 1, "message": "success" },
"data": {
"id": 7,
"category_id": null,
"param_type_id": 1,
"param_name": "Gross weight",
"param_type_usable": 0,
"param_fusion": 0,
"param_enum": null,
"remove": 0,
"param_schema_cash_register_show": 0,
"param_order": 1,
"param_schema_column_id": null,
"param_unit_id": 4,
"param_schema_type_id": 1,
"param_schema_code": "WEIGHT_GROSS",
"param_schema_round_decimal": 2
}
}
/api/product_param_schema/list
List of product parameter schemas (excluding deleted schemas), sorted by display order and identifier. Besides the schema fields, the response also contains the data of the parameter type, the unit and the assigned categories. If there are no results, the response is result.code == 0 with a Not found message.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
list_offset | int | Number of results to skip (default: 0). The number of results cannot be limited. | |
list_condition[name] | string | Filter by the name of the schema (partial match) | |
list_condition[parent_category_id] | int | Filter by a product category and all of its subcategories: schemas assigned to this category or any of its descendants are returned | |
list_condition[category_ids] | array | Filter for schemas assigned to the given product categories | |
list_condition[category_id] | int | Legacy filter for the old category_id field of the schema (not filled for newer schemas, so it usually returns no results). For filtering by category use the category_ids or parent_category_id filter. | |
list_condition[param_schema_cash_register_show] | int | 1 = only schemas displayed in the cash register, 2 = only schemas not displayed in the cash register | |
list_condition[param_schema_type_id_fixer_product_group_id] | int | Schemas belonging to a product group: global (param_schema_type_id = 3) schemas, as well as by-category and direct schemas that have a non-empty value for the given product group | |
list_condition[param_schema_type_id_fixer_product_id] | int | Same as the previous one, but for a specific product. If both are provided, the product_group_id variant takes effect. |
category_ids filter and the two *_fixer_* filters are combined with each other using OR, the other filters work with AND.
Additional response fields
The list items contain all fields of the Schema fields table above, and additionally:
| Field | Type | Description |
|---|---|---|
param_type_name | string | Name of the parameter type |
unit_name_short | string | Short name of the unit, null if there is no unit |
category_ids | string | Identifiers of the assigned product categories separated by commas (e.g. "3,8,12") |
category_name | string | Paths of the assigned product categories separated by the | character |
The params field of the response contains the list_count, list_offset and list_all (the number of results) values.
Example request
GET /api/product_param_schema/list?list_condition[parent_category_id]=3
X-API-KEY: {your_api_key}
Example response
{
"result": { "code": 1, "message": "success" },
"data": [
{
"id": 7,
"category_id": null,
"param_type_id": 1,
"param_name": "Gross weight",
"param_type_usable": 0,
"param_fusion": 0,
"param_enum": null,
"remove": 0,
"param_schema_cash_register_show": 0,
"param_order": 1,
"param_schema_column_id": null,
"param_unit_id": 4,
"param_schema_type_id": 1,
"param_schema_code": "WEIGHT_GROSS",
"param_schema_round_decimal": 2,
"param_type_name": "Number",
"unit_name_short": "kg",
"category_ids": "3,8",
"category_name": "Food | Food/Bakery"
},
{
"id": 9,
"category_id": null,
"param_type_id": 5,
"param_name": "Allergens",
"param_type_usable": 0,
"param_fusion": 0,
"param_enum": "[\"Gluten\",\"Milk\",\"Egg\"]",
"remove": 0,
"param_schema_cash_register_show": 1,
"param_order": 2,
"param_schema_column_id": null,
"param_unit_id": null,
"param_schema_type_id": 1,
"param_schema_code": null,
"param_schema_round_decimal": 0,
"param_type_name": "Value set",
"unit_name_short": null,
"category_ids": "3",
"category_name": "Food"
}
],
"params": { "list_count": 999999, "list_offset": 0, "list_all": 2 }
}
/api/product_param_schema/save
Create or modify a product parameter schema. For a new schema use data[id] = 0; to modify, provide the existing identifier.
POST fields - data object
| Field | Type | Required | Description |
|---|---|---|---|
id | int | 0 = new schema, >0 = modify | |
param_name | string | Name of the parameter (up to 150 characters) | |
param_type_id | int | Type of the parameter (1 = number, 2 = text, 3 = boolean, 4 = text link, 5 = value set) | |
param_schema_type_id | int | Scope of the schema (1 = by category, 2 = direct, 3 = global). Default: 1 | |
param_schema_code | string | Schema code (up to 50 characters) | |
param_unit_id | int | Identifier of the unit. With 0 or an empty value there is no unit. | |
param_order | int | Display order (default: 0) | |
param_schema_round_decimal | int | Number of decimal places for a number type (param_type_id = 1) parameter, between 0 and 5 (default: 0) | |
param_enum | array | Array of selectable values. It is only saved when param_type_id = 5 (stored as JSON, up to 1000 characters); for other types the system clears it. | |
param_type_usable | int | Type-based usability flag: 0 = no, 1 = yes (default: 0) | |
param_fusion | int | Merge flag: 0 = no, 1 = yes (default: 0) | |
param_schema_cash_register_show | int | Whether it should be displayed in the cash register: 0 = no, 1 = yes (default: 0) | |
param_schema_column_id | int | Identifier of the product data column. When modifying, it overwrites the previous one only with a value greater than 0; the link cannot be removed by a modification. | |
category_ids | array | Array of identifiers of the product categories the schema belongs to. When provided, the previous category assignments of the schema are completely replaced (an empty array removes all of them). If the field is omitted, the assignments do not change. |
param_order = 0, param_schema_type_id = 1, param_schema_code = null). Therefore always send all fields of the schema when modifying.
Example request - number type parameter
POST /api/product_param_schema/save
X-API-KEY: {your_api_key}
Content-Type: application/json
{
"data": {
"id": 0,
"param_name": "Gross weight",
"param_type_id": 1,
"param_schema_type_id": 1,
"param_schema_code": "WEIGHT_GROSS",
"param_unit_id": 4,
"param_order": 1,
"param_schema_round_decimal": 2,
"category_ids": [3, 8]
}
}
Example request - value set type parameter
POST /api/product_param_schema/save
X-API-KEY: {your_api_key}
Content-Type: application/json
{
"data": {
"id": 0,
"param_name": "Allergens",
"param_type_id": 5,
"param_enum": ["Gluten", "Milk", "Egg"],
"param_schema_type_id": 3,
"param_schema_cash_register_show": 1,
"param_order": 2
}
}
Example response
{
"result": { "code": 1, "message": "success" },
"data": {
"id": 9
}
}
/api/product_param_schema/delete
Delete a product parameter schema by identifier. The deletion is logical: the schema is marked with remove = 1 and is no longer returned by the list. The category assignments of the schema and the parameter values belonging to it are kept, but the values of the deleted schema are not shown in the list of the Product parameter API either.
POST fields
| Field | Type | Required | Description |
|---|---|---|---|
id | int | Identifier of the parameter schema to delete |
Example request
POST /api/product_param_schema/delete
X-API-KEY: {your_api_key}
Content-Type: application/json
{
"id": 9
}
Example response
{
"result": { "code": 1, "message": "success" },
"data": {}
}
Create your account now,
pay later!