Updating size tables
The method is available for all models.
If you are using an API Key token, one of the accesses in the list is required to call the method
- offers-and-cards-management — Manage products and cards
- all-methods — Full account management
Completely replaces the names and contents of the size tables created by the business. In one request, you can update
up to 10 tables with a total of 5,000 cells. If there are more tables or cells, the request is rejected.
with an error BAD_REQUEST and not a single table is updated.
Передавайте полное содержимое таблицы
All missing rows and columns will be deleted.
Only tables created by the business can be changed., — they have a method in their response
POST v2/businesses/{businessId}/size-tables specified editable: true. If there is no table, it returns
mistake NOT_FOUND if this is a Market table (sizeTableType: STANDARD) — mistake FORBIDDEN.
The size characteristic of the table cannot be changed: columns and values are checked according to the characteristic specified
when creating the table. Dimensional grids and measurements that can be used in the table, their values and mandatory
grids returns the method POST v2/businesses/{businessId}/size-tables/charts.
Table IDs should not be repeated in a single query. If they repeat, the request is rejected.
with an error BAD_REQUEST and not a single table is updated.
Как заполнить таблицу
Each element rows — table row: one size in all size grids and dimensions. In values
pass one cell per column: the grid or measurement ID in sizeChartId or the name
in sizeChartName and the value in sizeValueId, sizeValue or in both fields. You can skip or transfer a cell without a value.
with an empty sizeValue — it will be saved as "no value".
Requirements for the table:
- The table must have at least one mandatory size grid (
required: true), otherwise the error will returnABSENT_MANDATORY_SIZE_CHART. Measurements and grids withrequired: falsethis requirement is not fulfilled. - Fill in every required grid in the table in all rows, otherwise an error will be returned.
EMPTY_CELL. - Each column must have at least one value, except for the empty one and "no value", otherwise an error will be returned.
NONE_COLUMN. If there is nothing to fill the column with, do not transfer its cells. - The strings must not match, otherwise an error will be returned.
DUPLICATE_ROWS. Are the values in the column allowed to be repeated? (DUPLICATE_SIZES,DUPLICATE_MEASURES), depends on the dimensional characteristics.
Чем сохраненная таблица отличается от переданной
Method POST v2/businesses/{businessId}/size-tables returns a table by column: for each value
there is a line number rowIndex. To get the rows, group the values by rowIndex.
The saved table may differ from the transmitted one:
- the rows and columns go in the order that the Market sets, and
rowIndexdoes not match the line number in the request. - the standard size grids return the text values from the reference book and its
sizeValueId; - Commas are replaced with dots in measurements.:
42,5→42.5; - cells with "no value" and non-transmitted cells are not returned;
- The spaces at the beginning and at the end of the name and values have been removed.
The values from the response can be passed to this method without modification: fields columnType and rowIndex it does not take into account.
Сохраняется содержимое из последнего запроса
The versions of the table are not compared. If the table was changed in the cabinet after you received it,
these changes will be overwritten without warning. Mistake CONCURRENT_MODIFICATION it is returned only if
the table was changed during the processing of your request. In this case, repeat the request.
The new contents of the table are applied to the products linked to it automatically after a while. You do not need to transfer the goods again.
If the query fails with the 5xx code, it can be repeated: the tables will be replaced with the same contents.
⚙️ Limit without subscription: 5 requests per minute ⭐️ Limit with Medium subscription: 10 requests per minute |
|---|
Request
POST
https://api.partner.market.yandex.ru/v2/businesses/{businessId}/size-tables/update
Path parameters
|
Name |
Description |
|
businessId |
Type: integer Cabinet ID. To find out, use the request GET v2/campaigns. ℹ️ What is a cabinet and a store on the Market? Min value: |
Body
application/json
{
"sizeTables": [
{
"sizeTableId": 1,
"sizeTableName": "example",
"rows": [
{
"values": [
null
]
}
]
}
]
}
|
Name |
Description |
||||||||||||||||
|
sizeTables |
Type: object[]
Size tables with new content. They are processed in order, each independently of the others. Table IDs should not be repeated in a single query. If the IDs are repeated, the request is not being processed. In total, in all tables — no more than 5000 cells. If there are more cells, the request is not processed. Min items: Max items: Example
|
Responses
200 OK
The results of updating the tables in the query order.
If at least one table could not be updated, the field status takes the value ERROR.
The remaining tables are processed and saved.
Body
application/json
{
"status": "OK",
"result": {
"results": [
{
"sizeTableId": 0,
"sizeTableName": "example",
"errors": [
null
]
}
]
}
}
Type: object
All of 2 types
-
Type: object
status
Type: string
The type of response. Possible values:
OK— There are no errors.ERROR— an error occurred while processing the request.
Enum:
OK,ERRORThe standard wrapper for server responses.
Example
{ "status": "OK" } -
Type: object
result
Type: object
results
Type: object[]
errors
Type: object[]
code
Type: string
Error code for saving the size chart:
INVALID_REQUEST— the table structure is broken: the name consists of only spaces, the cell withoutsizeChartIdandsizeChartName(rowIndex), repeat column in row, cell withoutsizeValueIdandsizeValueor a cell, in whichsizeChartNamedoesn't match the column namesizeChartId(rowIndex,sizeChartId).UNKNOWN_SIZE_CHART— dimensional grids or measurements fromsizeChartIdsnot among the available ones for the dimensional characteristics of the table, and the names fromsizeChartNamesthere was not exactly one such column.INVALID_SIZE_VALUE— the value does not match the column (rowIndex,sizeChartId).EMPTY_TABLE— there is not a single cell in the table. It is not returned for requests that match the schema. If there is only "no value" in the column, it returnsNONE_COLUMN.EMPTY_CELL— the required size grid cell is not filled (rowIndex,sizeChartId).NONE_COLUMN— in columns fromsizeChartIdsthere is no single value except "no value".DUPLICATE_ROWS— lines fromrowIndicesthey match.DUPLICATE_SIZES— the values are repeated in dimensional grids fromsizeChartIds. Depends on the size Characteristics: for some characteristics, the error returns when repeated in any grid, for others — only if there are repeats in all grids of the table.DUPLICATE_MEASURES— the values are repeated in the measurements fromsizeChartIds. Depends on the size Characteristics: For some characteristics, repetitions in measurements are allowed.ABSENT_MANDATORY_SIZE_CHART— There is no mandatory size grid in the table.LIMIT_TABLES— the business already has the maximum number of tables. Only during creation.NOT_FOUND— there is no table. Only when updating.FORBIDDEN— this is the Market table (sizeTableType: STANDARD), it cannot be changed. Only when updating.CONCURRENT_MODIFICATION— the table was changed during the request processing. Repeat the request. Only when updating.INTERNAL_ERROR— internal error, the table is not saved.
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_ERRORrowIndex
Type: integer
The number of the line with the error in
rowsthe request, starting from 0. It may not match withrowIndexthe saved table.Min value:
0rowIndices
Type: integer[] | null
The numbers of matching rows in
rowsthe request, starting from 0.Min items:
1Unique items:
trueExample
[ 0 ]sizeChartId
Type: integer
ID of the dimension grid or dimension that has an error in its column.
sizeChartIds
Type: integer[] | null
Identifiers of dimensional grids and measurements with an error in their columns.
Min items:
1Unique items:
trueExample
[ 0 ]sizeChartNames
Type: string[] | null
Column names from
sizeChartNamea query that does not have exactly one dimension grid or measurement.Min items:
1Unique items:
trueExample
[ "example" ]Errors that caused the table to not be saved.
First, the structure of the table, its columns, and cell values are checked. — mistakes
INVALID_REQUEST,UNKNOWN_SIZE_CHARTandINVALID_SIZE_VALUE. If there are any, other checks are not performed., therefore, other errors may return after the correction.Min items:
1Example
[ { "code": "INVALID_REQUEST", "rowIndex": 0, "sizeChartId": 0, "sizeChartIds": [ 0 ], "sizeChartNames": [ "example" ], "rowIndices": [ 0 ] } ]sizeTableId
Type: integer
ID of the saved size table.
sizeTableName
Type: string
The name of the saved size chart.
Example:
exampleThe results for the tables from the query are in the same order:
results[i]refers tosizeTables[i].Example
[ { "sizeTableId": 0, "sizeTableName": "example", "errors": [ { "code": "INVALID_REQUEST", "rowIndex": 0, "sizeChartId": 0, "sizeChartIds": [ 0 ], "sizeChartNames": [ "example" ], "rowIndices": [ 0 ] } ] } ]The results of saving the size tables.
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
The query contains incorrect data, and none of the tables are updated. More information about the error
Error code — BAD_REQUEST: the query does not match the method description or the table IDs are repeated.
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
The type of response. Possible values:
OK— There are no errors.ERROR— an error occurred while processing the request.
Enum:
OK,ERRORThe standard wrapper for server responses.
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
The error code.
Example:
examplemessage
Type: string
Description of the error.
Example:
exampleA list of errors.
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
A standard wrapper for server errors.
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
401 Unauthorized
The authorization data is not specified in the request. More information about the 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
The type of response. Possible values:
OK— There are no errors.ERROR— an error occurred while processing the request.
Enum:
OK,ERRORThe standard wrapper for server responses.
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
The error code.
Example:
examplemessage
Type: string
Description of the error.
Example:
exampleA list of errors.
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
A standard wrapper for server errors.
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
403 Forbidden
The authorization data is incorrect or access to the resource is prohibited. More information about the 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
The type of response. Possible values:
OK— There are no errors.ERROR— an error occurred while processing the request.
Enum:
OK,ERRORThe standard wrapper for server responses.
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
The error code.
Example:
examplemessage
Type: string
Description of the error.
Example:
exampleA list of errors.
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
A standard wrapper for server errors.
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
404 Not Found
The requested resource was not found. More information about the 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
The type of response. Possible values:
OK— There are no errors.ERROR— an error occurred while processing the request.
Enum:
OK,ERRORThe standard wrapper for server responses.
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
The error code.
Example:
examplemessage
Type: string
Description of the error.
Example:
exampleA list of errors.
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
A standard wrapper for server errors.
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
420 Method Failure
The resource access limit has been exceeded. More information about the 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
The type of response. Possible values:
OK— There are no errors.ERROR— an error occurred while processing the request.
Enum:
OK,ERRORThe standard wrapper for server responses.
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
The error code.
Example:
examplemessage
Type: string
Description of the error.
Example:
exampleA list of errors.
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
A standard wrapper for server errors.
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
500 Internal Server Error
Internal error of the Market. More information about the 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
The type of response. Possible values:
OK— There are no errors.ERROR— an error occurred while processing the request.
Enum:
OK,ERRORThe standard wrapper for server responses.
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
The error code.
Example:
examplemessage
Type: string
Description of the error.
Example:
exampleA list of errors.
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
A standard wrapper for server errors.
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -