创建大小表

方法适用于所有模式.

如果您使用API-Key令牌,调用该方法时需要具备列表中可用权限之一

创建业务规模表。 您可以在一个查询中创建最多10个表,总共不超过 5000个细胞。 如果有更多的表或单元格,则会拒绝请求并显示错误。 BAD_REQUEST 而不是一个单一的表 它没有被创造。

该表指的是一个尺寸特征,而不是一个类别。:它被选择为所有类别 具有相同的尺寸特性。

通过尺寸表选择方法返回类别的尺寸特征 POST v2/businesses/{businessId}/size-tables/suggest 在战场上 result.sizeParameterId,一个特征 现有表格 — 方法 POST v2/businesses/{businessId}/size-tables 在战场上 sizeParameterId. 如果请求包含维度特征的未知标识符,则拒绝该请求并出错。 UNKNOWN_SIZE_PARAMETER 并且没有创建表。

可在表格中使用的尺寸网格和测量值,它们的值和强制性网格 返回方法 POST v2/businesses/{businessId}/size-tables/charts.

Как заполнить таблицу

每个元素 rows — 表格行:所有尺寸网格和尺寸中的一个尺寸。 在 values 每列传递一个单元格:网格或测量ID sizeChartId 或名称 在 sizeChartName 和价值在 sizeValueId, sizeValue 或者在两个领域。 您可以跳过或传输没有值的单元格。 与一个空 sizeValue — 它将被保存为"无值"。

表的要求:

  • 表必须至少有一个强制大小网格(required: true),否则将返回错误 ABSENT_MANDATORY_SIZE_CHART. 测量和网格与 required: false 这一要求没有得到满足。
  • 在所有行中填写表中的每个所需网格,否则将返回错误。 EMPTY_CELL.
  • 每列必须至少有一个值,除了空值和"无值",否则将返回错误。 NONE_COLUMN. 如果没有任何东西可以填充列,请不要转移其单元格。
  • 字符串必须不匹配,否则将返回错误。 DUPLICATE_ROWS. 列中的值是否允许重复? (DUPLICATE_SIZES, DUPLICATE_MEASURES),取决于尺寸特性。
Чем сохраненная таблица отличается от переданной

方法 POST v2/businesses/{businessId}/size-tables 按列返回一个表:对于每个值 有行号 rowIndex. 若要获取行,请按以下方式对值进行分组 rowIndex.

保存的表可能与传输的表不同:

  • 行和列按照市场设置的顺序进行,并且 rowIndex 与请求中的行号不匹配。
  • 标准尺寸网格返回参考书和参考书的文本值。 sizeValueId;
  • 逗号替换为测量中的点。: 42,5 → 42.5;
  • 不返回具有"无值"的信元和非传输信元;
  • 名称和值开头和结尾的空格已被删除。

响应中的值可以不变地传递给size tables update方法。 POST v2/businesses/{businessId}/size-tables/update:字段 columnType 和 rowIndex 它没有考虑到。

要将表链接到产品,请将其ID传递给 value 特征与 parameterId: 73979829 在请求 POST v2/businesses/{businessId}/offer-cards/update. 更改表时,新内容将自动应用于链接的项。

Повторный запрос создает таблицы еще раз

该方法不是幂等的:每个查询都会创建新表,即使已经存在相同的表。

如果查询失败并出现5xx错误,则某些表可能已保存。 使用该方法获取业务表 POST v2/businesses/{businessId}/size-tables 然后才对不存在的表重复查询。

企业拥有的表的数量是有限的 — 总的来说,根据所有尺寸特性。 无法删除该表。 如果达到该限制,则不会创建表,并为其返回错误。 LIMIT_TABLES. 同时进行 在查询中没有严格检查该限制,并且可能会创建更多表。

⚙️ 没有订阅的限制: 5 请求 每分钟
⭐️ 使用中等订阅限制: 10 请求 每分钟

Request

POST

https://api.partner.market.yandex.ru/v2/businesses/{businessId}/size-tables/create

Path parameters

Name

Description

businessId

Type: integer

内阁ID。

Min value: 1

Body

application/json
{
  "sizeTables": [
    {
      "sizeParameterId": 1,
      "sizeTableName": "example",
      "rows": [
        {
          "values": [
            null
          ]
        }
      ]
    }
  ]
}

Name

Description

sizeTables

Type: object[]

rows

Type: object[]

values

Type: object[]

sizeChartId

Type: integer

维度网格的ID或来自方法响应的测量 POST v2/businesses/{businessId}/size-tables/charts. 网格和测量具有共同的标识符空间。 如未传送,则需要 sizeChartName.

Min value: 1

sizeChartName

Type: string

