Skip to main content

Batch and Expiration Date Assignment and Their Subsequent Display

Can I specify batch and expiration for a document item via the API and view the records of these batches and expirations for a product?

Written by Petr Pech

Batch and expiration date are entered directly on the document's stock item. They can later be retrieved from the records that keep track of balances by batch.


Entry on receipt

<skladovePolozky>
<skladovy-pohyb-polozka>
<cenik>code:JOGURT</cenik>
<sklad>code:SKLAD</sklad>
<mnozMj>5</mnozMj>
<sarze>SARZE123</sarze>
<expirace>2027-06-01+02:00</expirace>
<datTrvan>2027-06-01+02:00</datTrvan>
<datVyroby>2026-06-01+02:00</datVyroby>
</skladovy-pohyb-polozka>
</skladovePolozky>

Meaning of the individual elements:

Element

Meaning

sarze

Batch designation.

expirace

Expiration date.

datTrvan

Best-before date.

datVyroby

Manufacture date.

ℹ️ Tracking needs to be enabled on the price list item — the field evidSarze for batches and evidExpir for expiration dates. Dates are entered in the format RRRR-MM-DD, optionally with a time offset.


Displaying balances

Balances for individual batches and expiration dates are kept in a separate record, sarze-expirace:

GET /c/{firma}/sarze-expirace.xml?detail=custom:sarze,expirace,pocet,cenik,sklad&limit=0

For each record you'll find the batch, expiration date, price list item, warehouse, and the number of units remaining from the given batch. The entry from the example above will appear here as a record with pocet 5.

You can list the values entered on a specific document directly from its items:

GET /c/{firma}/skladovy-pohyb/123/polozkyDokladu.xml?detail=custom:cenik,mnozMj,sarze,expirace


Related

Did this answer your question?