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 generation PDF-a file with barcodes of the transferred goods or goods in the specified delivery request.

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

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 v2/campaigns or find it in the seller's office on the Market — click on your account icon → Settings and in the menu on the left, select APIs and modules:

  • block Campaign ID;
  • tab Query log → drop-down list in the block Show logs.

⚠️ Do not send the store ID instead, which is indicated in the seller's account on the Market next to the store name and in some reports.

barcodeOfferInfos

Type: object[]

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>

The application ID.

Used only in the API

It will not be possible to find applications in the seller's account on the Market. To do this, use marketplaceRequestId or warehouseRequestId.

Min value: 1

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

The type of response. Possible values:

  • OK — There are no errors.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

result

Type: object

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.

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

A list of errors.
The general error format.

Min items: 1

status

Type: string

The type of response. Possible values:

  • OK — There are no errors.
  • ERROR — an error occurred while processing the request.

Enum: OK, 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: object[]

A list of errors.
The general error format.

Min items: 1

status

Type: string

The type of response. Possible values:

  • OK — There are no errors.
  • 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: object[]

A list of errors.
The general error format.

Min items: 1

status

Type: string

The type of response. Possible values:

  • OK — There are no errors.
  • 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: object[]

A list of errors.
The general error format.

Min items: 1

status

Type: string

The type of response. Possible values:

  • OK — There are no errors.
  • 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: object[]

A list of errors.
The general error format.

Min items: 1

status

Type: string

The type of response. Possible values:

  • OK — There are no errors.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

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