Pricing terms are an advanced contract creation structure. Use them when CommodityAI has enabled formula pricing for your integration and you need to describe how contract price should be interpreted or calculated. Pricing terms are currently created as part of Create Contract.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.
Pricing Term Fields
| Field | Type | Notes |
|---|---|---|
leg_label | string | Optional. Use 0 for a simple contract’s default leg, or A, B, … for tranched legs. |
pricing_role | string | final or provisional. Defaults to final. |
formula_result_type | string | unit_price or total_value. Defaults to unit_price. |
pricing_family | string | Required family key. |
term_kind | string | fixed, index_formula, netback_formula, buyback_formula, split_pricing, import_agent, or other. |
formula_text | string | Optional readable formula. |
formula_ast | object | Required structured formula. |
finalization_trigger | string | Optional rule for when pricing finalizes. |
settlement_terms | string | Optional settlement language. |
output_currency_id | string | Optional currency UUID. |
output_unit_id | string | Optional unit UUID. |
quote_unit_text | string | Optional quote unit label. |
comments | string | Optional notes. |
source_context | object | Optional source/provenance context. |
components | array | Formula components. Defaults to []. |
Components
Each component hascomponent_key, label, and component_type.
Supported component types include market_index, index_average, quality_assay, constant, premium_discount, freight, conversion, moisture, option, formula, external_resale, fee, and other.
Components can also include market_index_id, value_amount, value_type, currency_id, unit_id, quote_unit_text, quality_assay, basis_percent, quotation-period fields, source_text, and metadata.
Use Market Indexes to resolve market_index_id for market_index and index_average components.
Formula AST
formula_ast uses version 1 and a root formula node.
literal, list, component_ref, physical_ref, unary_op, binary_op, comparison_op, logical_op, case, and function.

