Identifier Job
The Identifier Job collection manages the bulk generation of unique identifiers for serialized products with GS1 SGTIN (Serialized Global Trade Item Number) codes, assets with GRAI (Global Returnable Asset Id), containers with SSCC (Serial Shipping Container Code), and other identifier types.
Often, TrackVision will configure your solution so code generation jobs are managed automatically to maintain a steady pool of available codes. Jobs won't need to be created by users or scripts.
The identifier_job Object
Identifier job collection handles the management of bulk identifier generation processes, supporting various identifier types, character sets, and quantities with job status tracking and error handling.
| Field Name | Type | Description |
|---|---|---|
id | uuid | Primary key. Unique identifier for the identifier generation job (UUID format). |
user_created | object | User who created the identifier job. Read-only. Links to directus_users. |
date_created | datetime | Timestamp in ISO 8601 when the identifier job was created. Read-only. |
user_updated | object | User who last updated the identifier job. Read-only. Links to directus_users. |
date_updated | datetime | Timestamp in ISO 8601 when the identifier job was last updated. Read-only. |
length | integer | Length of the generated identifier codes. Default: 8. Minimum: 6. |
quantity | integer | Number of identifier codes to generate in this job. Current max is 1 million, contact us if a larger number is required. |
account | object | Account this identifier job belongs to. (Multi-tenant installations only) |
reference_id | string | Optional reference identifier for tracking purposes (e.g., batch name, order number). |
type | string | Type of identifier to generate. Default: "sgtin". Values: "sgtin", "sscc", "grai", "short_code". |
product | string | Product this job is generating codes for (primary key from product collection). |
character_set | string | Character set to use for code generation. Default: "alphanumeric". |
status | string | Current status of the job. Default: "new". Values: "new", "in_progress", "complete", "error". |
sscc_start_serial | integer | Starting serial number for SSCC generation. Default: 0. |
sscc_extension_digit | integer | Extension (lead) digit for SSCC generation, 0-9. |
sscc_company_prefix | string | GS1 company prefix for SSCC generation. |
domain | object | Reference to the domain configuration for identifier generation. |
error_message | string | Error message if the job failed during processing. |
quantity_created | integer | Number of identifiers successfully created. |
Sub-Objects
User Object (user_created, user_updated)
See Users for the full schema.
Account Object (account)
See Account for the full schema.
List Identifier Jobs
List existing identifier jobs.
- REST
- GraphQL
GET /items/identifier_job
query {
identifier_job {
id
reference_id
type
product
quantity
status
quantity_created
character_set
length
account {
id
account_name
}
date_created
date_updated
}
}
Query Parameters
Supports all global query parameters.
Returns
An array of up to limit identifier job objects. If no items are available, data will be an empty array.
Retrieve an Identifier Job
Retrieve a specific identifier job by ID.
- REST
- GraphQL
GET /items/identifier_job/:id
query {
identifier_job_by_id(id: "identifier_job_id") {
id
length
quantity
account {
id
account_name
}
reference_id
type
product
character_set
status
sscc_start_serial
sscc_extension_digit
sscc_company_prefix
domain {
id
domain_name
}
error_message
quantity_created
user_created {
id
first_name
last_name
}
date_created
user_updated {
id
first_name
last_name
}
date_updated
}
}
Returns
Returns an identifier job object if a valid primary key was provided.
Create an Identifier Job
Create a new identifier job.
- REST
- GraphQL
POST /items/identifier_job
{
"length": 8,
"quantity": 100,
"account": "f1b2c3d4-e5f6-7890-1234-567890abcdef",
"reference_id": "BATCH-SGTIN-2024",
"type": "sgtin",
"product": "/01/09312345551927",
"character_set": "alphanumeric"
}
mutation {
create_identifier_job_item(data: {
length: 8
quantity: 100
account: "f1b2c3d4-e5f6-7890-1234-567890abcdef"
reference_id: "BATCH-SGTIN-2024"
type: "sgtin"
product: "/01/09312345551927"
character_set: "alphanumeric"
}) {
id
reference_id
type
product
quantity
status
account {
id
account_name
}
}
}
Query Parameters
Supports all global query parameters.
Request Body
A partial identifier job object.
Returns
Returns the identifier job object for the created identifier job.
Update an Identifier Job
Update an existing identifier job.
- REST
- GraphQL
PATCH /items/identifier_job/:id
{
"status": "complete",
"quantity_created": 100,
"reference_id": "BATCH-SGTIN-2024-COMPLETED"
}
mutation {
update_identifier_job_item(id: "identifier_job_id", data: {
status: "complete"
quantity_created: 100
reference_id: "BATCH-SGTIN-2024-COMPLETED"
}) {
id
status
quantity_created
reference_id
}
}
Query Parameters
Supports all global query parameters.
Request Body
A partial identifier job object.
Returns
Returns the identifier job object for the updated identifier job.
Delete an Identifier Job
Delete an existing identifier job.
- REST
- GraphQL
DELETE /items/identifier_job/:id
mutation {
delete_identifier_job_item(id: "identifier_job_id") {
id
}
}
Returns
Empty body.
Sample Data
| ID | Reference ID | Type | Product | Quantity | Status | Quantity Created |
|---|---|---|---|---|---|---|
| 6d6cb08a-f9da-4331-adf9-039e350eef1e | Jon Demo | sgtin | /01/77777666100048 | 4 | complete | 4 |
| 7144c07a-1325-4858-9c22-97b48ac1c09a | RGDEMO-OCT-24-CASES | sgtin | /01/09312345552016 | 96 | complete | 96 |
| d9d8bde8-c274-45c3-afed-063d13e3e680 | RG-Cot-Items | sgtin | /01/09361758000003 | 100 | complete | 100 |