Catalog.getAttributeSets

Request the Catalog attribute sets (and their attributes & options) from the shop system.

This method is called during Sync Agent update. Attribute Sets and Attributes in SC database will be updated to data of the response. Note that attributes listed in this response can override data from Catalog.getAttributes meaning every attribute. For missing attributes 'srcid' and 'globalidentifier' will be set to null. New attributes will be added.

Request

JSON Example

[
  {
      "api":1,
      "method":"auth",
      "params":{
         "username":"...",
         "password":"..."
      },
      "id":1
   },
   {
    "api": 1,
    "method": "Catalog.getAttributeSets",
    "params": {},
    "id": 1
  }
]

Response

Response sends all attribute sets, including attributes and options (attributes that do not belong to a set must not be included, as they must be retrieved with Catalog.getAttributes).

[
   {  
      "api":1,
      "result": [
            {
                "setId": 1,
                "name": "name of the set #1",
                "label": "label of the set #1",
                "globalIdentifier": "global id #1",
                "attributes": [
                    {
                        "attributeId": 10,
                        "globalIdentifier": "global id of #10",
                        "name": "name of the attribute #10",
                        "label": "label of the attribute #10",
                        "description": "description of the attribute #10",
                        "productType": "type of product",
                        "attributeType": "type of attribute",
                        "maxLength": 20,
                        "decimalPlaces": 2,
                        "defaultValue": "default value of the attribute #10",
                        "uniqueValue": "unique value of the attribute #10",
                        "inputType": "type of input",
                        "inputMode": "mode of input",
                        "validation": "validation",
                        "mandatory": true,
                        "mandatoryImport": false,
                        "options": [
                            {
                                "optionId": 100,
                                "globalIdentifier": "global id #100",
                                "name": "name of the option #100",
                                "position": 0,
                                "isDefault": true
                            },
                            {
                                "optionId": 101,
                                "globalIdentifier": "global id #101",
                                "name": "name of the option #101",
                                "position": 1,
                                "isDefault": false
                            },
                        ]
                    },
                    {
                        "attributeId": 11,
                        "globalIdentifier": "global id of #11",
                        "name": "name of the attribute #11",
                        "label": "label of the attribute #11",
                        "description": "description of the attribute #11",
                        "productType": "type of product",
                        "attributeType": "type of attribute",
                        "maxLength": 20,
                        "decimalPlaces": 2,
                        "defaultValue": "default value of the attribute #11",
                        "uniqueValue": "unique value of the attribute #11",
                        "inputType": "type of input",
                        "inputMode": "mode of input",
                        "validation": "validation",
                        "mandatory": true,
                        "mandatoryImport": false,
                        "options": [
                            {
                                "optionId": 110,
                                "globalIdentifier": "global id #110",
                                "name": "name of the option #110",
                                "position": 0,
                                "isDefault": true
                            },
                            {
                                "optionId": 111,
                                "globalIdentifier": "global id #111",
                                "name": "name of the option #111",
                                "position": 1,
                                "isDefault": false
                            },
                        ]
                    }
                ]
            },
            {
                "setId": 2,
                "name": "name of the set #2",
                "label": "label of the set #2",
                "attributes": [
                    {
                        "attributeId": 20,
                        "name": "name of the attribute #20",
                        "label": "label of the attribute #20",
                        "productType": "type of product",
                        "attributeType": "type of attribute",
                        "inputType": "type of input",
                        "mandatory": true,
                        "options": [
                            {
                                "optionId": 200,
                                "name": "name of the option #200"
                            },
                            {
                                "optionId": 201,
                                "name": "name of the option #201"
                            },
                        ]
                    },
                    {
                        "attributeId": 21,
                        "name": "name of the attribute #21",
                        "label": "label of the attribute #21",
                        "productType": "type of product",
                        "attributeType": "type of attribute",
                        "inputType": "type of input",
                        "mandatory": false
                    }
                ]
            },
        ]
    }
]

Make sure values are properly encoded in the types specified below, as the Sync Agent client will not do any automatic conversion. Using strings instead of integers (eg.: "42" instead of 42), or integers instead of booleans (1 instead of true) will result in a validation error during sync.

Attribute sets' fields:

Field name

Type

Mandatory

Description

setId

integer

yes

id of the attribute set in the Shop system

globalIdentifier

varchar(255)

no

identifier of the attribute set, unique across all country databases for your Shop system 1)

name

varchar(50)

yes

internal name of the attribute set

label

varchar(50)

yes

visible name of the attribute set

attributes

array of attributes

yes

see table below

Attributes' fields:

Field name

Type

Mandatory

Description

attributeId

integer

yes

id of the attribute in the Shop system

globalIdentifier

varchar(255)

no

identifier of the attribute, unique across all country databases for your Shop system 1)

name

varchar(255)

yes

internal name of the attribute

label

varchar(255)

yes

visible name of the attribute

description

text

no

optional description of the attribute

productType

enum ('config', 'simple', 'source')

yes

type of product this attribute applies to

attributeType

enum ('system', 'option', 'multi_option', 'value', 'custom')

yes

type of attribute

maxLength

integer

no

maximum length of attribute value

decimalPlaces

integer

no

maximum number of decimal places for numeric attribute value

defaultValue

varchar(255)

no

default value of the attribute

uniqueValue

enum ('global', 'config')

no

scope of uniqueness of attribute's values

inputType

enum ('textfield', 'textarea', 'numberfield', 'datefield', 'datetime', 'checkbox', 'dropdown', 'multiselect', 'combo', 'multicombo', 'pricecost')

yes

type of input to render for edit form; corresponds to "pet_type" column in the Shop system

inputMode

enum ('edit', 'display', 'invisible', 'editoncreate')

no

visibility options for input; corresponds to "pet_mode" column in the Shop system

validation

enum ('decimal', 'integer', 'percent', 'letters', 'lettersnumbers')

no

validation type for edit form

mandatory

boolean

yes

whether the attribute is required for products

mandatoryImport

boolean

no

whether the attribute is required during import

options

array of options

no

Only for attributeType "option" or "multi_option"

Attribute options' fields:

Field Name

Type

Mandatory

Description

optionId

integer

yes

id of the attribute option in the Shop system

globalIdentifier

varchar(255)

no

identifier of the attribute, unique across all country databases for your Shop system 1)

name

varchar(255)

yes

name of the option

position

integer

no

position of the option

isDefault

boolean

no

whether this is a default option for the attribute

1) not used by all shop systems