Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.commodityai.io/llms.txt

Use this file to discover all available pages before exploring further.

CommodityAI separates product attribute values from quality specifications. Product attributes capture commodity-specific product values, such as origin, variety, form, packing, or product-specific option selections. Quality specifications capture measurable contractual requirements, tolerances, inspection standards, certificates, bonuses, and penalties.

Product Attributes

During Create Contract, quality_attributes accepts a map keyed by product attribute UUID.
Attribute typeValue shape
Scalar attributeString, number, or boolean. Stored as a string.
selectProduct attribute option UUID.
multi_selectArray of product attribute option UUIDs.
{
  "quality_attributes": {
    "a23e4567-e89b-12d3-a456-426614174009": "Brazil",
    "b23e4567-e89b-12d3-a456-426614174010": "c23e4567-e89b-12d3-a456-426614174011",
    "d23e4567-e89b-12d3-a456-426614174012": [
      "e23e4567-e89b-12d3-a456-426614174013"
    ]
  }
}
If product_id is provided, the attributes must belong to that product. Option IDs must belong to the referenced attribute. You can also set product attributes after creation with Set Contract Attribute Values.

Quality Specifications

quality_specifications creates contract-scoped quality rows. product_id is required when explicit quality specifications are provided.
{
  "quality_specifications": [
    {
      "name": "Contract Quality",
      "parameters": [
        {
          "kind": "quality_spec",
          "category": "chemical",
          "name": "Protein",
          "min_value": 34,
          "unit": "%"
        }
      ]
    }
  ]
}
When quality_specifications is omitted and product_id is provided, CommodityAI seeds contract quality specifications from product or grade templates when templates exist.

Parameter Types

Threshold parameters:
FieldNotes
kindOptional threshold.
nameRequired parameter name.
operatorRequired comparison operator.
valueRequired numeric value.
value_maxOptional numeric upper bound.
unitRequired unit.
Measured quality parameters:
FieldNotes
kindRequired quality_spec.
categorychemical, physical, or mechanical.
nameRequired parameter name.
typical_value, min_value, max_valueOptional numeric values.
value_textOptional descriptive value.
unitOptional unit.
basisOptional DMT or WMT.
standard_referenceOptional inspection or standard reference.
remarksOptional notes.
bonus, penaltyOptional adjustment objects.