Pricings
albert.resources.pricings
LeadTimeUnit
Pricing
Bases: BaseResource
A price entry for an Inventory Item at a given company and location.
A pricing records the cost of a material
(InventoryItem) from a particular
company, at a particular location. A single item can have many pricings.
Create pricings with
create.
Example
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"
},
"Company": {
"description": "A manufacturing company or supplier tracked in Albert.\n\nA Company is the organization that makes or supplies a material. It is the\n``company`` linked on raw-material inventory items: each raw material points\nback to the Company that manufactures it (see\n[`InventoryItem`][albert.resources.inventory.InventoryItem]). Companies are managed\nthrough [`CompanyCollection`][albert.collections.companies.CompanyCollection], accessed as\n``client.companies``.\n\nCompanies are identified by a Company ID (format ``COM...``). A Company is\ntypically minimal: a name plus its assigned ID. You construct one directly\n(``Company(name=\"Acme Chemicals\")``) to create it or to attach it to an\ninventory item.\n\n!!! example\n ```python\n from albert.resources.companies import Company\n\n # Build a company to create or attach to an inventory item\n company = Company(name=\"Acme Chemicals\")\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 company's name. This is the primary identifier used when searching for or creating a company.",
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert Company ID (format ``COM...``). ``None`` until the company is created in or retrieved from Albert.",
"title": "Albertid"
},
"distance": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Search-relevance score returned when the company comes back as a search result. Read-only; not set on companies you build yourself.",
"title": "Distance"
}
},
"required": [
"name"
],
"title": "Company",
"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"
},
"LeadTimeUnit": {
"description": "The unit of measure for a pricing's lead time.\n\nAttributes\n----------\nDAYS : str\n Lead time expressed in days.\nWEEKS : str\n Lead time expressed in weeks.\nMONTHS : str\n Lead time expressed in months.",
"enum": [
"Days",
"Weeks",
"Months"
],
"title": "LeadTimeUnit",
"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"
},
"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"
}
},
"description": "A price entry for an Inventory Item at a given company and location.\n\nA pricing records the cost of a material\n([`InventoryItem`][albert.resources.inventory.InventoryItem]) from a particular\ncompany, at a particular location. A single item can have many pricings.\nCreate pricings with\n[`create`][albert.collections.pricings.PricingCollection.create].\n\n!!! example\n ```python\n from albert.resources.pricings import Pricing\n from albert.resources.companies import Company\n from albert.resources.locations import Location\n\n pricing = Pricing(\n inventory_id=\"INVA9999999\",\n company=Company(name=\"Acme Chemicals\"),\n location=Location(name=\"Pittsburgh\"),\n price=12.50,\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."
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the pricing. Set when the pricing is retrieved from Albert.",
"title": "Albertid"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Inventory ID of the item this pricing is for (format ``INV...``).",
"title": "Parentid"
},
"Company": {
"anyOf": [
{
"$ref": "#/$defs/Company"
},
{
"$ref": "#/$defs/EntityLink"
}
],
"description": "The company the price is quoted from.",
"title": "Company"
},
"Location": {
"anyOf": [
{
"$ref": "#/$defs/Location"
},
{
"$ref": "#/$defs/EntityLink"
}
],
"description": "The location the price applies to.",
"title": "Location"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Free-text description of the pricing.",
"title": "Description"
},
"packSize": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The pack size the price is quoted for. Used to derive cost per unit.",
"title": "Packsize"
},
"price": {
"description": "The price, expressed per kilogram or per liter (currency/kg or currency/L) depending on the item's unit of measure. Convert to that basis before setting.",
"maximum": 9999999999,
"minimum": 0,
"title": "Price",
"type": "number"
},
"currency": {
"default": "USD",
"description": "The currency code for ``price``. Defaults to ``\"USD\"``.",
"title": "Currency",
"type": "string"
},
"fob": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The FOB (free-on-board) shipping term for the pricing.",
"title": "Fob"
},
"leadTime": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "The lead time value, in the unit given by ``lead_time_unit``.",
"title": "Leadtime"
},
"leadTimeUnit": {
"anyOf": [
{
"$ref": "#/$defs/LeadTimeUnit"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit of measure for ``lead_time``."
},
"expirationDate": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The date the pricing expires, in ``YYYY-MM-DD`` format.",
"title": "Expirationdate"
},
"default": {
"anyOf": [
{
"enum": [
0,
1
],
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether this pricing is the default for its inventory item.\n\n``0``: not the default pricing. ``1``: the default pricing for the item\n(only one pricing per item should be default). Cannot be set on create; use\n[`update`][albert.collections.pricings.PricingCollection.update].",
"title": "Default"
}
},
"required": [
"Company",
"Location",
"price"
],
"title": "Pricing",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
id(str | None) -
inventory_id(str | None) -
company(SerializeAsEntityLink[Company]) -
location(SerializeAsEntityLink[Location]) -
description(str | None) -
pack_size(str | None) -
price(float) -
currency(str) -
fob(str | None) -
lead_time(int | None) -
lead_time_unit(LeadTimeUnit | None) -
expiration_date(str | None) -
default(Literal[0, 1] | None)
id
id: str | None = None
The Albert ID of the pricing. Set when the pricing is retrieved from Albert.
inventory_id
inventory_id: str | None = None
The Inventory ID of the item this pricing is for (format INV...).
pack_size
pack_size: str | None = None
The pack size the price is quoted for. Used to derive cost per unit.
price
price: float
The price, expressed per kilogram or per liter (currency/kg or currency/L) depending on the item's unit of measure. Convert to that basis before setting.
expiration_date
expiration_date: str | None = None
The date the pricing expires, in YYYY-MM-DD format.
InventoryPricings
Bases: BaseAlbertModel
The pricings belonging to a single Inventory Item.
Returned by
get_by_inventory_ids
to group each item's pricings under its inventory ID.
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"
},
"Company": {
"description": "A manufacturing company or supplier tracked in Albert.\n\nA Company is the organization that makes or supplies a material. It is the\n``company`` linked on raw-material inventory items: each raw material points\nback to the Company that manufactures it (see\n[`InventoryItem`][albert.resources.inventory.InventoryItem]). Companies are managed\nthrough [`CompanyCollection`][albert.collections.companies.CompanyCollection], accessed as\n``client.companies``.\n\nCompanies are identified by a Company ID (format ``COM...``). A Company is\ntypically minimal: a name plus its assigned ID. You construct one directly\n(``Company(name=\"Acme Chemicals\")``) to create it or to attach it to an\ninventory item.\n\n!!! example\n ```python\n from albert.resources.companies import Company\n\n # Build a company to create or attach to an inventory item\n company = Company(name=\"Acme Chemicals\")\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 company's name. This is the primary identifier used when searching for or creating a company.",
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert Company ID (format ``COM...``). ``None`` until the company is created in or retrieved from Albert.",
"title": "Albertid"
},
"distance": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Search-relevance score returned when the company comes back as a search result. Read-only; not set on companies you build yourself.",
"title": "Distance"
}
},
"required": [
"name"
],
"title": "Company",
"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"
},
"LeadTimeUnit": {
"description": "The unit of measure for a pricing's lead time.\n\nAttributes\n----------\nDAYS : str\n Lead time expressed in days.\nWEEKS : str\n Lead time expressed in weeks.\nMONTHS : str\n Lead time expressed in months.",
"enum": [
"Days",
"Weeks",
"Months"
],
"title": "LeadTimeUnit",
"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"
},
"Pricing": {
"description": "A price entry for an Inventory Item at a given company and location.\n\nA pricing records the cost of a material\n([`InventoryItem`][albert.resources.inventory.InventoryItem]) from a particular\ncompany, at a particular location. A single item can have many pricings.\nCreate pricings with\n[`create`][albert.collections.pricings.PricingCollection.create].\n\n!!! example\n ```python\n from albert.resources.pricings import Pricing\n from albert.resources.companies import Company\n from albert.resources.locations import Location\n\n pricing = Pricing(\n inventory_id=\"INVA9999999\",\n company=Company(name=\"Acme Chemicals\"),\n location=Location(name=\"Pittsburgh\"),\n price=12.50,\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."
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the pricing. Set when the pricing is retrieved from Albert.",
"title": "Albertid"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Inventory ID of the item this pricing is for (format ``INV...``).",
"title": "Parentid"
},
"Company": {
"anyOf": [
{
"$ref": "#/$defs/Company"
},
{
"$ref": "#/$defs/EntityLink"
}
],
"description": "The company the price is quoted from.",
"title": "Company"
},
"Location": {
"anyOf": [
{
"$ref": "#/$defs/Location"
},
{
"$ref": "#/$defs/EntityLink"
}
],
"description": "The location the price applies to.",
"title": "Location"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Free-text description of the pricing.",
"title": "Description"
},
"packSize": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The pack size the price is quoted for. Used to derive cost per unit.",
"title": "Packsize"
},
"price": {
"description": "The price, expressed per kilogram or per liter (currency/kg or currency/L) depending on the item's unit of measure. Convert to that basis before setting.",
"maximum": 9999999999,
"minimum": 0,
"title": "Price",
"type": "number"
},
"currency": {
"default": "USD",
"description": "The currency code for ``price``. Defaults to ``\"USD\"``.",
"title": "Currency",
"type": "string"
},
"fob": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The FOB (free-on-board) shipping term for the pricing.",
"title": "Fob"
},
"leadTime": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "The lead time value, in the unit given by ``lead_time_unit``.",
"title": "Leadtime"
},
"leadTimeUnit": {
"anyOf": [
{
"$ref": "#/$defs/LeadTimeUnit"
},
{
"type": "null"
}
],
"default": null,
"description": "The unit of measure for ``lead_time``."
},
"expirationDate": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The date the pricing expires, in ``YYYY-MM-DD`` format.",
"title": "Expirationdate"
},
"default": {
"anyOf": [
{
"enum": [
0,
1
],
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether this pricing is the default for its inventory item.\n\n``0``: not the default pricing. ``1``: the default pricing for the item\n(only one pricing per item should be default). Cannot be set on create; use\n[`update`][albert.collections.pricings.PricingCollection.update].",
"title": "Default"
}
},
"required": [
"Company",
"Location",
"price"
],
"title": "Pricing",
"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"
}
},
"description": "The pricings belonging to a single Inventory Item.\n\nReturned by\n[`get_by_inventory_ids`][albert.collections.pricings.PricingCollection.get_by_inventory_ids]\nto group each item's pricings under its inventory ID.",
"properties": {
"id": {
"description": "The Inventory ID the pricings belong to (format ``INV...``).",
"title": "Id",
"type": "string"
},
"pricings": {
"description": "The pricings for that item.",
"items": {
"$ref": "#/$defs/Pricing"
},
"title": "Pricings",
"type": "array"
}
},
"required": [
"id",
"pricings"
],
"title": "InventoryPricings",
"type": "object"
}
Fields: