Generate a lot or serial run
Reserve a contiguous block of identifiers. Lot templates: small batches run inline and return 201 with a reserved run; batches above the async threshold (or force_async=true) return 202 with a queued run a Celery worker completes. A sync hard collision returns 409 with the hard_collisions payload. Serial templates (target_field=serial, C-2712): always async — up to 10,000,000 per run — and always return 202 with a queued run; poll GET /lots/runs/{id}/ or subscribe to the SSE stream for the outcome, and export the reserved serials via GET /lots/runs/{id}/serials.csv|.jsonl. In every case the failed_collision run is persisted and linkable.
Authorizations
Body
Request body for POST /lots/runs/.
Template to generate against (id as UUID or shortuuid).
GTIN of the product the generated lots belong to.
How many identifiers to generate. Lots cap at 100,000; serial templates (target_field=serial) accept up to 10,000,000 and always run async.
1 <= x <= 10000000Lot (id as UUID or shortuuid) the generated serials belong to. Optional for serial templates (target_field=serial, C-4103) — a serialized unit may be unbatched (its identity is the SGTIN, GTIN + serial); omit to mint serials with no lot. Ignored for lot templates.
Scope tag — required when the template's scope_kind is tag.
128Force the Celery async path even for a small batch (returns a queued run).
Optional client request id. A repeat within 5 minutes returns the existing run.
128Response
Created
A generation run and its outcome.
Run id (22-char shortuuid). Use in /lots/runs/{id}/ paths.
Template this run generated against.
Template version pinned at generation time.
Counter scope key derived from the template's scope_kind.
GTIN of the product the generated lots belong to.
Number of identifiers requested.
Lifecycle state of the run.
queued, generating, reserved, committed, discarded, failed_collision Denormalized list of identifiers rendered by this run.
Random-source retries that resolved during generation.
Populated only on failed_collision runs; empty otherwise.
Creation timestamp (ISO-8601).
First identifier in the reserved block; null until reserved.
Last identifier in the reserved block; null until reserved.
Counter value (post-reset) before this run advanced it.
Counter value after this run; null on failed_collision.
Async progress: chunks written so far.
Async progress: total chunks the run will write.
User id that created the run; null if the user was deleted.
When the async run was enqueued.
When the worker began generating.
When the run was committed.
When the run was discarded.
When the run failed on a hard collision.
rollback or burn on a discarded run; null otherwise.
rollback, burn Free-text reason recorded when the run was discarded.