Skip to main content

# REST API Packages

How to Set Up and Use Predefined Packages Using the Flexi REST API

Written by Petr Pech

In Flexi, packaging is a multiple of a price list item's unit of measure — for example, screws sold in batches of one hundred. It is always tied to a specific price list item, where it is also configured; each item can have up to five packagings.

ℹ️ Packaging is not the same as a product set. If you need to assemble a product from several different items, use Sets and Kits instead.


Creating Packaging

Packaging is created by updating a price list item. Each of the five packagings has a set of three fields:

Field

Meaning

baleniNazev1baleniNazev5

Code or name of the packaging.

baleniMj1baleniMj5

Number of units of measure per packaging.

baleniEan1baleniEan5

EAN of the packaging.

If we want to sell item ŠROUBUNI4X50 in batches of one hundred pieces as well:

<winstrom version="1.0">
<cenik>
<id>code:ŠROUBUNI4X50</id>
<baleniNazev1>ŠROUBUNI4X50BAL100</baleniNazev1>
<baleniMj1>100</baleniMj1>
<baleniEan1>8591230432100</baleniEan1>
</cenik>
</winstrom>

This creates the first packaging with a hundred pieces. The packaging price is calculated automatically as a multiple of the item's selling price. The complete list of price list fields is available at /c/{firma}/cenik/properties.xml.


Using Packaging on a Document

On a document line, packaging is specified using two fields:

Field

Meaning

baleniId

The position of the packaging in the price list item definition — a whole number from 1 to 5.

mnozBaleni

Number of packagings ordered or issued.

An order for three packagings of screws:

<winstrom version="1.0">
<objednavka-prijata>
<typDokl>code:OBP</typDokl>
<firma>code:ODBERATEL</firma>
<polozkyDokladu>
<objednavka-prijata-polozka>
<cenik>code:ŠROUBUNI4X50</cenik>
<sklad>code:SKLAD</sklad>
<typPolozkyK>typPolozky.katalog</typPolozkyK>
<baleniId>1</baleniId>
<mnozBaleni>3</mnozBaleni>
</objednavka-prijata-polozka>
</polozkyDokladu>
</objednavka-prijata>
</winstrom>

Both the quantity and the price are calculated automatically — the line will show 300 pieces. The same pair of fields works on other sales and inventory documents as well.

🚨 The baleniId field must contain only the packaging's sequence number. Entering it via the EAN (ean:8591230432100, or just the EAN number by itself) will result in error Hodnota pole 'Balení' musí být celé číslo. The packaging's EAN is meant for scanning with a reader, not for identification during import.

⚠️ If the line item is a stock-tracked price list item, sklad must also be filled in — otherwise the import will fail with the message Pokud je vybrána skladová položka, musí být vyplněn sklad.


Fulfilling an Order

When fulfilling an order, you don't need to worry about packaging — fulfillment handles it automatically. You specify the total quantity of the source item, i.e., in individual units, not packagings:

<winstrom version="1.0">
<objednavka-prijata>
<id>code:OBP0004/2026</id>
<realizaceObj type="skladovy-pohyb">
<polozkyObchDokladu>
<polozka>
<cisRad>1</cisRad>
<mj>300</mj>
</polozka>
</polozkyObchDokladu>
</realizaceObj>
</objednavka-prijata>
</winstrom>

This creates an issue note for 300 pieces, and the system automatically recognizes that it was packaging.

ℹ️ The packaging's EAN should be unique. If the EANs are not unique, the system will find the first match during lookup and use it — no other behavior can be guaranteed.


Related

Did this answer your question?