Skip to main content

Unique Code

Unique code collection stores individual identifier codes generated from identifier jobs, including their digital link representations, EPC keys, and current assignment or reservation status.

The unique_code Object

Unique code collection contains the actual generated identifier codes that result from the execution of identifier jobs, providing digital link URLs, EPC integration keys, and status tracking for individual codes within the TrackVision system.

Field NameTypeDescription
iduuidPrimary key. Unique identifier for the unique code record (UUID format).
user_createdobjectUser who created the unique code record. Read-only. Links to directus_users.
date_createddatetimeTimestamp in ISO 8601 when the unique code was created. Read-only.
user_updatedobjectUser who last updated the unique code record. Read-only. Links to directus_users.
date_updateddatetimeTimestamp in ISO 8601 when the unique code was last updated. Read-only.
digital_linkstringComplete digital link URL for the unique code (e.g., "https://mybrand.tvai.me/01/09312345551927/21/17DZfpiY").
codestringThe actual unique identifier code generated (e.g., "17DZfpiY").
productstringProduct identifier this code is associated with (primary key from product collection).
identifier_jobobjectReference to the identifier job that generated this code. Links to identifier_job.
epc_join_keystringUnique key for EPC (Electronic Product Code) system integration, combining product and code identifiers.
statusstringCurrent status of the unique code. Default: "unassigned". Values: "unassigned", "reserved", "assigned", "encoded".
reservationobjectReference to the code reservation that currently holds this code (if reserved). Links to code_reservation.
typestringType of identifier code (e.g., "sgtin", "sscc", "grai").
custom_idstringOptional custom identifier for the unique code.

Sub-Objects

User Object (user_created, user_updated)

See Users for the full schema.

Identifier Job Object (identifier_job)

See Identifier Job for the full schema.

Code Reservation Object (reservation)

See Code Reservation for the full schema.


List Unique Codes

List existing unique codes.

GET /items/unique_code

Query Parameters

Supports all global query parameters.

Returns

An array of up to limit unique code objects. If no items are available, data will be an empty array.


Retrieve a Unique Code

Retrieve a specific unique code by ID.

GET /items/unique_code/:id

Returns

Returns a unique code object if a valid primary key was provided.


Create a Unique Code

Create a new unique code.

POST /items/unique_code

{
"digital_link": "https://food.tvai.me/01/09312345551927/21/ABC123XY",
"code": "ABC123XY",
"product": "/01/09312345551927",
"identifier_job": "f1b2c3d4-e5f6-7890-1234-567890abcdef",
"epc_join_key": "09312345551927-ABC123XY",
"type": "sgtin"
}

Query Parameters

Supports all global query parameters.

Request Body

A partial unique code object.

Returns

Returns the unique code object for the created unique code.


Update a Unique Code

Update an existing unique code.

PATCH /items/unique_code/:id

{
"status": "assigned",
"reservation": "a1b2c3d4-e5f6-7890-1234-567890abcdef"
}

Query Parameters

Supports all global query parameters.

Request Body

A partial unique code object.

Returns

Returns the unique code object for the updated unique code.


Delete a Unique Code

Delete an existing unique code.

DELETE /items/unique_code/:id

Returns

Empty body.


Sample Data

IDCodeProductDigital LinkStatusType
016dca91-d281-4361-98d5-f006f4dafc2117DZfpiY/01/09312345551927https://mybrand.tvai.me/01/09312345551927/21/17DZfpiYreservedsgtin
0187f1a4-2f83-4026-93c9-f3e0333043144qt8Jblr/01/09312345552016https://mybrand.tvai.me/01/09312345552016/21/4qt8Jblrreservedsgtin
01d039e3-ea64-4a1c-933a-fa5fe604a5fdYZQDrcpP/01/09312345551927https://mybrand.tvai.me/01/09312345551927/21/YZQDrcpPreservedsgtin