Product parameter schema API

Manage the schema of custom parameters assignable to products - retrieve, list, save and delete

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

FieldTypeDescription
idintUnique identifier of the schema
param_namestringName of the parameter (up to 150 characters)
param_type_idintType of the parameter value (see below)
param_schema_type_idintScope of the schema (see below)
param_schema_codestringUnique schema code (up to 50 characters), optional
param_unit_idintIdentifier of the unit, null if there is no unit
param_orderintDisplay order
param_schema_round_decimalintNumber of decimal places for a number type parameter (0-5)
param_enumstringJSON array of the selectable values as text (up to 1000 characters), filled only when param_type_id = 5, otherwise null
param_type_usableintType-based usability flag (0 = no, 1 = yes)
param_fusionintMerge 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_showintWhether it is displayed in the cash register (0 = no, 1 = yes)
param_schema_column_idintIdentifier of the product data column the parameter value is linked to (automatic filling, import). null if not specified.
category_idintLegacy field, not filled for newer schemas. The category assignment is handled by the category_ids field.
removeintDeletion flag (0 = active, 1 = deleted)

Possible values of param_type_id

ValueNameDescription
1NumberNumeric value, optionally with a unit (param_unit_id) and a number of decimal places (param_schema_round_decimal)
2TextFree text value
3BooleanYes / no value
4Text linkText value treated as a link
5Value setMultiple values can be selected from a predefined set of possible values (param_enum)

Possible values of param_schema_type_id

ValueNameDescription
1By categoryThe category of the product (and its parent categories) determines whether the parameter is displayed (default)
2DirectNot bound to a category, it must be explicitly added to the given product / product group
3GlobalAutomatically displayed on the data sheet of every product, regardless of category
GET /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

ParameterTypeRequiredDescription
idintUnique 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
  }
}
GET /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

ParameterTypeRequiredDescription
list_offsetintNumber of results to skip (default: 0). The number of results cannot be limited.
list_condition[name]stringFilter by the name of the schema (partial match)
list_condition[parent_category_id]intFilter 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]arrayFilter for schemas assigned to the given product categories
list_condition[category_id]intLegacy 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]int1 = 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]intSchemas 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]intSame as the previous one, but for a specific product. If both are provided, the product_group_id variant takes effect.
The 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:

FieldTypeDescription
param_type_namestringName of the parameter type
unit_name_shortstringShort name of the unit, null if there is no unit
category_idsstringIdentifiers of the assigned product categories separated by commas (e.g. "3,8,12")
category_namestringPaths 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 }
}
POST /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

FieldTypeRequiredDescription
idint0 = new schema, >0 = modify
param_namestringName of the parameter (up to 150 characters)
param_type_idintType of the parameter (1 = number, 2 = text, 3 = boolean, 4 = text link, 5 = value set)
param_schema_type_idintScope of the schema (1 = by category, 2 = direct, 3 = global). Default: 1
param_schema_codestringSchema code (up to 50 characters)
param_unit_idintIdentifier of the unit. With 0 or an empty value there is no unit.
param_orderintDisplay order (default: 0)
param_schema_round_decimalintNumber of decimal places for a number type (param_type_id = 1) parameter, between 0 and 5 (default: 0)
param_enumarrayArray 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_usableintType-based usability flag: 0 = no, 1 = yes (default: 0)
param_fusionintMerge flag: 0 = no, 1 = yes (default: 0)
param_schema_cash_register_showintWhether it should be displayed in the cash register: 0 = no, 1 = yes (default: 0)
param_schema_column_idintIdentifier 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_idsarrayArray 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.
A modification overwrites the entire data of the schema: omitted optional fields are reset to their default values (e.g. 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
  }
}
POST /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

FieldTypeRequiredDescription
idintIdentifier 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": {}
}

Get in touch with us

Interested in our software? Feel free to write to us!

Need help?

If you can't find the answer and need assistance

Create your account now,
pay later!

Try it free for 3 days, no risk, no obligation!