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

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:

  • 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.

Enum: F_30_20, F_43_25, F_58_40, F_43_25_SINGLE

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:

  • Modules and API → block Sending data to Yandex.Market.
  • Query log → drop-down list in the block Show logs.

, 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 offerId to return a file with barcodes of specific products.

The request must contain either barcodeOfferInfos, or supplyRequestId but not both at once.

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 barcodeCount.
Information about barcodes.

Min items: 1

Max items: 100

supplyRequestId

Type: integer<int64>

Идентификатор заявки на поставку.

Передайте этот параметр, чтобы вернуть файл со штрихкодами товаров в указанной заявке на поставку. Вернутся штрихкоды каждого товара в заявке.

В запросе обязательно должен быть либо barcodeOfferInfos, либо supplyRequestId, но не оба сразу.

Min value: 1

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

BarcodeFormatType

Enum: F_30_20, F_43_25, F_58_40, F_43_25_SINGLE

BarcodeOfferInfoDTO

Information about barcodes.

Name

Description

barcodeCount*

Type: integer<int64>

The number of barcodes to print.

Min value: 1

Max value: 100

offerId*

Type: string

Your SKU — the product ID in your system.

Usage rules SKU:

  • For each product SKU there must be one.

  • Already set SKU it cannot be released and reused for another product. Each product should receive a new identifier that has never been used in your catalog before.

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: 1

Max length: 255

Pattern: ^(?=.*\S.*)[^\x00-\x08\x0A-\x1f\x7f]{1,255}$

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:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

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

ApiResponseStatusType

Enum: OK, ERROR

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.
The general error format.

Min items: 1

status

Type: ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

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.
The general error format.

Min items: 1

status

Type: ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

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.
The general error format.

Min items: 1

status

Type: ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

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.
The general error format.

Min items: 1

status

Type: ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

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.
The general error format.

Min items: 1

status

Type: ApiResponseStatusType

The type of response. Possible values:

  • OK — there are no mistakes.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

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