Создание списка товаров

Создает список товаров.

Пример тела запроса
--data '{
        "attributes": [],
        "items": [
            {
                "name": "pear",
                "humanized": "Груша"
            },
            {
                "name": "cherry",
                "humanized": "Вишня"
            },
            {
                "name": "apple",
                "humanized": "Яблоко"
            },
            {
                "name": "tomato",
                "humanized": "Томат"
            }
        ]
    }'

Request

POST

https://api-metrika.yandex.net/cdp/api/v1/counter/{counterId}/schema/products

Path parameters

Name

Description

counterId

Type: integer

Идентификатор счетчика.

Body

application/json
{
  "type": "example",
  "attributes": [
    {
      "name": "example",
      "type_name": "example",
      "type_group": "example",
      "type_humanized": "example",
      "multivalued": true,
      "humanized": "example"
    }
  ],
  "items": [
    {
      "name": "example",
      "humanized": "example"
    }
  ]
}

Name

Description

attributes

Type: Attribute[]

Атрибуты списка.

Min items: 0

Max items: 160000

Example
[
  {
    "name": "example",
    "type_name": "example",
    "type_group": "example",
    "type_humanized": "example",
    "multivalued": true,
    "humanized": "example"
  }
]

items

Type: ListItem[]

Элементы списка.

Min items: 0

Max items: 160000

Example
[
  {
    "name": "example",
    "humanized": "example"
  }
]

Attribute

Описание объекта Attribute.

Name

Description

multivalued

Type: boolean

Определяет, может ли атрибут иметь несколько значений.

name

Type: string

Идентификатор атрибута.

Min length: 1

Max length: 255

Pattern: ^[\w-:]+$

Example: example

humanized

Type: string

Название атрибута.

Min length: 0

Max length: 4096

Example: example

type_group

Type: string

Группа типа атрибута. Возможные значения:

  • PREDEFINED — скалярный тип атрибута. Примеры значений type_name: numeric, date, datetime, email, text.
  • CUSTOM_LIST — произвольный тип атрибута.
  • SYSTEM_LIST — список продуктов, type_name: product.

Example: example

type_humanized

Type: string

Название типа атрибута.

Example: example

type_name

Type: string

Идентификатор типа атрибута.

Example: example

Example
{
  "name": "example",
  "type_name": "example",
  "type_group": "example",
  "type_humanized": "example",
  "multivalued": true,
  "humanized": "example"
}

ListItem

Описание объекта ListItem.

Name

Description

name

Type: string

Идентификатор элемента списка.

Min length: 1

Max length: 255

Pattern: ^[\w-:]+$

Example: example

humanized

Type: string

Название элемента списка.

Min length: 0

Max length: 4096

Example: example

Example
{
  "name": "example",
  "humanized": "example"
}

Responses

200 OK

OK

Body

application/json
{
  "success": true
}

Name

Description

success

Type: boolean

Результат выполнения операции.

Default: true

No longer supported, please use an alternative and newer version.