FarmOS Land Portfolio
Track owned and leased land, lease terms, landlord relationships, payments, and annual land costs.
CRITICAL: Data Completeness Rules
NEVER use partial or truncated data. These rules are non-negotiable:
- 1. NEVER use
/api/integration/dashboard — it truncates results to 5 items. Partial payment data is worse than no data because it creates a false sense of completeness. - ALWAYS use the
/all endpoints listed below for complete data. - If an endpoint returns an error or empty results, REPORT THE FAILURE to the user. Do not silently fall back to a different endpoint or present partial data.
- ALWAYS state the total count of records returned so the user knows the data is complete. Example: "Found 11 payments due in March totaling $175,058."
- If you cannot get complete data, say so explicitly. "I was unable to retrieve complete payment data" is infinitely better than showing 5 of 11 payments.
When This Skill Triggers
- - "When do our leases expire?"
- "What's the rent on the Smith ground?"
- "Total land costs this year?"
- "Show overdue payments"
- "Landlord contact info"
- "Cost per acre by parcel"
- "List all leased parcels"
- "What payments are due in March?"
- "Cash requirements for next month"
- "Mark payment [X] as paid"
- "Mark all March payments paid"
- "Renew the Smith lease"
- "Preview lease renewals"
Access Control
Lease terms, rent amounts, and landlord info are sensitive business data. Restrict to admin or manager roles only.
Role mapping: Check the sender's role in ~/.openclaw/farmos-users.json. If the user is not admin or manager, tell them they don't have access to land portfolio data.
API Base
http://100.102.77.110:8009
Integration Endpoints (No Auth Required) — READ OPERATIONS ONLY
IMPORTANT: Use auth endpoints for WRITE operations (mark-paid, renewals). Use integration /all endpoints for READ operations (listing payments, leases, landlords).
Payments (FULL — use this, not dashboard)
GET /api/integration/payments/all
- - Returns ALL payments with full details — parcel names, landlord names, overdue status
- Query parameters:
-
status — pending, paid, overdue, scheduled
-
payment_type — rent, mortgage, property_tax, insurance, improvement, other
-
parcel_id — filter by specific parcel
-
due_date_from — YYYY-MM-DD range start
-
due_date_to — YYYY-MM-DD range end
-
crop_year — filter by crop year
- All overdue:
/api/integration/payments/all?status=overdue
- March 2026 payments:
/api/integration/payments/all?due_date_from=2026-03-01&due_date_to=2026-03-31
- All rent payments: INLINECODE12
Upcoming Payments (next N days)
GET /api/integration/payments/upcoming?days=30
- - Returns ALL upcoming payments within N days (no truncation)
- Use
days=60 or days=90 for longer lookahead
Leases (FULL)
GET /api/integration/leases/all
- - Returns ALL leases with landlord contact info, rent terms, expiration status
- Query parameters:
-
status — active, expired
-
landlord_id — filter by landlord
Expiring Leases
GET /api/integration/leases/expiring?days=90
- - Returns ALL leases expiring within N days
Landlords (FULL)
GET /api/integration/landlords/all
- - Returns ALL landlords with contact info, active lease count, total acres, total rent
Parcels
GET /api/integration/parcels
- - Returns ALL parcels with ownership type, acres, county
- Query parameter:
ownership_type — owned, leased
Summary Stats
GET /api/integration/summary
- - Total acres, owned/leased breakdown, parcel/lease/landlord counts, annual cost
Annual Land Costs (by month and entity)
GET /api/integration/finance/costs?year=2026
- - Monthly cost breakdown by category (rent, mortgage, tax, insurance)
- Entity breakdown
- Query parameters:
year, INLINECODE19
Cost Per Field (for P&L)
GET /api/integration/finance/cost-per-field?year=2026
- - Land costs allocated to production fields
- Query parameters:
year, INLINECODE21
Overdue Items
GET /api/integration/tasks/overdue
- - All overdue payments and reminders — high priority items
Actionable Items
GET /api/integration/tasks/actionable?days_ahead=30
- - Upcoming payments, expiring leases, pending reminders
Authenticated Endpoints — WRITE OPERATIONS
These require JWT auth. See Authentication section below.
Authentication
This skill accesses protected FarmOS endpoints that require a JWT token.
To get a token: Run the auth helper with the appropriate role:
CODEBLOCK0
To use the token: Include it as a Bearer token:
CODEBLOCK1
Token expiry: Tokens last 15 minutes. If you get a 401 response, request a new token.
Mark Single Payment Paid
POST /api/payments/{id}/mark-paid
Authorization: Bearer {token}
Content-Type: application/json
Body:
CODEBLOCK2
Mark Multiple Payments Paid (Bulk)
POST /api/payments/bulk/mark-paid
Authorization: Bearer {token}
Content-Type: application/json
Body:
CODEBLOCK3
Mark Payments Paid by Date Range
POST /api/payments/bulk/mark-paid-by-date
Authorization: Bearer {token}
Content-Type: application/json
Body:
CODEBLOCK4
Use this when the user says "mark all March payments as paid" or similar bulk date-based operations.
Preview Lease Renewal
POST /api/leases/renewal-preview
Authorization: Bearer {token}
Content-Type: application/json
Body:
CODEBLOCK5
Returns: Preview of what the renewed leases would look like, including new payment schedules. Use this BEFORE executing bulk renewals so the user can confirm.
Execute Bulk Lease Renewal
POST /api/leases/bulk-renew
Authorization: Bearer {token}
Content-Type: application/json
Body:
CODEBLOCK6
IMPORTANT: Always preview first, confirm with user, then execute.
Year-End Rollover Preview
POST /api/payments/year-end-rollover/preview
Authorization: Bearer {token}
Content-Type: application/json
Body:
CODEBLOCK7
Returns: Preview of payment schedules that would be created for the new crop year.
Year-End Rollover Execute
POST /api/payments/year-end-rollover/execute
Authorization: Bearer {token}
Content-Type: application/json
Body:
CODEBLOCK8
IMPORTANT: This creates next year's payment schedules based on current year leases. Always preview first.
FORBIDDEN Endpoints — Do NOT Use
| Endpoint | Why |
|---|
| INLINECODE22 | Truncates to 5 items. NEVER use this. |
Key Concepts
- - Parcel: A land unit — either owned or leased.
- Lease types: Cash rent, crop share, flex rent.
- Lease expiration: Critical to track — approaching expirations need proactive attention.
- Land payments: Rent, mortgage, property tax, insurance — each with due dates.
Usage Notes
- - Lease expiration tracking is the highest-value query — always flag leases expiring within 6 months.
- Payment status (due/overdue) is critical — flag overdue payments immediately.
- Cost per acre analysis helps compare owned vs leased economics.
- Landlord contact info is private — never share outside admin/manager channels.
- When asked about "cash requirements" or "what do we owe", always use
/api/integration/payments/all with date filtering to get the COMPLETE picture. - For financial planning questions, combine
/api/integration/payments/all with /api/integration/finance/costs for the full view. - Write operations: Always use authenticated endpoints for marking payments paid or renewing leases. Preview first when doing bulk operations.
- Bulk payment marking: When user says "mark all March payments paid", use the bulk-by-date endpoint rather than individual calls.
FarmOS 土地投资组合
跟踪自有和租赁土地、租赁条款、房东关系、付款及年度土地成本。
关键:数据完整性规则
切勿使用部分或截断的数据。以下规则不可协商:
- 1. 切勿使用 /api/integration/dashboard — 该接口会将结果截断为5项。部分付款数据比没有数据更糟糕,因为它会造成数据完整的虚假印象。
- 始终使用下方列出的 /all 端点 以获取完整数据。
- 如果端点返回错误或空结果,向用户报告失败。 不要静默回退到其他端点或呈现部分数据。
- 始终说明返回记录的总数,以便用户知道数据是完整的。例如:发现3月份有11笔应付款项,总计175,058美元。
- 如果无法获取完整数据,请明确说明。 我无法检索到完整的付款数据 远比显示11笔中的5笔要好得多。
触发此技能的场景
- - 我们的租约什么时候到期?
- 史密斯地块的租金是多少?
- 今年的土地总成本?
- 显示逾期付款
- 房东联系信息
- 每英亩成本按地块划分
- 列出所有租赁地块
- 3月份有哪些应付款项?
- 下个月的现金需求
- 将付款[X]标记为已付
- 将所有3月份付款标记为已付
- 续签史密斯租约
- 预览租约续签
访问控制
租赁条款、租金金额和房东信息属于敏感业务数据。仅限管理员或经理角色访问。
角色映射: 在 ~/.openclaw/farmos-users.json 中检查发送者的角色。如果用户不是管理员或经理,告知他们无权访问土地投资组合数据。
API 基础地址
http://100.102.77.110:8009
集成端点(无需认证)— 仅读取操作
重要提示:写入操作(标记已付、续签)使用认证端点。读取操作(列出付款、租约、房东)使用集成 /all 端点。
付款(完整 — 使用此端点,而非仪表盘)
GET /api/integration/payments/all
- - 返回所有付款的完整详情 — 地块名称、房东姓名、逾期状态
- 查询参数:
- status — 待处理、已付、逾期、已安排
- payment_type — 租金、抵押贷款、房产税、保险、改良、其他
- parcel_id — 按特定地块筛选
- due
datefrom — YYYY-MM-DD 范围起始
- due
dateto — YYYY-MM-DD 范围结束
- crop_year — 按作物年度筛选
- 所有逾期:/api/integration/payments/all?status=overdue
- 2026年3月付款:/api/integration/payments/all?due
datefrom=2026-03-01&due
dateto=2026-03-31
- 所有租金付款:/api/integration/payments/all?payment_type=rent
即将到来的付款(未来N天)
GET /api/integration/payments/upcoming?days=30
- - 返回未来N天内所有即将到来的付款(无截断)
- 使用 days=60 或 days=90 进行更长时间的前瞻
租约(完整)
GET /api/integration/leases/all
- - 返回所有租约,包含房东联系信息、租金条款、到期状态
- 查询参数:
- status — 活跃、已过期
- landlord_id — 按房东筛选
即将到期的租约
GET /api/integration/leases/expiring?days=90
房东(完整)
GET /api/integration/landlords/all
- - 返回所有房东,包含联系信息、活跃租约数量、总英亩数、总租金
地块
GET /api/integration/parcels
- - 返回所有地块,包含所有权类型、英亩数、县
- 查询参数:ownership_type — 自有、租赁
汇总统计
GET /api/integration/summary
- - 总英亩数、自有/租赁细分、地块/租约/房东数量、年度成本
年度土地成本(按月份和实体)
GET /api/integration/finance/costs?year=2026
- - 按类别(租金、抵押贷款、税费、保险)的月度成本细分
- 实体细分
- 查询参数:year、entity_id
每块田地成本(用于损益表)
GET /api/integration/finance/cost-per-field?year=2026
- - 分配到生产田地的土地成本
- 查询参数:year、entity_id
逾期项目
GET /api/integration/tasks/overdue
可操作项目
GET /api/integration/tasks/actionable?days_ahead=30
认证端点 — 写入操作
这些需要JWT认证。请参阅下方的认证部分。
认证
此技能访问受保护的FarmOS端点,需要JWT令牌。
获取令牌: 使用相应角色运行认证助手:
bash
TOKEN=$(~/clawd/scripts/farmos-auth.sh admin)
使用令牌: 将其作为Bearer令牌包含:
bash
curl -H Authorization: Bearer $TOKEN http://100.102.77.110:8009/api/endpoint
令牌过期: 令牌有效期为15分钟。如果收到401响应,请请求新令牌。
将单笔付款标记为已付
POST /api/payments/{id}/mark-paid
Authorization: Bearer {token}
Content-Type: application/json
请求体:
json
{
paid_date: 2026-02-15,
notes: 支票 #1234
}
批量将多笔付款标记为已付
POST /api/payments/bulk/mark-paid
Authorization: Bearer {token}
Content-Type: application/json
请求体:
json
{
payment_ids: [12, 34, 56],
paid_date: 2026-02-15,
notes: 批量支票处理
}
按日期范围将付款标记为已付
POST /api/payments/bulk/mark-paid-by-date
Authorization: Bearer {token}
Content-Type: application/json
请求体:
json
{
duedatefrom: 2026-03-01,
duedateto: 2026-03-31,
paid_date: 2026-02-15,
payment_type: rent,
notes: 3月份租金付款
}
当用户说将所有3月份付款标记为已付或类似的批量基于日期的操作时使用此端点。
预览租约续签
POST /api/leases/renewal-preview
Authorization: Bearer {token}
Content-Type: application/json
请求体:
json
{
lease_ids: [5, 12],
newstartdate: 2027-03-01,
rentincreasepercent: 3.0
}
返回:续签后租约的预览,包括新的付款计划。在执行批量续签之前使用此端点,以便用户确认。
执行批量租约续签
POST /api/leases/bulk-renew
Authorization: Bearer {token}
Content-Type: application/json
请求体:
json
{
lease_ids: [5, 12],
newstartdate: 2027-03-01,
newenddate: 2028-02-28,
newrentamount: 52000.00,
rentincreasepercent: 3.0,
notes: 年度续签,涨幅3%
}
重要提示: 始终先预览,与用户确认,然后执行。
年末结转预览
POST /api/payments/year-end-rollover/preview
Authorization: Bearer {token}
Content-Type: application/json
请求体:
json
{
from_year: 2026,
to_year: 2027
}
返回:将为新作物年度创建的付款计划预览。
年末结转执行
POST /api/payments/year-end-rollover/execute
Authorization: Bearer {token}
Content-Type: application/json
请求体:
json
{
from_year: 2026,
to_year: 2027,
applyrentincrease: true,
rentincreasepercent: 2.5
}
重要提示