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 type | Value shape |
|---|
| Scalar attribute | String, number, or boolean. Stored as a string. |
select | Product attribute option UUID. |
multi_select | Array 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:
| Field | Notes |
|---|
kind | Optional threshold. |
name | Required parameter name. |
operator | Required comparison operator. |
value | Required numeric value. |
value_max | Optional numeric upper bound. |
unit | Required unit. |
Measured quality parameters:
| Field | Notes |
|---|
kind | Required quality_spec. |
category | chemical, physical, or mechanical. |
name | Required parameter name. |
typical_value, min_value, max_value | Optional numeric values. |
value_text | Optional descriptive value. |
unit | Optional unit. |
basis | Optional DMT or WMT. |
standard_reference | Optional inspection or standard reference. |
remarks | Optional notes. |
bonus, penalty | Optional adjustment objects. |