维度网格的名称或来自方法响应的测量 POST v2/businesses/{businessId}/size-tables/charts. 它不区分大小写,并在开始和结束时与空格进行比较。 如未传送,则需要 sizeChartId.

Min length: 1

Max length: 255

Example: example

sizeValue

Type: string

尺寸或测量的值。 在没有目录的列中 — 不超过20个字符。

Max length: 255

Example: example

sizeValueId

Type: integer

维网格参考值的ID。 只有市场的标准尺寸网格才有参考书。

Min value: 1

单元格是按任意顺序排列的行。 每个维度网格或测量 — 每行不超过一次, 否则,错误将返回 INVALID_REQUEST.

没有值的单元格可以省略或用空单元格传递。 sizeValue:它将被保存 就像"没有价值"。 这是强制尺寸网格中的错误。 EMPTY_CELL.

Min items: 1

Max items: 50

Example
[
  {
    "sizeChartId": 1,
    "sizeChartName": "example",
    "sizeValueId": 1,
    "sizeValue": "example"
  }
]

表的行:每个描述一个大小。 保存时,行顺序可能会更改。

Min items: 1

Max items: 200

Example
[
  {
    "values": [
      {
        "sizeChartId": 1,
        "sizeChartName": "example",
        "sizeValueId": 1,
        "sizeValue": "example"
      }
    ]
  }
]

sizeParameterId

Type: integer

表中的维度与之相关的维度特征的ID。

Min value: 1

sizeTableName

Type: string

尺寸图表的名称。 开头和结尾的空格将被删除。 名称仅由空格组成 — 错误 INVALID_REQUEST.

Min length: 1

Max length: 256

Example: example

尺寸表。 它们按顺序处理,每个都独立于其他。

在所有表中总计 — 不超过5000个细胞。 如果有更多的单元格,则不处理请求。

Min items: 1

Max items: 10

Example
[
  {
    "sizeParameterId": 1,
    "sizeTableName": "example",
    "rows": [
      {
        "values": [
          {}
        ]
      }
    ]
  }
]

Responses

200 OK

查询顺序创建表的结果。

如果无法创建至少一个表,则该字段 status 取值 ERROR. 其余的表被处理和保存。

Body

application/json
{
  "status": "OK",
  "result": {
    "results": [
      {
        "sizeTableId": 0,
        "sizeTableName": "example",
        "errors": [
          null
        ]
      }
    ]
  }
}

Type: object

