Getting a barcode file
The method is available for the FBY model.
If you are using an API Key token, one of the accesses in the list is required to call the method
- inventory-and-order-processing — Order processing and inventory
- all-methods — Full account management
Starts the generation of a PDF file with barcodes of the transferred goods or goods in the specified purchase order.
The file cannot be generated if it contains more than 1,500 barcodes.
You can find out the generation status and get a link to the finished file using a request. GET v2/reports/info/{reportId}.
⚙️ Limit: 1,000 requests per hour |
---|
Request
POST
https://api.partner.market.yandex.ru/v1/reports/documents/barcodes/generate
Body
application/json
{
"campaignId": 0,
"barcodeFormat": "F_30_20",
"barcodeOfferInfos": [
{
"offerId": "string",
"barcodeCount": 0
}
],
"supplyRequestId": 0
}
Name |
Description |
barcodeFormat* |
Type: BarcodeFormatType Page format and barcode size:
Enum: |
campaignId* |
Type: integer<int64> The campaign ID. You can find it using a query GET campaigns or find it in the seller's office on the Market — click on the name of your business and go to the page:
, Do not send the store's ID instead, which is indicated in the seller's account on the Market next to the store's name and in some reports. |
barcodeOfferInfos |
Type: BarcodeOfferInfoDTO[] The list of products. Pass this parameter and the unique The request must contain either If information about a product that has several barcodes is transmitted, all barcodes will be added to the file, their number will be set by the parameter Min items: Max items: |
supplyRequestId |
Type: integer<int64> Идентификатор заявки на поставку. Передайте этот параметр, чтобы вернуть файл со штрихкодами товаров в указанной заявке на поставку. Вернутся штрихкоды каждого товара в заявке. В запросе обязательно должен быть либо Min value: |
BarcodeFormatType
Page format and barcode size:
F_30_20
— A4, 30 × 20 mm barcodes.F_43_25
— A4, 43x25 mm barcodes.F_58_40
— A4, 58 × 40 mm barcodes.F_43_25_SINGLE
— for printing labels.
Type |
Description |
Enum: |
BarcodeOfferInfoDTO
Information about barcodes.
Name |
Description |
barcodeCount* |
Type: integer<int64> The number of barcodes to print. Min value: Max value: |
offerId* |
Type: string Your SKU — the product ID in your system. Usage rules SKU:
SKU The product can be changed in the seller's account on the Market. Read about how to do this. in the Help of the Market for sellers. What is SKU and how to assign it Min length: Max length: Pattern: |
Responses
200 OK
In response, you receive an identifier that allows you to find out the generation status and download the finished file.
Body
application/json
{
"status": "OK",
"result": {
"reportId": "string",
"estimatedGenerationTime": 0
}
}
Name |
Description |
status* |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
result |
Type: GenerateReportDTO The ID that will be needed to track the generation status and receive the finished report or document. |
ApiResponseStatusType
The type of response. Possible values:
OK
— there are no mistakes.ERROR
— an error occurred while processing the request.
Type |
Description |
Enum: |
GenerateReportDTO
The ID that will be needed to track the generation status and receive the finished report or document.
Name |
Description |
estimatedGenerationTime* |
Type: integer<int64> Expected generation time in milliseconds. |
reportId* |
Type: string The ID that will be needed to track the generation status and receive the finished report or document. |
400 Bad Request
The request contains incorrect data. More information about the error
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "string",
"message": "string"
}
]
}
Name |
Description |
errors |
Type: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
ApiErrorDTO
The general error format.
Name |
Description |
code* |
Type: string The error code. |
message |
Type: string Description of the error. |
401 Unauthorized
The authorization data is not specified in the request. More information about the error
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "string",
"message": "string"
}
]
}
Name |
Description |
errors |
Type: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
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": "string",
"message": "string"
}
]
}
Name |
Description |
errors |
Type: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
420 Method Failure
The resource access limit has been exceeded. More information about the error
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "string",
"message": "string"
}
]
}
Name |
Description |
errors |
Type: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
500 Internal Server Error
Internal error of the Market. More information about the error
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "string",
"message": "string"
}
]
}
Name |
Description |
errors |
Type: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
No longer supported, please use an alternative and newer version.