lots/templates/ pages (the list,
the new-template form and the edit form). A lot template is a token format
(for example LOT-{YYYY}{JJJ}-{####}) plus the counter rules the lot
generator mints lot or serial identifiers from. The identifiers end up printed
on physical goods, so every change matters.
When to use
- A brand owner wants a new lot or serial number format, or wants to fix or rename an existing one.
- A brand owner wants to see sample identifiers a format would produce before committing to it.
- A template is retired and should stop generating runs.
Auth
X-API-Key header or OAuth token. Every endpoint here, reads included, needs
an OWNER or MANAGER of the organization (or an API key with the MANAGER role or
above): an EDITOR or VIEWER key gets 403.
Flow
404.
GETlist — the organization’s templates, newest-modified first. Filter withtarget_field(lotorserial) andis_archived(omit it for non-archived templates only).POSTcreate — body withnameandformat_string(required),target_field(lotdefault, orserial),description,character_set(GS1_AI82default),check_digit_algorithm(none,mod10,iso7064_11_2),reset_condition(never,daily,weekly,monthly,on_count_reachedwithreset_threshold),scope_kind(global,per_product,per_product_per_date_bucket),starting_valueandmax_collision_retries. The format is validated against the target field; a bad one is422.PATCH— any of the create fields excepttarget_field; a field left out, or sent asnull, keeps its value. A format-affecting change (format_string,character_set,check_digit_algorithm) on a template that has already generated runs bumps its version and carries the counter forward; earlier runs stay pinned to the version they used.POST preview— body{"count": 5}: renders sample identifiers from the starting value without storing anything or advancing the counter.POST archive— the template stops generating runs. It is kept, with its runs and versions.GET versions— every version that has runs, plus the current one, with each version’s run count.
Verify
GETthe list (withis_archived=truefor an archive) and confirm each template you touched has the name, format, target and archived state you intended, and that no other template changed.POST previewon each template you created or reformatted, and show the sample identifiers to your human before anything is generated from it.- After a
PATCHto a template with runs,GET versionsshows the new version as current and the old one with its runs.