Lots
albert.resources.lots
LotStatus
The lifecycle status of a lot.
Attributes:
| Name | Type | Description |
|---|---|---|
ACTIVE |
The lot is in normal use. |
|
INACTIVE |
The lot is no longer in use. |
|
QUARANTINED |
The lot is held back from use (e.g. pending inspection). |
LotAdjustmentAction
How a quantity adjustment is applied to a lot's inventory on hand.
Used with adjust.
Attributes:
| Name | Type | Description |
|---|---|---|
ADD |
Increase inventory on hand by the given quantity. |
|
SUBTRACT |
Decrease inventory on hand by the given quantity. |
|
SET |
Set inventory on hand to exactly the given quantity. |
|
ZERO |
Set inventory on hand to zero. |
InventoryOnHandFilter
LotWorkflowLink
Bases: BaseAlbertModel
A workflow associated with a lot.
Show JSON schema:
{
"description": "A workflow associated with a lot.",
"properties": {
"id": {
"description": "The workflow ID (format ``WFL...``).",
"title": "Id",
"type": "string"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Workflow category (e.g. ``FINAL``).",
"title": "Category"
}
},
"required": [
"id"
],
"title": "LotWorkflowLink",
"type": "object"
}
Fields:
Lot
Bases: BaseResource
A specific physical batch or quantity of an Inventory Item.
A Lot represents one received shipment or produced amount of a parent
Inventory Item (identified by inventory_id), tracking batch-specific
details such as how much is currently on hand, where it is stored, its cost,
and who owns it. Lots are managed through the Lot collection
(LotCollection, accessed as
client.lots); their parent items live in the Inventory collection
(InventoryCollection). A lot_id
is used throughout property data to scope results to a single batch.
A lot's own ID has the format LOT...; its parent inventory_id has the
format INV....
Example
from albert import Albert
from albert.core.shared.models.base import EntityLink
from albert.resources.lots import Lot
client = Albert()
lot = Lot(
inventory_id="INVA9999999",
storage_location=EntityLink(id="STL9999999"),
initial_quantity=10.0,
inventory_on_hand=10.0,
cost=50.0,
manufacturer_lot_number="MLN-001",
)
created = client.lots.create(lots=[lot])
Notes
Fields required when creating a lot via
create depend on the path:
- Regular lot (no
task_id):inventory_id,storage_location,initial_quantity, andinventory_on_hand(usually the same value asinitial_quantity). When the parent Inventory Item isRawMaterials,costandmanufacturer_lot_numberare also required. - Task lot (
task_idset, batch /Formulaspath):inventory_idandlocation(notstorage_location).
Show JSON schema:
{
"$defs": {
"AuditFields": {
"description": "The audit fields for a resource",
"properties": {
"by": {
"default": null,
"title": "By",
"type": "string"
},
"byName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Byname"
},
"at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "At"
}
},
"title": "AuditFields",
"type": "object"
},
"EntityLink": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLink",
"type": "object"
},
"EntityLinkWithName": {
"description": "EntityLink that includes the name field in serialization.",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Category"
}
},
"required": [
"id"
],
"title": "EntityLinkWithName",
"type": "object"
},
"InventoryCategory": {
"description": "The kind of material an [`InventoryItem`][albert.resources.inventory.InventoryItem] represents.\n\nEvery inventory item belongs to exactly one category, which determines how it\nis used across the platform and which fields are relevant to it.\n\nAttributes\n----------\nRAW_MATERIALS : str\n A purchased substance used as an ingredient (e.g. a solvent or pigment).\n Typically linked to a manufacturing ``company`` and one or more CAS numbers.\nCONSUMABLES : str\n Lab supplies consumed during work (e.g. gloves, vials, filters).\nEQUIPMENT : str\n Instruments and apparatus (e.g. a balance or spectrometer).\nFORMULAS : str\n A mixture designed in Albert through a Worksheet. Formulas are not created\n through the inventory collection; they are produced by the Worksheet\n collection ([`WorksheetCollection`][albert.collections.worksheets.WorksheetCollection]).",
"enum": [
"RawMaterials",
"Consumables",
"Equipment",
"Formulas"
],
"title": "InventoryCategory",
"type": "string"
},
"Location": {
"description": "A physical lab or site location in Albert.\n\nLocations are referenced by Tasks and Inventory Items to record where an\nactivity is performed or where a material lives, and each Location can hold\none or more Storage Locations\n([`StorageLocation`][albert.resources.storage_locations.StorageLocation]). Managed\nthrough [`LocationCollection`][albert.collections.locations.LocationCollection].\n\n!!! example\n ```python\n from albert.resources.locations import Location\n location = Location(\n name=\"Boston Lab\",\n latitude=42.3601,\n longitude=-71.0589,\n address=\"1 Main St\",\n country=\"US\",\n )\n ```",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the resource, optional."
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the creation of the resource, optional."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the update of the resource, optional."
},
"name": {
"description": "The human-readable name of the location.",
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the location. Assigned by Albert and populated once the location has been created or retrieved.",
"title": "Albertid"
},
"latitude": {
"description": "The latitude of the location, in decimal degrees.",
"title": "Latitude",
"type": "number"
},
"longitude": {
"description": "The longitude of the location, in decimal degrees.",
"title": "Longitude",
"type": "number"
},
"address": {
"description": "The street address of the location.",
"title": "Address",
"type": "string"
},
"country": {
"anyOf": [
{
"maxLength": 2,
"minLength": 2,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The two-letter country code of the location (for example, ``\"US\"``).",
"title": "Country"
}
},
"required": [
"name",
"latitude",
"longitude",
"address"
],
"title": "Location",
"type": "object"
},
"LotStatus": {
"description": "The lifecycle status of a lot.\n\nAttributes\n----------\nACTIVE\n The lot is in normal use.\nINACTIVE\n The lot is no longer in use.\nQUARANTINED\n The lot is held back from use (e.g. pending inspection).",
"enum": [
"active",
"inactive",
"quarantined"
],
"title": "LotStatus",
"type": "string"
},
"LotWorkflowLink": {
"description": "A workflow associated with a lot.",
"properties": {
"id": {
"description": "The workflow ID (format ``WFL...``).",
"title": "Id",
"type": "string"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Workflow category (e.g. ``FINAL``).",
"title": "Category"
}
},
"required": [
"id"
],
"title": "LotWorkflowLink",
"type": "object"
},
"Role": {
"description": "A named set of access permissions within a tenant.\n\nA role bundles policies that determine what a holder is allowed to do. Roles\nare assigned to users ([`User`][albert.resources.users.User]) and referenced\nby entity ACLs. Roles are typically read from Albert rather than built by\nhand.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the resource, optional."
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the creation of the resource, optional."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the update of the resource, optional."
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the role. Role IDs may contain ``#`` characters. Set once the role is retrieved from Albert.",
"title": "Albertid"
},
"name": {
"description": "The display name of the role.",
"title": "Name",
"type": "string"
},
"Policies": {
"anyOf": [
{
"items": {},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The policies (permission rules) associated with the role.",
"title": "Policies"
},
"tenant": {
"description": "The ID of the tenant the role belongs to.",
"title": "Tenant",
"type": "string"
},
"visibility": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the role is visible in the platform's role listings.",
"title": "Visibility"
}
},
"required": [
"name",
"tenant"
],
"title": "Role",
"type": "object"
},
"Status": {
"description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n The resource is fully operational and visible in normal operations.\nINACTIVE : str\n The resource is hidden from normal operations and disabled from use.",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
},
"StorageLocation": {
"description": "A specific place where an Inventory Item is physically stored.\n\nExamples include a flammables cabinet, a freezer, or a storeroom shelf. Every\nstorage location belongs to a parent Location\n([`Location`][albert.resources.locations.Location]), and Inventory search filters\ncan narrow results to items held in a given storage location. Managed through\n[`StorageLocationsCollection`][albert.collections.storage_locations.StorageLocationsCollection].\n\n!!! example\n ```python\n from albert import Albert\n from albert.resources.storage_locations import StorageLocation\n client = Albert()\n parent = client.locations.get_by_id(id=\"...\")\n storage_location = StorageLocation(name=\"Freezer A\", location=parent)\n ```",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the resource, optional."
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the creation of the resource, optional."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the update of the resource, optional."
},
"name": {
"description": "The human-readable name of the storage location (2 to 255 characters).",
"maxLength": 255,
"minLength": 2,
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the storage location (format ``STL...``). Assigned by Albert and populated once the storage location has been created or retrieved.",
"title": "Albertid"
},
"Location": {
"anyOf": [
{
"$ref": "#/$defs/Location"
},
{
"$ref": "#/$defs/EntityLink"
}
],
"description": "The parent Location this storage location belongs to.",
"title": "Location"
}
},
"required": [
"name",
"Location"
],
"title": "StorageLocation",
"type": "object"
},
"User": {
"description": "An Albert user account: a person who can log in and act in the platform.\n\nA user has a name and email, an optional home\n[`Location`][albert.resources.locations.Location], and a set of\n[`Role`][albert.resources.roles.Role] objects that govern what they can do.\nThe ``user_class`` sets a broad permission tier\n([`UserClass`][albert.resources.users.UserClass]). Users are grouped into teams\n([`Team`][albert.resources.teams.Team]), and are referenced across the\nplatform, for example as the assignee of a Task or in an entity's ACL.\n\n!!! example\n ```python\n from albert.resources.users import User, UserClass\n user = User(\n name=\"Ada Lovelace\",\n email=\"ada@example.com\",\n user_class=UserClass.STANDARD,\n )\n ```",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the resource, optional."
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the creation of the resource, optional."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the update of the resource, optional."
},
"name": {
"description": "The display name of the user.",
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert User ID (format ``USR...``). Set once the user is registered in or retrieved from Albert.",
"title": "Albertid"
},
"Location": {
"anyOf": [
{
"$ref": "#/$defs/Location"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"type": "null"
}
],
"default": null,
"description": "The user's home location.",
"title": "Location"
},
"email": {
"default": null,
"description": "The user's email address.",
"format": "email",
"title": "Email",
"type": "string"
},
"Roles": {
"description": "The roles the user holds, which determine their permissions.",
"items": {
"anyOf": [
{
"$ref": "#/$defs/Role"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"maxItems": 1,
"title": "Roles",
"type": "array"
},
"userClass": {
"$ref": "#/$defs/UserClass",
"default": "standard",
"description": "The ACL class level of the user (broad permission tier)."
},
"witnesser": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the user can act as a witness on tasks (only relevant when witnessing is enabled for the tenant).",
"title": "Witnesser"
},
"Metadata": {
"anyOf": [
{
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "integer"
},
{
"type": "string"
},
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
}
]
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Custom metadata attached to the user.",
"title": "Metadata"
}
},
"required": [
"name"
],
"title": "User",
"type": "object"
},
"UserClass": {
"description": "The ACL class level of a user, setting a broad permission tier.\n\nAttributes\n----------\nGUEST : str\n Most limited access; typically external or temporary users.\nSTANDARD : str\n Default access level for regular users.\nTRUSTED : str\n Elevated access above standard users.\nPRIVILEGED : str\n High access level below full administrators.\nADMIN : str\n Full administrative access to the tenant.",
"enum": [
"guest",
"standard",
"trusted",
"privileged",
"admin"
],
"title": "UserClass",
"type": "string"
}
},
"description": "A specific physical batch or quantity of an Inventory Item.\n\nA Lot represents one received shipment or produced amount of a parent\nInventory Item (identified by ``inventory_id``), tracking batch-specific\ndetails such as how much is currently on hand, where it is stored, its cost,\nand who owns it. Lots are managed through the Lot collection\n([`LotCollection`][albert.collections.lots.LotCollection], accessed as\n``client.lots``); their parent items live in the Inventory collection\n([`InventoryCollection`][albert.collections.inventory.InventoryCollection]). A ``lot_id``\nis used throughout property data to scope results to a single batch.\n\nA lot's own ID has the format ``LOT...``; its parent ``inventory_id`` has the\nformat ``INV...``.\n\n!!! example\n ```python\n from albert import Albert\n from albert.core.shared.models.base import EntityLink\n from albert.resources.lots import Lot\n client = Albert()\n lot = Lot(\n inventory_id=\"INVA9999999\",\n storage_location=EntityLink(id=\"STL9999999\"),\n initial_quantity=10.0,\n inventory_on_hand=10.0,\n cost=50.0,\n manufacturer_lot_number=\"MLN-001\",\n )\n created = client.lots.create(lots=[lot])\n ```\n\nNotes\n-----\nFields required when creating a lot via\n[`create`][albert.collections.lots.LotCollection.create] depend on the path:\n\n- **Regular lot** (no ``task_id``): ``inventory_id``, ``storage_location``,\n ``initial_quantity``, and ``inventory_on_hand`` (usually the same value as\n ``initial_quantity``). When the parent Inventory Item is ``RawMaterials``,\n ``cost`` and ``manufacturer_lot_number`` are also required.\n- **Task lot** (``task_id`` set, batch / ``Formulas`` path): ``inventory_id``\n and ``location`` (not ``storage_location``).",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/LotStatus"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot's lifecycle status. Read-only."
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the creation of the resource, optional."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the update of the resource, optional."
},
"action": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Internal marker for the operation that produced the lot (e.g. a split). Not typically set by callers.",
"title": "Action"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot's Albert ID (format ``LOT...``). Assigned by Albert; present on lots retrieved from the platform.",
"title": "Albertid"
},
"parentId": {
"description": "The Albert ID of the parent Inventory Item this lot is a batch of.\n\nRequired when creating a lot.",
"title": "Parentid",
"type": "string"
},
"taskId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the Task that produced this lot, if it came from one.\n\nWhen set, creation follows the task / batch (``Formulas``) path: provide\n``location`` instead of ``storage_location``.",
"title": "Taskid"
},
"workflowId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the workflow associated with this lot (format ``WFL...``).\n\nCan be set via [`update`][albert.collections.lots.LotCollection.update].",
"title": "Workflowid"
},
"Workflows": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/LotWorkflowLink"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Workflow associations for this lot. Read-only; use ``workflow_id``.",
"title": "Workflows"
},
"expirationDate": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The date the lot expires, in ``YYYY-MM-DD`` format.",
"title": "Expirationdate"
},
"manufacturerLotNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The manufacturer's own lot number for this batch.\n\nRequired when creating a lot whose parent Inventory Item is ``RawMaterials``\n(and ``task_id`` is not set). Optional on read and update.",
"title": "Manufacturerlotnumber"
},
"StorageLocation": {
"anyOf": [
{
"$ref": "#/$defs/StorageLocation"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"type": "null"
}
],
"default": null,
"description": "The specific place within a location where the lot is stored (e.g. a bin, cabinet, or hood).\n\nWhen creating or updating, pass an [`EntityLink`][albert.core.shared.models.base.EntityLink]\nwith the storage location ID (format ``STL...``), or a fully populated\n[`StorageLocation`][albert.resources.storage_locations.StorageLocation].\nDo not construct ``StorageLocation`` with only ``id``/``name``; ``location`` is required\non that model.",
"title": "Storagelocation"
},
"packSize": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The pack size of the lot, used to calculate cost per unit.",
"title": "Packsize"
},
"initialQuantity": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The quantity the lot started with, in the parent item's units.\n\nRequired when creating a non-task lot (no ``task_id``).",
"title": "Initialquantity"
},
"cost": {
"anyOf": [
{
"minimum": 0,
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "The cost of the lot.\n\nRequired when creating a lot whose parent Inventory Item is ``RawMaterials``\n(and ``task_id`` is not set). Optional on read and update.",
"title": "Cost"
},
"inventoryOnHand": {
"description": "The quantity currently in stock, in the parent item's units.\n\nRequired when creating a non-task lot; set to the starting stock (usually the\nsame value as ``initial_quantity``). After creation, change it with\n[`adjust`][albert.collections.lots.LotCollection.adjust] rather than by\nediting directly.",
"title": "Inventoryonhand",
"type": "number"
},
"Owner": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/User"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The user(s) who own the lot. A lot may have at most one owner.",
"title": "Owner"
},
"lotNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot's number within Albert.",
"title": "Lotnumber"
},
"externalBarcodeId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "An external barcode ID for the lot.",
"title": "Externalbarcodeid"
},
"Metadata": {
"anyOf": [
{
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "integer"
},
{
"type": "string"
},
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"items": {
"anyOf": [
{
"$ref": "#/$defs/EntityLinkWithName"
},
{
"$ref": "#/$defs/EntityLink"
}
]
},
"type": "array"
}
]
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Custom field values for the lot. Allowed keys and values are defined by the Custom Fields configuration.",
"title": "Metadata"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Free-text notes on the lot.",
"title": "Notes"
},
"Location": {
"anyOf": [
{
"$ref": "#/$defs/Location"
},
{
"$ref": "#/$defs/EntityLink"
},
{
"type": "null"
}
],
"default": null,
"description": "The site/campus the lot is at (may contain multiple buildings, each with many storage locations).\n\nRequired when creating a task lot (``task_id`` set). Read-only on lots returned\nfrom GET; use ``storage_location`` for regular (non-task) lot creation.",
"title": "Location"
},
"hasNotes": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the lot has notes. Read-only.",
"title": "Hasnotes"
},
"hasAttachments": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the lot has attachments. Read-only.",
"title": "Hasattachments"
},
"parentName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the parent Inventory Item. Read-only.",
"title": "Parentname"
},
"parentUnit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit of measure of the parent Inventory Item. Read-only.",
"title": "Parentunit"
},
"parentCategory": {
"anyOf": [
{
"$ref": "#/$defs/InventoryCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the parent Inventory Item (e.g. ``RawMaterials``). Read-only."
},
"barcodeId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The barcode ID assigned by Albert. Read-only.",
"title": "Barcodeid"
},
"taskCompletionDate": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The completion date of the Task that produced the lot. Read-only.",
"title": "Taskcompletiondate"
}
},
"required": [
"parentId",
"inventoryOnHand"
],
"title": "Lot",
"type": "object"
}
Fields:
-
created(AuditFields | None) -
updated(AuditFields | None) -
action(str | None) -
id(LotId | None) -
inventory_id(InventoryId) -
task_id(str | None) -
workflow_id(WorkflowId | None) -
workflows(list[LotWorkflowLink] | None) -
expiration_date(str | None) -
manufacturer_lot_number(str | None) -
storage_location(SerializeAsEntityLink[StorageLocation] | None) -
pack_size(str | None) -
initial_quantity(float | None) -
cost(NonNegativeFloat | None) -
inventory_on_hand(float) -
owner(list[SerializeAsEntityLink[User]] | None) -
lot_number(str | None) -
external_barcode_id(str | None) -
metadata(dict[str, MetadataItem] | None) -
notes(str | None) -
status(LotStatus | None) -
location(SerializeAsEntityLink[Location] | None) -
has_notes(bool | None) -
has_attachments(bool | None) -
parent_name(str | None) -
parent_unit(str | None) -
parent_category(InventoryCategory | None) -
barcode_id(str | None) -
task_completion_date(str | None)
Validators:
-
populate_workflow_id_from_workflows -
validate_has_notes→has_notes -
validate_has_attachments→has_attachments
action
action: str | None = None
Internal marker for the operation that produced the lot (e.g. a split). Not typically set by callers.
id
id: LotId | None = None
The lot's Albert ID (format LOT...). Assigned by Albert; present on lots retrieved from the platform.
inventory_id
inventory_id: InventoryId
The Albert ID of the parent Inventory Item this lot is a batch of.
Required when creating a lot.
task_id
task_id: str | None = None
The Albert ID of the Task that produced this lot, if it came from one.
When set, creation follows the task / batch (Formulas) path: provide
location instead of storage_location.
workflow_id
workflow_id: WorkflowId | None = None
The Albert ID of the workflow associated with this lot (format WFL...).
Can be set via update.
workflows
workflows: list[LotWorkflowLink] | None = None
Workflow associations for this lot. Read-only; use workflow_id.
manufacturer_lot_number
manufacturer_lot_number: str | None = None
The manufacturer's own lot number for this batch.
Required when creating a lot whose parent Inventory Item is RawMaterials
(and task_id is not set). Optional on read and update.
storage_location
storage_location: (
SerializeAsEntityLink[StorageLocation] | None
) = None
The specific place within a location where the lot is stored (e.g. a bin, cabinet, or hood).
When creating or updating, pass an EntityLink
with the storage location ID (format STL...), or a fully populated
StorageLocation.
Do not construct StorageLocation with only id/name; location is required
on that model.
initial_quantity
initial_quantity: float | None = None
The quantity the lot started with, in the parent item's units.
Required when creating a non-task lot (no task_id).
cost
The cost of the lot.
Required when creating a lot whose parent Inventory Item is RawMaterials
(and task_id is not set). Optional on read and update.
inventory_on_hand
inventory_on_hand: float
The quantity currently in stock, in the parent item's units.
Required when creating a non-task lot; set to the starting stock (usually the
same value as initial_quantity). After creation, change it with
adjust rather than by
editing directly.
owner
The user(s) who own the lot. A lot may have at most one owner.
metadata
Custom field values for the lot. Allowed keys and values are defined by the Custom Fields configuration.
location
location: SerializeAsEntityLink[Location] | None = None
The site/campus the lot is at (may contain multiple buildings, each with many storage locations).
Required when creating a task lot (task_id set). Read-only on lots returned
from GET; use storage_location for regular (non-task) lot creation.
parent_unit
parent_unit: str | None = None
The unit of measure of the parent Inventory Item. Read-only.
parent_category
parent_category: InventoryCategory | None = None
The category of the parent Inventory Item (e.g. RawMaterials). Read-only.
task_completion_date
task_completion_date: str | None = None
The completion date of the Task that produced the lot. Read-only.
populate_workflow_id_from_workflows
Source code in src/albert/resources/lots.py
validate_has_notes
validate_has_attachments
serialize_initial_quantity
serialize_cost
serialize_inventory_on_hand
LotSearchItem
Bases: BaseAlbertModel, HydrationMixin[Lot]
Lightweight, partial view of a Lot returned by search.
Returned by search. It carries
only the most commonly needed fields for fast lookups; call
hydrate() to fetch the full Lot when you need every field.
Show JSON schema:
{
"$defs": {
"InventoryCategory": {
"description": "The kind of material an [`InventoryItem`][albert.resources.inventory.InventoryItem] represents.\n\nEvery inventory item belongs to exactly one category, which determines how it\nis used across the platform and which fields are relevant to it.\n\nAttributes\n----------\nRAW_MATERIALS : str\n A purchased substance used as an ingredient (e.g. a solvent or pigment).\n Typically linked to a manufacturing ``company`` and one or more CAS numbers.\nCONSUMABLES : str\n Lab supplies consumed during work (e.g. gloves, vials, filters).\nEQUIPMENT : str\n Instruments and apparatus (e.g. a balance or spectrometer).\nFORMULAS : str\n A mixture designed in Albert through a Worksheet. Formulas are not created\n through the inventory collection; they are produced by the Worksheet\n collection ([`WorksheetCollection`][albert.collections.worksheets.WorksheetCollection]).",
"enum": [
"RawMaterials",
"Consumables",
"Equipment",
"Formulas"
],
"title": "InventoryCategory",
"type": "string"
}
},
"description": "Lightweight, partial view of a [`Lot`][albert.resources.lots.Lot] returned by search.\n\nReturned by [`search`][albert.collections.lots.LotCollection.search]. It carries\nonly the most commonly needed fields for fast lookups; call\n`hydrate()` to fetch the full [`Lot`][albert.resources.lots.Lot] when you need every field.",
"properties": {
"albertId": {
"description": "The lot's Albert ID (format ``LOT...``).",
"title": "Albertid",
"type": "string"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the parent Inventory Item.",
"title": "Parentid"
},
"parentName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the parent Inventory Item.",
"title": "Parentname"
},
"parentUnit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit of measure of the parent Inventory Item.",
"title": "Parentunit"
},
"parentIdCategory": {
"anyOf": [
{
"$ref": "#/$defs/InventoryCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the parent Inventory Item (e.g. ``RawMaterials``)."
},
"taskId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the Task that produced this lot, if any.",
"title": "Taskid"
},
"barcodeId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The barcode ID assigned by Albert.",
"title": "Barcodeid"
},
"expirationDate": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The date the lot expires, in ``YYYY-MM-DD`` format.",
"title": "Expirationdate"
},
"manufacturerLotNumber": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The manufacturer's own lot number for this batch.",
"title": "Manufacturerlotnumber"
},
"number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The lot's number within Albert.",
"title": "Number"
}
},
"required": [
"albertId"
],
"title": "LotSearchItem",
"type": "object"
}
Fields:
-
id(LotId) -
inventory_id(InventoryId | None) -
parent_name(str | None) -
parent_unit(str | None) -
parent_category(InventoryCategory | None) -
task_id(str | None) -
barcode_id(str | None) -
expiration_date(str | None) -
manufacturer_lot_number(str | None) -
lot_number(str | None)
parent_category
parent_category: InventoryCategory | None = None
The category of the parent Inventory Item (e.g. RawMaterials).
manufacturer_lot_number
manufacturer_lot_number: str | None = None
The manufacturer's own lot number for this batch.