API & hardware integrations
FarmTrace exposes authenticated REST endpoints for harvest, spray, packhouse, compliance, and IoT cold-chain data. Hardware partners (Zebra scanners, temperature loggers, MQTT gateways) can push readings via JSON or CSV.
Authentication
Trace API routes require a logged-in FarmTrace user session (Supabase JWT cookie). Partner integrations use farm service accounts — contact sales@origamitech.co.ke.
IoT reading example
POST /api/trace/iot/readings
{
"readings": [{
"location": "cold_room_a",
"temperature_c": 4.2,
"humidity_pct": 85,
"device_serial": "SENSOR-001",
"packhouse_record_id": "optional-uuid"
}]
}Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/trace/iot/devices | List registered temperature loggers |
| POST | /api/trace/iot/devices | Register device by serial number and location |
| POST | /api/trace/iot/readings | Ingest batch sensor readings (JSON array) |
| POST | /api/trace/iot/import | Bulk CSV import of temperature readings |
| POST | /api/trace/cold-chain | Manual cold-chain temperature log |
| POST | /api/trace/harvest | Create harvest batch record |
| POST | /api/trace/spray | Log spray event with PHI calculation |
| GET | /api/trace/compliance/{batchId}/export?format=csv | Export audit pack |
| GET | /api/trace/journey/{token} | Public buyer QR journey (no auth) |
Supported hardware
- Zebra ZQ mobile printers + TC26/CT60 scanners (field harvest labels)
- Bluetooth temperature loggers via CSV import or HTTP webhook
- Manual packhouse entry on basic Android handsets
IoT Sensors (in-app dashboard) · Sample buyer QR journey · Sample audit pack