All of 2 types
  • Type: object

    status

    Type: string

    响应的类型。 可能的值:

    • OK — 没有错误。
    • ERROR — 处理请求时出错。

    Enum: OK, ERROR

    服务器响应的标准包装器。

    Example
    {
      "status": "OK"
    }
    
  • Type: object

    result

    Type: object

    results

    Type: object[]

    errors

    Type: object[]

    code

    Type: string

    保存尺寸图的错误代码:

    • INVALID_REQUEST — 表结构被破坏:名称仅由空格组成,单元格没有 sizeChartId 和 sizeChartName (rowIndex),重复列行,单元格没有 sizeValueId 和 sizeValue 或细胞, 其中 sizeChartName 与列名不匹配 sizeChartId (rowIndex, sizeChartId).
    • UNKNOWN_SIZE_CHART — 尺寸网格或测量 sizeChartIds 不在可用的 对于表的大小特征,以及从 sizeChartNames 没有一个这样的专栏。
    • INVALID_SIZE_VALUE — 值与列不匹配(rowIndex, sizeChartId).
    • EMPTY_TABLE — 表中没有单个单元格。 它不会为与方案匹配的请求返回。 如果列中只有"无值",则返回 NONE_COLUMN.
    • EMPTY_CELL — 所需大小的网格单元未填充(rowIndex, sizeChartId).
    • NONE_COLUMN — 在列从 sizeChartIds 除了"没有价值"之外没有单一的价值。
    • DUPLICATE_ROWS — 来自 rowIndices 他们匹配。
    • DUPLICATE_SIZES — 这些值在尺寸网格中重复, sizeChartIds. 取决于尺寸 特征:对于某些特征,错误在任何网格中重复时返回,对于其他特征 — 只有在表格的所有网格中都有重复的情况下。
    • DUPLICATE_MEASURES — 这些值在测量中重复 sizeChartIds. 取决于尺寸 特性:对于某些特性,允许重复测量。
    • ABSENT_MANDATORY_SIZE_CHART — 表中没有强制尺寸网格。
    • LIMIT_TABLES — 该业务已经具有最大表数。 只有在创作过程中。
    • NOT_FOUND — 没有桌子。 只有在更新时。
    • FORBIDDEN — 这是市场表(sizeTableType: STANDARD),它不能改变。 只有在更新时。
    • CONCURRENT_MODIFICATION — 请求处理过程中更改了该表。 重复请求。 只有在更新时。
    • INTERNAL_ERROR — 内部错误,表不保存。

    Enum: INVALID_REQUEST, UNKNOWN_SIZE_CHART, INVALID_SIZE_VALUE, EMPTY_TABLE, EMPTY_CELL, NONE_COLUMN, DUPLICATE_ROWS, DUPLICATE_SIZES, DUPLICATE_MEASURES, ABSENT_MANDATORY_SIZE_CHART, LIMIT_TABLES, NOT_FOUND, FORBIDDEN, CONCURRENT_MODIFICATION, INTERNAL_ERROR

    rowIndex

    Type: integer

    错误的行的编号 rows 的请求,从0开始。 它可能与 rowIndex 保存的表。

    Min value: 0

    rowIndices

    Type: integer[] | null

    匹配行的数量 rows 的请求,从0开始。

    Min items: 1

    Unique items: true

    Example
    [
      0
    ]
    

    sizeChartId

    Type: integer

    在其列中有错误的维度网格或维度的ID。

    sizeChartIds

    Type: integer[] | null

    维网格的标识符和列中有错误的测量值.

    Min items: 1

    Unique items: true

    Example
    [
      0
    ]
    

    sizeChartNames

    Type: string[] | null

    列名来自 sizeChartName 不具有恰好一个维度网格或度量的查询。

    Min items: 1

    Unique items: true

    Example
    [
      "example"
    ]
    

    导致表无法保存的错误。

    首先,检查表的结构、列和单元格值。 — 错误 INVALID_REQUEST, UNKNOWN_SIZE_CHART 和 INVALID_SIZE_VALUE. 如果有,则不执行其他检查。, 因此,校正后可能返回其他错误。

    Min items: 1

    Example
    [
      {
        "code": "INVALID_REQUEST",
        "rowIndex": 0,
        "sizeChartId": 0,
        "sizeChartIds": [
          0
        ],
        "sizeChartNames": [
          "example"
        ],
        "rowIndices": [
          0
        ]
      }
    ]
    

    sizeTableId

    Type: integer

    保存的大小表的ID。

    sizeTableName

    Type: string

    保存的大小图表的名称。

    Example: example

    查询表的结果顺序相同: 结果[i] 指 尺寸表[i].

    Example
    [
      {
        "sizeTableId": 0,
        "sizeTableName": "example",
        "errors": [
          {
            "code": "INVALID_REQUEST",
            "rowIndex": 0,
            "sizeChartId": 0,
            "sizeChartIds": [
              0
            ],
            "sizeChartNames": [
              "example"
            ],
            "rowIndices": [
              0
            ]
          }
        ]
      }
    ]
    

    保存大小表的结果。

    Example
    {
      "results": [
        {
          "sizeTableId": 0,
          "sizeTableName": "example",
          "errors": [
            {
              "code": "INVALID_REQUEST",
              "rowIndex": 0,
              "sizeChartId": 0,
              "sizeChartIds": [
                null
              ],
              "sizeChartNames": [
                null
              ],
              "rowIndices": [
                null
              ]
            }
          ]
        }
      ]
    }
    
    Example
    {
      "result": {
        "results": [
          {
            "sizeTableId": 0,
            "sizeTableName": "example",
            "errors": [
              {}
            ]
          }
        ]
      }
    }
    

400 Bad Request

查询包含不正确的数据,并且没有创建表。 有关错误的更多信息

错误代码:

  • BAD_REQUEST — 请求与方法的描述不匹配:例如,超过了表、行或单元格的数量。
  • UNKNOWN_SIZE_PARAMETER — 其中一张桌子有 sizeParameterId 不是从可接受的值列表中。

Body

application/json
{
  "status": "OK",
  "errors": [
    {
      "code": "example",
      "message": "example"
    }
  ]
}

Type: object

All of 1 type
  • Type: object

    All of 2 types
    • Type: object

      status

      Type: string

      响应的类型。 可能的值:

      • OK — 没有错误。
      • ERROR — 处理请求时出错。

      Enum: OK, ERROR

      服务器响应的标准包装器。

      Example
      {
        "status": "OK"
      }
      
    • Type: object

      errors

      Type: object[]

      code

      Type: string

      的错误代码。

      Example: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "code": "example",
          "message": "example"
        }
      ]
      
      Example
      {
        "errors": [
          {
            "code": "example",
            "message": "example"
          }
        ]
      }
      

    服务器错误的标准包装器。

    Example
    {
      "status": "OK",
      "errors": [
        {
          "code": "example",
          "message": "example"
        }
      ]
    }
    

401 Unauthorized

请求中未指定授权数据。 有关错误的更多信息

Body

application/json
{
  "status": "OK",
  "errors": [
    {
      "code": "example",
      "message": "example"
    }
  ]
}

