Skip to main content
GET
/
api
/
v1
/
contracts
curl -X GET "https://commodityai.app/api/v1/contracts" \
  -H "Authorization: Bearer cai_live_your_api_key_here"
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "contract_number": "P0001",
    "external_reference": "ERP-PO-10024",
    "type": "purchase",
    "status": "active",
    "counterparty_id": "223e4567-e89b-12d3-a456-426614174001",
    "product": "Soybeans",
    "quantity": "50000",
    "quantity_unit_id": "323e4567-e89b-12d3-a456-426614174002",
    "shipment_start": "2026-06-01",
    "shipment_end": "2026-06-30",
    "created_at": "2026-05-19T17:30:00Z",
    "updated_at": "2026-05-19T17:30:00Z"
  }
]

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.

Returns the contracts available to your company, including purchase and sale agreements.

Request Example

curl -X GET "https://commodityai.app/api/v1/contracts" \
  -H "Authorization: Bearer cai_live_your_api_key_here"

Response

[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "contract_number": "P0001",
    "external_reference": "ERP-PO-10024",
    "type": "purchase",
    "status": "active",
    "counterparty_id": "223e4567-e89b-12d3-a456-426614174001",
    "product": "Soybeans",
    "quantity": "50000",
    "quantity_unit_id": "323e4567-e89b-12d3-a456-426614174002",
    "shipment_start": "2026-06-01",
    "shipment_end": "2026-06-30",
    "created_at": "2026-05-19T17:30:00Z",
    "updated_at": "2026-05-19T17:30:00Z"
  }
]

Response Fields

id
string
Unique contract ID.
contract_number
string
CommodityAI generated contract reference, such as P0001 or S0001.
external_reference
string
Optional source-system reference.
type
string
Contract side. Values: purchase, sale.
status
string
Lifecycle status. Values: draft, active, fulfilled, closed.