For integrators & hardware vendors

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

MethodPathDescription
GET/api/trace/iot/devicesList registered temperature loggers
POST/api/trace/iot/devicesRegister device by serial number and location
POST/api/trace/iot/readingsIngest batch sensor readings (JSON array)
POST/api/trace/iot/importBulk CSV import of temperature readings
POST/api/trace/cold-chainManual cold-chain temperature log
POST/api/trace/harvestCreate harvest batch record
POST/api/trace/sprayLog spray event with PHI calculation
GET/api/trace/compliance/{batchId}/export?format=csvExport audit pack
GET/api/trace/journey/{token}Public buyer QR journey (no auth)

Supported hardware

IoT Sensors (in-app dashboard) · Sample buyer QR journey · Sample audit pack