Product parameter API

Manage parameter values belonging to product groups and products - retrieve, list, save and delete

Base URL

https://{tenant}.logzi.com/api/product_param/

Every request returns a JSON response. On success result.code == 1, on error result.code == 0. This API manages the values of the parameters assigned to products. The definition of the available parameters (name, type, unit, category assignment) is contained in the Product parameter schema API; the values are linked to it through the param_schema_id field.

Group-level and product-level values

The value of a parameter can be specified on two levels:

Levelproduct_idDescription
Group levelnullThe value applies to every product of the product group (product_group_id). This is the usual, default level.
Product levelfilledThe value applies to a specific product, within the given product_group_id product group.

The get and save endpoints work on the appropriate level depending on whether product_id is provided: without product_id only the group-level value is taken into account.

Format of param_value by type

The value is interpreted according to the param_type_id field of the schema. It is stored as text, up to 1500 characters.

param_type_idTypeFormat of the value
1NumberA number written with a decimal point as text, e.g. "12.50". The number of displayed decimal places is given by the param_schema_round_decimal field of the schema, the unit by param_unit_id.
2TextFree text, e.g. "Red"
3Boolean"1" = yes, "0" = no
4Text linkA link as text, e.g. "https://example.com/datasheet.pdf"
5Value setJSON array of the selected values as text, e.g. "[\"Gluten\",\"Milk\"]". The items come from the param_enum list of the schema. When saving, param_value can also be provided directly as an array; the API stores it as text.

Fields of the value record

FieldTypeDescription
idintUnique identifier of the value record
param_schema_idintIdentifier of the parameter schema (Product parameter schema API)
param_valuestringThe value of the parameter (format according to the table above), up to 1500 characters
product_group_idintIdentifier of the product group
product_idintIdentifier of the product for a product-level value, null for a group-level value
GET /api/product_param/get

Retrieve a single parameter value. You can provide the identifier of the value (id) directly, or the combination of the product group and the schema. At least one parameter must be provided, otherwise the response is result.code == 0 with a Not found message.

Query parameters

ParameterTypeRequiredDescription
idintIdentifier of the value record
product_group_idintIdentifier of the product group
param_schema_idintIdentifier of the parameter schema
product_idintIdentifier of the product. When provided, it looks for the product-level value, otherwise only the group-level one.
The filters work with AND and the very first match is returned. For an exact, unique match use id, or the product_group_id and param_schema_id pair.

Example request

GET /api/product_param/get?product_group_id=120&param_schema_id=7
X-API-KEY: {your_api_key}

Example response

{
  "result": { "code": 1, "message": "success" },
  "data": {
    "id": 3451,
    "param_schema_id": 7,
    "param_value": "12.50",
    "product_group_id": 120,
    "product_id": null
  }
}
GET /api/product_param/list

List of parameter values, supplemented with the data of the schema. Values belonging to deleted (remove = 1) schemas are not shown. If there are no results, the response is result.code == 0 with a Not found message.

Query parameters

ParameterTypeRequiredDescription
list_condition[product_group_id]intFilter by the values of a product group
list_condition[product_id]intFilter by the product-level values of a product
list_condition[param_schema_id]intFilter by a parameter schema
list_condition[param_value_not_empty]intWith 1 only the filled (non-empty) values
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)
The list is not paginated, and without a filter it returns all parameter values of the tenant. With large master data this can be a large response, so it is advisable to use at least the product_group_id or the param_schema_id filter.

Additional response fields

The list items contain the fields of the Fields of the value record table, and additionally:

FieldTypeDescription
param_namestringName of the parameter from the schema
param_type_idintType of the parameter (1 = number, 2 = text, 3 = boolean, 4 = text link, 5 = value set)
param_type_namestringName of the parameter type
param_schema_round_decimalintNumber of decimal places for a number type parameter
unit_name_shortstringShort name of the unit, null if there is no unit
category_idintLegacy field, usually empty. The category assignment of the schema is given by the category_ids field of the Product parameter schema API.
category_namestringLegacy field, usually empty

