--- title: "Generate barcodes (Shipment)" slug: "shp-generate-barcodes-actor" updated: 2026-04-02T08:08:41Z published: 2026-04-02T08:08:41Z canonical: "docs.lobstersoftware.com/shp-generate-barcodes-actor" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Generate barcodes (Shipment) *See also:* [Generate barcodes](/v1/docs/en/cmn-generate-barcodes-actor), [Generate barcodes (Order)](/v1/docs/en/ord-generate-barcodes-actor) > [!NOTE] > Event action – Abstract > > **Purpose:** Fills barcode attributes of line items of a shipment with values from a number range. Optionally, the number of barcode attributes within a line item is synchronized with the 'Number of packages' of the same line item by adding or removing barcode attributes, if necessary. > > > [!TIP] > > Tooltip > > > > - **Usage:** The event action must be executed with a shipment as the *reference* *object*. The **Line** **items** and **Line item types** parameters define *relevant* *line* *items* in the *reference* *object*. For these, the number of barcode attributes contained is regulated depending on the **Sync** **barcodes** **with number of packages** option. As far as a number range is assigned for the selected [Number range type](/v1/docs/en/core-number-range-type), barcode attributes without a barcode value are filled from this number range. > > - **Parameter:** > > - The required selection for the **Number range type** defines which of the configured [Number range](/v1/docs/en/core-number-range) barcodes are to be obtained in order to fill barcode attributes without a barcode value. > > - If the **Sync barcodes with number of packages** option is selected, barcode attribute instances are added or removed, if necessary, so that the number of barcodes in a line item corresponds to the 'Number of packages'. > > - Two parameters are available for defining the *relevant line items* within the *reference* *object*, which can be used alternatively: > > - The **Line** **items** parameter can be used to define an explicit list of line items by value explorer. > > - The multiple selection for **Line item types** allows a general selection of line items by [Line item type](/v1/docs/en/base-line-item-type). > > - If none of the parameters are used, all line items with the [Line item type](/v1/docs/en/base-line-item-type) 'Default' (`DEFAULT`) are considered relevant. > > - **Output:** In relevant line items, barcode attributes without a barcode value are assigned a barcode from a number range. Optionally, 'missing' barcode attributes are added or 'surplus' ones are removed. ![images/download/attachments/177912634/image-2024-9-19_11-56-12-version-1-modificationdate-1726739771679-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-9-19_11-56-12-version-1-modificationdate-1726739771679-api-v2.png) The [Generate barcodes (Shipment)](/v1/docs/en/shp-generate-barcodes-actor) event action generates barcodes via a specific [Number range type](/v1/docs/en/core-number-range-type) (see [Number range](/v1/docs/en/core-number-range)) in order to assign these 'empty' instances of barcode attributes to *relevant line items of a reference object* of the [Shipments](/v1/docs/en/shp-shipment) type as 'barcode' (`barcode`). *Relevant line items* can alternatively be defined using one of the following methods. - The **Line items** parameter allows an explicit definition of the *relevant line items* via a [Resolvers](/v1/docs/en/core-i-value-resolver) that provides a list of **Line items** (e.g. [Direct line items](/v1/docs/en/base-get-line-items-resolver) and/or [Rule list resolver](/v1/docs/en/core-list-rule-resolver)). - The **Line item types** parameter defines one or more **Line item types** by multiple selection (see [Line item type](/v1/docs/en/base-line-item-type)). All line items that belong to a selected [Line item type](/v1/docs/en/base-line-item-type) are considered to be *relevant*. - If no information is available for any of these parameters, all line items with the [Line item type](/v1/docs/en/base-line-item-type) 'Default' (`DEFAULT`) are considered relevant. All *relevant line items* are processed according to the following schema: 1. If the **Sync barcodes with number of packages** option is selected in the [Generate barcodes (Shipment)](/v1/docs/en/shp-generate-barcodes-actor), the number of barcode attribute instances within the line item is matched to the 'number of packages' (`numberOfPackages`): 1. If the line item currently contains more barcode attribute instances than the **Number of packages** field specifies, then 'excess' instances of the barcode attribute are removed from the end of the list. It does not matter if they are already assigned barcodes. 2. If the item currently contains fewer barcode attribute instances than the **Number of packages** field indicates, then additional instances of the barcode attribute are added to the list at the end. 2. All barcode attributes contained in the item whose 'Barcode' (`barcode`) field is empty are assigned an automatically generated value depending on the specified [Number range type](/v1/docs/en/core-number-range-type). **NOTE:** Which of the [Number range](/v1/docs/en/core-number-range) configured for the selected [Number range type](/v1/docs/en/core-number-range-type) are used to generate barcode values depends on the evaluation of their [Association criteria](/v1/docs/en/core-association-criteria) according to the *best-matching* principle. **IMPORTANT:** If no number range is assigned for the [Number range type](/v1/docs/en/core-number-range-type) for the call context or the assigned number range does not provide any more values, some or all 'Barcode' fields will not be populated. If this results in barcode duplicates for the same line item, the *reference* *object* cannot be saved in this state (see 'Barcode attributes background', above). **NOTE:** For background information on barcodes and an illustrative runtime example, see the page for the [Common business object](/v1/docs/en/orchestration-common-bto): - [Generate barcodes](/v1/docs/en/cmn-generate-barcodes-actor) ## Configuration The [Generate barcodes (Shipment)](/v1/docs/en/shp-generate-barcodes-actor) event action expects a shipment (see [Shipments](/v1/docs/en/shp-shipment)) as the *reference* *object*. In the context of another object type, the event action has no effect without an error occurring at runtime. | The selection for the **Number range type** parameter (required field) controls which [Number range](/v1/docs/en/core-number-range) are candidates for generating barcode values. The selection is made by association according to the *best-matching* principle (see [Association criteria](/v1/docs/en/core-association-criteria)). The **Sync barcodes with number of packages** option can be selected to ensure that the number of barcode attribute instances exactly matches the 'number of packages' (`numberOfPackages`) of the line item for all relevant line items. Based on the given 'Number of packages' line items, 'surplus' barcode attribute instances are removed or 'missing' ones are added as required for this purpose and automatically assigned a barcode value from the applicable number range. The **Sync barcodes with number of packages** option is deselected by default. Then the 'Barcode' field – if empty – is only filled for barcode attribute instances that already exist in the volatile data of the *reference* *object*. | ![images/download/attachments/177912634/image-2024-9-19_11-56-27-version-1-modificationdate-1726739787245-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-9-19_11-56-27-version-1-modificationdate-1726739787245-api-v2.png) | | --- | --- | | The **Line items** parameter can be used to explicitly define, via a [Resolvers](/v1/docs/en/core-i-value-resolver), *relevant* *line* *items* whose barcode attributes are processed by the event action. - In the example on the right, all direct line items for the [Line item type](/v1/docs/en/base-line-item-type) 'Service' are determined via the [Direct line items](/v1/docs/en/base-get-line-items-resolver) value resolver. **NOTE:** The result for the selection of *relevant line items* is identical to the selection of 'Service' in the **Line item types** parameter (see below) only if the *reference* *object* for this [Line item type](/v1/docs/en/base-line-item-type) does not contain any child items. Otherwise, child items are not processed because the [Direct line items](/v1/docs/en/base-get-line-items-resolver) value resolver does not list them. - As soon as a [Resolvers](/v1/docs/en/core-i-value-resolver) is configured for the **Line items** parameter, the **Line item types** deactivated parameter appears. It becomes active again only when the [Resolvers](/v1/docs/en/core-i-value-resolver) in the **Line** [Resolvers](/v1/docs/en/core-i-value-resolver) parameter is removed. - The parameter can only be configured if no **Line item types** (see below) have been selected yet. | ![images/download/attachments/177912634/image-2024-9-19_11-57-10-version-1-modificationdate-1726739829897-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-9-19_11-57-10-version-1-modificationdate-1726739829897-api-v2.png) | | Alternatively, the **Line item types** parameter can be used to define *relevant* *line* *items* whose barcode attributes are to be processed by the event action in a blanket manner via their [Line item type](/v1/docs/en/base-line-item-type). - In the example on the right, the [Line item type](/v1/docs/en/base-line-item-type) 'Default' has already been selected. In addition, the [Line item type](/v1/docs/en/base-line-item-type) 'Service' is selected, which was looked up in the image using the search function of the [Multiselect combobox](/v1/docs/en/fre-multi-select-combo-box-vo). This selection must be confirmed by pressing the enter key or by clicking on the ![images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/check(11).svg) symbol. - A selection for **Line item types** is only possible if no explicit definition of the *relevant* *line* *items* is configured under **Line Items**. - As soon as a selection is made for one or more **Line** **item** **types**, the configuration for the **Line** **items** parameter is deactivated. **NOTE:** Only if there is neither a configuration under **Line items** nor a selection under **Line item** **types**, all line items with the [Line item type](/v1/docs/en/base-line-item-type) 'Default' (`DEFAULT`) are considered as relevant. | ![images/download/attachments/177912634/image-2024-9-19_11-57-55-version-1-modificationdate-1726739874752-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-9-19_11-57-55-version-1-modificationdate-1726739874752-api-v2.png) |