Creating a product list

Creates a product list.

Sample request body
--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

Counter ID.

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[]

List attributes.

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[]

List items.

Min items: 0

Max items: 160000

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

Attribute

Description of the Attribute object.

Name

Description

multivalued

Type: boolean

Determines whether the attribute can have multiple values.

name

Type: string

Attribute ID.

Min length: 1

Max length: 255

Pattern: ^[\w-:]+$

Example: example

humanized

Type: string

Attribute name.

Min length: 0

Max length: 4096

Example: example

type_group

Type: string

Attribute type group. Possible values:

  • PREDEFINED: Scalar attribute type. Examples of type_name values: numeric, date, datetime, email, and text.
  • CUSTOM_LIST: Arbitrary attribute type.
  • SYSTEM_LIST: Product list, type_name: product.

Example: example

type_humanized

Type: string

Attribute type name.

Example: example

type_name

Type: string

Attribute type ID.

Example: example

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

ListItem

Description of the ListItem object.

Name

Description

name

Type: string

List item ID.

Min length: 1

Max length: 255

Pattern: ^[\w-:]+$

Example: example

humanized

Type: string

List item name.

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

Result of performing the action.

Default: true

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