Lot
Lot objects represent batches or lots of manufactured goods that have been produced at a specific time and place and all contain the same input material.
This collection is typically used by smaller companies who are using the user interface or spreadsheets to upload their production information. Larger companies would import their batch/lot information directly via EPCIS. Lot information created using this collection does not automatically replicate into EPCIS events - use the "Publish Lot" flow to do this.
The lot Object
Lot records store batch/lot production information including lot number, dates, quantities, product links, and supply chain traceability attributes.
| Field Name | Type | Description |
|---|---|---|
id | string | Primary key for the lot. Auto set based on product and lot number if using GS1 IDs. |
user_created | object | User who created the lot. Read-only. Links to directus_users. |
date_created | datetime | Timestamp in ISO 8601 when the lot was created. Read-only. |
user_updated | object | User who last updated the lot. Read-only. Links to directus_users. |
date_updated | datetime | Timestamp in ISO 8601 when the lot was last updated. Read-only. |
lot_number | string | The batch or lot number assigned by the manufacturer. |
production_date | string | Date the lot was produced (ISO 8601 date, e.g., "2024-12-17"). |
digital_link | string | GS1 Digital Link URL for the lot. |
quantity | number | Quantity of items or units in this lot. |
expiry_date | string | Expiry date for the lot (ISO 8601 date). |
best_before_date | string | Best before date for the lot (ISO 8601 date). |
sell_by_date | string | Sell by date for the lot (ISO 8601 date). |
status | string | Current status of the lot (e.g., "draft", "published"). |
uom | object | Unit of measure for the lot quantity. Links to ref_uom. |
production_location | object | Location where the lot was produced. Links to location. |
product | object | Product this lot belongs to. Links to product. |
account | object | Account associated with this lot. (Multi-tenant installations only) |
harvest_start_date | string | Start date of the harvest period (ISO 8601 date). |
harvest_end_date | string | End date of the harvest period (ISO 8601 date). |
quality_report | object | Quality report document for this lot. Links to directus_files. |
input_material | array of objects | Input materials/ingredients used in producing this lot. |
catch_information_list | array of objects | Seafood catch information records for this lot. |
Sub-Objects
User Object (user_created, user_updated)
See Users for the full schema.
Account Object (account)
See Account for the full schema.
Unit of Measure Object (uom)
See Unit of Measurement for the full schema.
Location Object (production_location)
See Location for the full schema.
Product Object (product)
See Product for the full schema.
File Object (quality_report)
See Files for the full schema.
List Lots
List existing lots.
- REST
- GraphQL
GET /items/lot
query {
lot {
id
lot_number
production_date
expiry_date
status
quantity
uom {
code
description
}
product {
id
product_name
gtin
}
production_location {
id
location_name
}
}
}
Query Parameters
Supports all global query parameters.
Returns
An array of up to limit lot objects. If no items are available, data will be an empty array.
Retrieve a Lot
Retrieve a specific lot by ID.
- REST
- GraphQL
GET /items/lot/:id
query {
lot_by_id(id: "lot_id") {
id
lot_number
production_date
digital_link
quantity
expiry_date
best_before_date
sell_by_date
status
harvest_start_date
harvest_end_date
uom {
code
description
}
production_location {
id
location_name
}
product {
id
product_name
gtin
}
account {
id
account_name
}
user_created {
id
first_name
last_name
}
date_created
user_updated {
id
first_name
last_name
}
date_updated
}
}
Returns
Returns a lot object if a valid primary key was provided.
Create a Lot
Create a new lot.
- REST
- GraphQL
POST /items/lot
{
"lot_number": "LOT-2024-001",
"production_date": "2024-12-17",
"expiry_date": "2025-06-17",
"quantity": "1000.00",
"status": "draft",
"product": "/01/94444444444447",
"production_location": "/414/4444444100012",
"uom": "KGM"
}
mutation {
create_lot_item(data: {
lot_number: "LOT-2024-001"
production_date: "2024-12-17"
expiry_date: "2025-06-17"
quantity: 1000
status: "draft"
product: "/01/94444444444447"
production_location: "/414/4444444100012"
uom: "KGM"
}) {
id
lot_number
production_date
status
}
}
Query Parameters
Supports all global query parameters.
Request Body
A partial lot object.
Returns
Returns the lot object for the created lot.
Update a Lot
Update an existing lot.
- REST
- GraphQL
PATCH /items/lot/:id
{
"status": "published",
"quantity": "1200.00"
}
mutation {
update_lot_item(id: "lot_id", data: {
status: "published"
quantity: 1200
}) {
id
lot_number
status
quantity
}
}
Query Parameters
Supports all global query parameters.
Request Body
A partial lot object.
Returns
Returns the lot object for the updated lot.
Delete a Lot
Delete an existing lot.
- REST
- GraphQL
DELETE /items/lot/:id
mutation {
delete_lot_item(id: "lot_id") {
id
}
}
Returns
Empty body.