Type: object

All of 1 type
  • Type: object

    All of 2 types
    • Type: object

      status

      Type: string

      响应的类型。 可能的值:

      • OK — 没有错误。
      • ERROR — 处理请求时出错。

      Enum: OK, ERROR

      服务器响应的标准包装器。

      Example
      {
        "status": "OK"
      }
      
    • Type: object

      errors

      Type: object[]

      code

      Type: string

      的错误代码。

      Example: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "code": "example",
          "message": "example"
        }
      ]
      
      Example
      {
        "errors": [
          {
            "code": "example",
            "message": "example"
          }
        ]
      }
      

    服务器错误的标准包装器。

    Example
    {
      "status": "OK",
      "errors": [
        {
          "code": "example",
          "message": "example"
        }
      ]
    }
    

403 Forbidden

授权数据不正确或禁止访问资源。 有关错误的更多信息

Body

application/json
{
  "status": "OK",
  "errors": [
    {
      "code": "example",
      "message": "example"
    }
  ]
}

Type: object

All of 1 type
  • Type: object

    All of 2 types
    • Type: object

      status

      Type: string

      响应的类型。 可能的值:

      • OK — 没有错误。
      • ERROR — 处理请求时出错。

      Enum: OK, ERROR

      服务器响应的标准包装器。

      Example
      {
        "status": "OK"
      }
      
    • Type: object

      errors

      Type: object[]

      code

      Type: string

      的错误代码。

      Example: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "code": "example",
          "message": "example"
        }
      ]
      
      Example
      {
        "errors": [
          {
            "code": "example",
            "message": "example"
          }
        ]
      }
      

    服务器错误的标准包装器。

    Example
    {
      "status": "OK",
      "errors": [
        {
          "code": "example",
          "message": "example"
        }
      ]
    }
    

404 Not Found

找不到请求的资源。 有关错误的更多信息

Body

application/json
{
  "status": "OK",
  "errors": [
    {
      "code": "example",
      "message": "example"
    }
  ]
}

Type: object

All of 1 type
  • Type: object

    All of 2 types
    • Type: object

      status

      Type: string

      响应的类型。 可能的值:

      • OK — 没有错误。
      • ERROR — 处理请求时出错。

      Enum: OK, ERROR

      服务器响应的标准包装器。

      Example
      {
        "status": "OK"
      }
      
    • Type: object

      errors

      Type: object[]

      code

      Type: string

      的错误代码。

      Example: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "code": "example",
          "message": "example"
        }
      ]
      
      Example
      {
        "errors": [
          {
            "code": "example",
            "message": "example"
          }
        ]
      }
      

    服务器错误的标准包装器。

    Example
    {
      "status": "OK",
      "errors": [
        {
          "code": "example",
          "message": "example"
        }
      ]
    }
    

420 Method Failure

已超出资源访问限制。 有关错误的更多信息

Body

application/json
{
  "status": "OK",
  "errors": [
    {
      "code": "example",
      "message": "example"
    }
  ]
}

Type: object

All of 1 type
  • Type: object

    All of 2 types
    • Type: object

      status

      Type: string

      响应的类型。 可能的值:

      • OK — 没有错误。
      • ERROR — 处理请求时出错。

      Enum: OK, ERROR

      服务器响应的标准包装器。

      Example
      {
        "status": "OK"
      }
      
    • Type: object

      errors

      Type: object[]

      code

      Type: string

      的错误代码。

      Example: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "code": "example",
          "message": "example"
        }
      ]
      
      Example
      {
        "errors": [
          {
            "code": "example",
            "message": "example"
          }
        ]
      }
      

    服务器错误的标准包装器。

    Example
    {
      "status": "OK",
      "errors": [
        {
          "code": "example",
          "message": "example"
        }
      ]
    }
    

500 Internal Server Error

市场的内部错误。 有关错误的更多信息

Body

application/json
{
  "status": "OK",
  "errors": [
    {
      "code": "example",
      "message": "example"
    }
  ]
}

Type: object

All of 1 type
  • Type: object

    All of 2 types
    • Type: object

      status

      Type: string

      响应的类型。 可能的值:

      • OK — 没有错误。
      • ERROR — 处理请求时出错。

      Enum: OK, ERROR

      服务器响应的标准包装器。

      Example
      {
        "status": "OK"
      }
      
    • Type: object

      errors

      Type: object[]

      code

      Type: string

      的错误代码。

      Example: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "code": "example",
          "message": "example"
        }
      ]
      
      Example
      {
        "errors": [
          {
            "code": "example",
            "message": "example"
          }
        ]
      }
      

    服务器错误的标准包装器。

    Example
    {
      "status": "OK",
      "errors": [
        {
          "code": "example",
          "message": "example"
        }
      ]
    }