Example request

GET /api/product_param/list?list_condition[product_group_id]=120&list_condition[param_value_not_empty]=1
X-API-KEY: {your_api_key}

Example response

{
  "result": { "code": 1, "message": "success" },
  "data": [
    {
      "id": 3451,
      "param_schema_id": 7,
      "param_value": "12.50",
      "product_group_id": 120,
      "product_id": null,
      "param_name": "Gross weight",
      "category_id": null,
      "param_type_id": 1,
      "param_schema_round_decimal": 2,
      "unit_name_short": "kg",
      "category_name": null,
      "param_type_name": "Number"
    },
    {
      "id": 3452,
      "param_schema_id": 9,
      "param_value": "[\"Gluten\",\"Milk\"]",
      "product_group_id": 120,
      "product_id": null,
      "param_name": "Allergens",
      "category_id": null,
      "param_type_id": 5,
      "param_schema_round_decimal": 0,
      "unit_name_short": null,
      "category_name": null,
      "param_type_name": "Value set"
    }
  ]
}
POST /api/product_param/save

Create or modify a parameter value. Providing the id is optional: if it is not provided, the system looks up the existing value based on product_group_id, param_schema_id and (if present) product_id and modifies it, and if there is none, it creates a new one. This way sending the same request multiple times does not create duplicate values.

POST fields - data object

FieldTypeRequiredDescription
idintIdentifier of an existing value record. If it is provided but does not exist, the request returns a Not found error.
param_schema_idintIdentifier of the parameter schema
product_group_idintIdentifier of the product group
param_valuestring | arrayThe value of the parameter in the format matching its type (see above). For the value set type an array can also be provided. An empty text ("") is also valid, in which case the value is cleared but the record is kept.
product_idintIdentifier of the product for saving a product-level value. If omitted, a group-level value is saved.
The product_id of an existing record cannot be removed or set to null by a modification: a product-level record stays product-level. A group-level value can be modified without providing product_id.

POST fields - params object (optional)

FieldTypeRequiredDescription
create_webhookint1 = after saving, a product upload event (webhook) is created for the active integrations where product upload is enabled, so the parameter change is also sent to the webshop. The event is created for synchronizable products: for a product-level value for that product, for a group-level value (without product_id) for all products of the product group. If an unsent event already exists for the product, no duplicate is created.

Example request - group-level number value

POST /api/product_param/save
X-API-KEY: {your_api_key}
Content-Type: application/json

{
  "data": {
    "param_schema_id": 7,
    "product_group_id": 120,
    "param_value": "12.50"
  },
  "params": {
    "create_webhook": 1
  }
}

Example request - product-level value

POST /api/product_param/save
X-API-KEY: {your_api_key}
Content-Type: application/json

{
  "data": {
    "param_schema_id": 2,
    "product_group_id": 120,
    "product_id": 845,
    "param_value": "Red"
  }
}

Example request - value set type value

POST /api/product_param/save
X-API-KEY: {your_api_key}
Content-Type: application/json

{
  "data": {
    "param_schema_id": 9,
    "product_group_id": 120,
    "param_value": ["Gluten", "Milk"]
  }
}

Example response

{
  "result": { "code": 1, "message": "success" },
  "data": {
    "id": 3451
  }
}
POST /api/product_param/delete

Delete a parameter value by identifier. The deletion is permanent: the record is removed (this does not affect the parameter schema). If you only want to clear the content of the value, use the save endpoint with an empty param_value.

POST fields

FieldTypeRequiredDescription
idintIdentifier of the parameter value record to delete

POST fields - params object (optional)

FieldTypeRequiredDescription
create_webhookint1 = after deleting, a product upload event (webhook) is created for the product of the deleted value, or for all products of the product group in case of a group-level value (see the save endpoint for details).

Example request

POST /api/product_param/delete
X-API-KEY: {your_api_key}
Content-Type: application/json

{
  "id": 3451,
  "params": {
    "create_webhook": 1
  }
}

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!