Install
openclaw skills install farmos-marketingQuery grain marketing positions, contracts, delivery schedules, inventory, and revenue data. Requires authentication — manager role minimum for dashboard, admin for full access.
openclaw skills install farmos-marketingGrain marketing positions, contracts, deliveries, settlements, inventory, and revenue analysis for a corn/soybean operation with 3 entities across ~4,000 acres.
/api/integration/dashboard for summary stats only — NOT for listing positions, deliveries, or settlements.This skill accesses protected FarmOS endpoints that require a JWT token.
To get a token: Run the auth helper with the appropriate role:
TOKEN=$(~/clawd/scripts/farmos-auth.sh admin)
# or for manager-level access:
TOKEN=$(~/clawd/scripts/farmos-auth.sh manager)
To use the token: Include it as a Bearer token:
curl -H "Authorization: Bearer $TOKEN" http://100.102.77.110:8013/api/endpoint
Token expiry: Tokens last 15 minutes. If you get a 401 response, request a new token.
Role mapping: Check the sender's role in ~/.clawdbot/farmos-users.json. If the user is not admin or manager, tell them they don't have access to marketing data.
These provide summary data without authentication. Use for quick lookups and cron jobs.
GET /api/integration/dashboard
Returns: Contract counts, bushels sold, delivery schedule stats, recent settlements.
GET /api/integration/revenue?crop_year=2025&entity_id=1
Returns: Revenue by crop (corn/soybeans), by month, contracted vs projected. Use for cash flow analysis.
GET /api/integration/entities
Returns: All farm entities with id, name, type, short_code. Use to map entity names to IDs.
GET /api/integration/fields?entity_id=1
Returns: Fields with acres, entity ownership shares.
GET /api/integration/acres-summary
Returns: Total acres by entity with field counts and ownership shares.
GET /api/integration/settlements-by-month?crop_year=2025&entity_id=1
Returns: Monthly settlement amounts for cash flow timing.
GET /api/integration/crop-years
Returns: Available crop years with current year flag.
GET /api/dashboard/summary?crop_year=2025 Authorization: Bearer {token} Requires: manager+
Returns comprehensive marketing dashboard:
This is the primary endpoint for "how are we positioned?" questions.
GET /api/positions?crop_year=2025 Authorization: Bearer {token} Requires: manager+
Query params: crop_year, crop (corn|soybeans), entity_id, status (open|fulfilled|cancelled), type (Hedge|Cash Sale|Basis|HTA)
Returns: List of marketing positions/contracts with:
GET /api/positions/export?crop_year=2025 Authorization: Bearer {token} Requires: manager+
Returns: CSV export of all positions.
GET /api/deliveries?crop_year=2025 Authorization: Bearer {token}
Returns: Delivery records with ticket numbers, dates, quantities, moisture, test weight.
GET /api/settlements?crop_year=2025 Authorization: Bearer {token}
Returns: Settlement records — payments received from buyers.
GET /api/inventory?crop_year=2025 Authorization: Bearer {token}
Returns: Current grain inventory status — what's in bins vs sold vs delivered.
GET /api/crop-year-settings?crop_year=2025 Authorization: Bearer {token}
Returns: Expected yield and expected price per crop for the year. These drive projected revenue and percent marketed calculations.
The team agent's marketing access is read-only and logistics-scoped. Use it to connect delivery deadlines to field operations:
Marketing → Field Ops:
Marketing → Equipment:
Don't cross-reference marketing on every field ops question. This matters during harvest, delivery windows, and when logistics questions come up. Not during routine spraying or maintenance.